Hi!
We're working with Hernan Wilkinson on the Live Typing VM implementation and have recently found a very strange behaviour. We are trying to capture the type of objects stored within an OrderedCollection by intercepting the at:put: method of Object, since that's what ends up being executed internally by the OrderedCollection using an internal Array. To identify whether the at:put: is being executed from that OrderCollection context we inspect the MethodContext nesting.
So far we have intercepted the StackInterpreter commonAtPut: to execute our logic, which attempts to retrieve the current MethodContext, analyse up to 4 levels up looking for an OrderedCollection receiver and in that case store the type information.
The problem is that our code never executes on a regular execution but does while debugging. In fact, it works as expected when we simply hit "Proceed" but fails when we hit "Over" instead, which is quite unexpected.
We would like to know if there's anything we might be missing here about the execution of primitives like at:put: or acquiring the current MethodContext from the VM side.
Thanks!
On 2019-04-28, at 11:04 AM, Ana Laura Felisatti anafelisatti@gmail.com wrote:
So far we have intercepted the StackInterpreter commonAtPut: to execute our logic, which attempts to retrieve the current MethodContext, analyse up to 4 levels up looking for an OrderedCollection receiver and in that case store the type information.
The problem is that our code never executes on a regular execution but does while debugging. In fact, it works as expected when we simply hit "Proceed" but fails when we hit "Over" instead, which is quite unexpected.
We would like to know if there's anything we might be missing here about the execution of primitives like at:put: or acquiring the current MethodContext from the VM side.
It's possible that the commonAtPut() routine has been inlined (looks that way in an ancient copy of interp.c I have lying around) and so if you are trapping in a debugger on the actual routine start then it would be unlikely to hit. If you've modified the commonAtPut() code, then this is unlikely to be a good explanation.
How exactly have you generated the VM? That might tell us something useful.
tim -- tim Rowledge; tim@rowledge.org; http://www.rowledge.org/tim Strange OpCodes: IO: Illogical Or
vm-dev@lists.squeakfoundation.org