Hi Nicolai,On Wed, Oct 7, 2015 at 2:13 PM, Nicolai Hess <nicolaihess@web.de> wrote:2015-10-07 16:49 GMT+02:00 Marcus Denker <marcus.denker@inria.fr>:
> On 07 Oct 2015, at 15:49, Marco Naddeo <naddeo@di.unito.it> wrote:
>
> Hi,
>
> I have some problems with the large block at bottom:
>
> -sending the message argumentNames gives me an empty array #()
> -sending the message sourceNode gives me a strange result and not a RBBlockNode, as I would expect
>
This happens already with:
[�� :h :s :v |�� �� | min chroma hdash X red green blue | ] sourceNode
I will check��� it is a bug in the mapping pc -> AST.That's interesting, the way the pc is mapped to the AST (ir instructionForPC: )takes the "length" of the instruction bytecode into account and the length of a pushclosure includesall bytes needed for the pushing the local temps (pushConstant nil. pushConstant nil ....)But the startPC of a block context starts at the first push, not after, that means
self method sourceNodeForPC: self startpc - 1starts the search after the push closure bytecode but before any push local temp byte code.Either we don't include the bytecodes for the "pushConstant:nil" in the bytecode offset, or we start the search at
self method sourceNodeForPC: self startpc - 1 + self numLocalTempsNo, no, no, no, no :-).��
self method sourceNodeForPC: self startpc - 4
and make sure that the compiler maps a block creation bytecode to the source node for the entire block.
The way to think about "self method sourceNodeForPC: self startpc - 1 + self numLocalTemps" not masking sense is that a pc inside the block must map to a statement inside the block, not the block itself.
HTH
��
�� �� �� �� Marcus
--_,,,^..^,,,_best,��Eliot