On Fri, Mar 30, 2012 at 3:18 PM, Alex Gaynor <[email protected]> wrote: >> >> sa = 0 >> a = (1, 2.0) >> while sa < 3000: >> sa += a[0] + a[1] >> if sa > 1500: >> a = (a[1], a[0]) >> > > My idea is approximately you promote the shape whenever the index of a read > is constant.
But you would still need a guard about the type, right? > Otherwise you produce a read on the shape, and a guard about > the type. These guards we'll need to be added to the virtualstate in the same way as guards regarding the length of an array is treated. If those guards are always explicit guards that should be simple. But if they are implicit it might be tricky. By implicit I mean things like after getarrayitem_gc(p0, 7) we will assume that the length of p0 is at least 8. The alternative is to not allow this kind of information to propagate across loop boundaries, like we do with unerased pointers. In that case the "guards" about the types are implied by the surrounding rpython code and there is no way for the jit to extract the information. > > Alex > > -- > "I disapprove of what you say, but I will defend to the death your right to > say it." -- Evelyn Beatrice Hall (summarizing Voltaire) > "The people's good is the highest law." -- Cicero > -- Håkan Ardö _______________________________________________ pypy-dev mailing list [email protected] http://mail.python.org/mailman/listinfo/pypy-dev
