Context reflection regression?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Context reflection regression?

Igor Stasenko
I just found that

a: a b: b c: c
   ^ thisContext sender stackPtr

answers 0  :(

while, in order to call the above method , a caller, obviously needs
to push 4 values on stack:
 - push receiver
 - push a
 - push b
 - push c
 - send #a:b:c:

so, a method's caller context stack _should_ contain at least 4 elements.

So, either i wrong, or VM doesn't tracking the context's sp value
correctly anymore.

--
Best regards,
Igor Stasenko AKA sig.

Reply | Threaded
Open this post in threaded view
|

Re: Context reflection regression?

Hans-Martin Mosner
Igor Stasenko schrieb:
> I just found that
>
> a: a b: b c: c
>    ^ thisContext sender stackPtr
>
> answers 0  :(
>  
Which is entirely correct and has been like that since the beginning of
ages :-)
By the time you're looking at the stack of "thisContext sender", the 4
values are not there anymore because they have been moved into the stack
of thisContext. Look at Interpreter>>internalActivateNewMethod, near the
bottom of that method it says "self internalPop: argCount2 + 1". That's
where your stackPtr changes from 4 to 0.
If you would look at the sending context just prior to the send
bytecode, you'd see a stackPtr of 4.

Cheers,
Hans-Martin


Reply | Threaded
Open this post in threaded view
|

Re: Context reflection regression?

Igor Stasenko
On 11 April 2010 18:23, Hans-Martin Mosner <[hidden email]> wrote:

> Igor Stasenko schrieb:
>> I just found that
>>
>> a: a b: b c: c
>>    ^ thisContext sender stackPtr
>>
>> answers 0  :(
>>
> Which is entirely correct and has been like that since the beginning of
> ages :-)
> By the time you're looking at the stack of "thisContext sender", the 4
> values are not there anymore because they have been moved into the stack
> of thisContext. Look at Interpreter>>internalActivateNewMethod, near the
> bottom of that method it says "self internalPop: argCount2 + 1". That's
> where your stackPtr changes from 4 to 0.
> If you would look at the sending context just prior to the send
> bytecode, you'd see a stackPtr of 4.
>
I see..
i thought i could use #pop , and then restart a context from previous
instruction :)
but i found other way to do what i need.

> Cheers,
> Hans-Martin
>
>
>



--
Best regards,
Igor Stasenko AKA sig.