[Pharo-project] quick methods and the method call stack

Eliot Miranda eliot.miranda at gmail.com
Thu Mar 15 14:11:51 EDT 2012


On Wed, Mar 14, 2012 at 11:19 AM, Alexandre Bergel
<alexandre.bergel at me.com>wrote:

> Hi!
>
> Can someone confirm or infirm the following: A quick method (ie. the
> compiled methods answer true to the message isQuick) is executed without
> creating a stack frame. Is that true?
>

Yes, at least in the interpreter.  In Cog, if jitted, such methods run in a
leaf frame (only the return address is pushed), and additional tests in the
JIT allow many other methods to run with only a leaf frame.  See
needsFrameNever: and needsFrameIfInBlock: and senders in the Cog VM source.
 If all the bytecodes in a method are marked with needsFrameNever: or
needsFrameIfInBlock: then the method can be (and is) compiled frameless.
 if all the bytecodes in a block are marked with needsFrameNever: then the
block can be (and is) compiled frameless.


>
> Cheers,
> Alexandre
> --
> _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
> Alexandre Bergel  http://www.bergel.eu
> ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
>
>
>
>
>
>
>


-- 
best,
Eliot
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pharo.org/pipermail/pharo-dev_lists.pharo.org/attachments/20120315/08a89737/attachment-0001.html>


More information about the Pharo-dev mailing list