[pypy-dev] Telling the JIT to remove a stack array

Timothy Baldridge tbaldridge at gmail.com
Mon Feb 24 21:37:35 CET 2014


That did the trick. My "count up" program now consists of int_eq, a guard
and int_add, that's what I wanted to see.  Thanks!

Timothy


On Sun, Feb 23, 2014 at 1:06 AM, Armin Rigo <arigo at tunes.org> wrote:

> Hi Timothy,
>
> On 23 February 2014 01:24, Timothy Baldridge <tbaldridge at gmail.com> wrote:
> > I tried digging into the PyPy source to find how how this is done there,
> but
> > I haven't been able to find it yet.
>
> pypy/interpreter/pyframe.py: self.locals_stack_w.  The trick is that
> it's an attribute of a "frame" class, which is itself turned into a
> virtualizable with a special declaration about the attribute.  See
> ``PyFrame._virtualizable_ = ['locals_stack_w[*]']'' in
> pypy/module/pypyjit/interp_jit.py.  It's currently the only way to
> trigger special behavior about the list: you have to make it a
> special attribute of a virtualizable "frame" class.
>
>
> A bientôt,
>
> Armin.
>



-- 
"One of the main causes of the fall of the Roman Empire was that-lacking
zero-they had no way to indicate successful termination of their C
programs."
(Robert Firth)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/pypy-dev/attachments/20140224/c36045fa/attachment.html>


More information about the pypy-dev mailing list