On May 15, 2013, at 3:41 PM, Clément Bera <[email protected]> wrote:

> Sorry with the strike and no metro I cannot be at INRIA today. I'm at Marcus 
> right now we will have a look at your slice now :)
> 

So we looked… and there is a problem with 

readWith: anInterpreter inNode: aVariableNode
        self isArg ifTrue: [ 
                | definingScope argIndex |
                definingScope := aVariableNode scope lookupScopeForVar: 
aVariableNode name.
                argIndex := definingScope node argumentNames indexOf: name.
                ^ anInterpreter readArgumentAt: argIndex node: aVariableNode
        ].
        "If it is not an arg, it is a normal temporary"
        ^ anInterpreter readTemporaryAt: -1 named: name


When generating byte code with closures the way they are implemented (with 
escaping variables allocated
in Arrays on the heap), we can not assign any meaningful index to temps.
(there is an index ivar, but this needs to be cleaned up).

Now temps and args are modelled the same, but all kinds indexes that you could 
calculate are meaningless.
Especially 

argIndex := definingScope node argumentNames indexOf: name.

does not need to be consistent with the actual position of the arg… in edge 
cases.

So we need to think about this… maybe introducing a OCArgVariable (with index) 
is the only way to do it.

        Marcus

Reply via email to