Hi Nicolai,On Thu, Oct 8, 2015 at 2:27 PM, Nicolai Hess <nicolaihess@web.de> wrote:Hello Eliot, and thanks for your time.
In our (pharo) implementation for sourceNodeForPC, we start at the AST-Node ofthe compiled method,�� get the IR (IntermediateRepresentation) and scan this sequence of IRNodesuntil we finally find that one, that maps to the bytecode of the closure creation code (this should be a IRPushClosureCopy).The problem is now, we don't find (always) the right IRNode, and it depens on the number of local temps, if this is > 3 we don't hit the right one.That's very strange.�� Can you construct a synthetic example of two simple blocks, one with three temps and and one with four temps and show me the difference in the byte code?
And my interpretation was, the IRPushClosureCopy node has the wrong "bytecode offset" (whatever this is). The bytecodeOffset value (somehow)depends on the number of local temps, but maybe this is right (for whatever this is used) and we are just using it wrong for in this situation.So you need to ask Marcus how to interpret bytecodeOffset.�� The thing is, it should be simple.�� One has:�� �� BlockCreationBytecode�� �� any number of pushConstant: nil's (0 to N)�� �� first byte code in block�� �� last bytecode in block (always a blockReturnTop)and a block's startup is always that of the byte immediately following the BlockCreationBytecode.�� So if the byte code offset is somehow the span of the "any number of pushConstant: nil's (0 to N)" then there's a bug in the IR somewhere when the number of temps is > 3.�� But if that's not what it means then, well, I don't know what the problem is.��