help-smalltalk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-smalltalk] About sp and thisContext->spOffset


From: Paolo Bonzini
Subject: Re: [Help-smalltalk] About sp and thisContext->spOffset
Date: Fri, 27 Aug 2010 09:41:51 +0200
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.10) Gecko/20100621 Fedora/3.0.5-1.fc13 Lightning/1.0b2pre Mnenhy/0.8.3 Thunderbird/3.0.5

On 08/26/2010 05:45 PM, Mathieu Suen wrote:
Hi,

AFAIK sp in a context take in account the temporaries.
This mean the if you have 1 temp sp is equal to 1 at the beginning of the
function (minus the fact the is lazily sync but that is not my point)
 From that there is something I don't understand:
In smalltalk I got the following example:

     | method |
     method := (STInST.RBParser parseMethod: 'foo ^12') jitMethodIn: A.
     A methodDictionary at: #foo put: method.
     A new foo printNl

I would expected to be FROM_INT(2) aka 5 since you have (A new) push on the
stack.
What did I miss-understood?

Temporaries in the REPL are kind of special because they must survive multiple evaluations. So, they are treated as globals (or as instance variables in VisualGST).

Try wrapping your test with Eval [ ... ], which will delimit the scope of the "method" variable, and sp will be 2 as expected.

Paolo



reply via email to

[Prev in Thread] Current Thread [Next in Thread]