[pypy-dev] Virtualizables in RPython

Antonio Cuni anto.cuni at gmail.com
Wed Apr 30 14:29:48 CEST 2014


On Wed, Apr 30, 2014 at 1:11 PM, Anton Gulenko <
anton.gulenko at student.hpi.uni-potsdam.de> wrote:

> I'll try to make the example that Tim mentioned more clear.
> Building up the deep stack was done INSIDE the loop. It was also the only
> thing that happened inside the loop.
> That's why we expected the traces for deep and shallow stacks to be very
> similar - shouldn't the optimizer simply eliminate the additional frame
> objects?
> Also, the relevant fields in the frame objects are indeed marked as
> virtualizable in the SPy VM.
> The smalltalk code was basically this, with a varying argument to
> buildStack:
>
> buildStack: depth
>      depth <= 0 ifTrue: [ ^ nil ].
>      self buildStack: depth - 1
>
> 100000 timesRepeat: [ self buildStack: 100 ]
>
> Do you have any thoughts regarding this example?
>

​just a wild guess: it might be possible that in this example the trace
becomes too long, so tracing aborts and the function is marked as "trace
from start"? In that case, the function call cannot be inlined and needs to
be turned into a real assembler recursive call, which means that the frame
cannot be a virtual because it needs to be passed as an argument.​
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/pypy-dev/attachments/20140430/8c960952/attachment.html>


More information about the pypy-dev mailing list