[squeak-dev] Divergence between VM and debugger handling of primitives

Ryan Macnak rmacnak at gmail.com
Wed Nov 14 20:39:31 UTC 2012


I have noticed that the execution simulation (ContextPart) and the VM
differ in how they handle primitives with extra arguments. The execution
simulation takes arguments relative to the base of the stack, but the VM
takes them relative to the top of the stack. Most uses of primitives don't
have extra arguments and this distinction does not affect them, but
Newspeak takes advantage of the VM's behavior to implement
primitives-as-capabilities without a VM change.

For example, primitive 188:

Normal code
a withArguments: {b. c} executeMethod: m
"Execute the method m, with a as the receiver, and with b and c as the
arguments"

VMMirror
vmmirror on: a withArguments: {b. c} executeMethod: m
"VM: Execute the method m, with a as the receiver, and with b and c as the
arguments. "
"Debugger: Try to execute {b. c}, fail because it doesn't behave like a
method"

Are there any objections to making the execution simulation behave like the
VM?

Ryan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20121114/423f9309/attachment-0001.htm


More information about the Squeak-dev mailing list