[Vm-dev] startpc (method) of full block closures

Florin Mateoc florin.mateoc at gmail.com
Wed May 18 05:07:38 UTC 2022


I have found an issue (that I don't think it has been discussed here
before), and I wanted to ask for advice on how to handle it:

The startpc method overridden in FullBlockClosure does not have the same
semantics as the method it overrides (from BlockClosure).
In BlockClosure, startpc points to where the block starts within its
parent's bytecodes, whereas in FullBlockClosure the startpc method returns
the initialPC of the closure within its own method, so it points to where
the block starts within its own bytecodes.
This is not just a change in semantics, but it is also a disconnect from
what a decompiled block node's pc is showing. The decompiled node's pc
still has the old semantics, even though the block node is now translated
to a full block closure.

This old semantics (of an address within the parent) was a quite useful
feature, since it allowed one to match a closure to its corresponding block
node in the AST (even though the pc was only set correctly by the
decompiler and not by the compiler), but this now seems impossible. Or
maybe I just don't see it. Any idea on how to solve this ?

Thank you,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20220518/15cff71d/attachment.html>

More information about the Vm-dev mailing list