[Vm-dev] handleCallOrJumpSimulationTrap: curiousity

Clément Bera bera.clement at gmail.com
Fri May 20 12:44:57 UTC 2016


Hi Ben,

The primitives present here are the primitives which create a new stack
frame or switch to another one.

In your new primitives:
- do you create a new stack frame ? For example, primitiveClosureValue
creates a new stack frame for the block evaluation. I don't think that is
the case.
- do you potentially switch to another process ? For example, primitiveResume
may switch execution to the resumed process if it has a higher priority, so
the active stack frame may have changed. It could be that you have
primitives like that.

I'd recommend you not to change that method right now. Instead, you
implement your code, then run it in the VM simulator to ensure everything
works fine. If the simulator halts in handleCallOrJumpSimulationTrap, then
add your primitive here if relevant, else just ignore that method. Changing
this method ahead of time doesn't feel like a good idea.

Have fun :-)

On Fri, May 20, 2016 at 1:46 PM, Ben Coman <btc at openinworld.com> wrote:

>
> Minor curiosity & clueless speculation...  in passing I came across
> the following in #handleCallOrJumpSimulationTrap and given the
> similarity of critical section and  ownedlock primitives to alter the
> running process like primitiveWait, I wondered if they should also be
> in this list ...
>
>
> "Verify the stack layout assumption compileInterpreterPrimitive:
> makes, provided we've not called something that has built a frame,
> such as closure value or evaluate method, **or switched frames**,
> such as primitiveSignal, primitiveWait, primitiveResume,
> primitiveSuspend et al."
>
> ifTrue: [(#( primitiveClosureValue primitiveClosureValueWithArgs
> primitiveClosureValueNoContextSwitch
> primitiveFullClosureValue primitiveFullClosureValueWithArgs
> primitiveFullClosureValueNoContextSwitch
> primitiveSignal primitiveWait primitiveResume primitiveSuspend
> primitiveYield
> primitiveExecuteMethodArgsArray primitiveExecuteMethod
> primitivePerform primitivePerformWithArgs primitivePerformInSuperclass
> primitiveTerminateTo primitiveStoreStackp primitiveDoPrimitiveWithArgs)
>
> cheers -ben
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20160520/65361d61/attachment.htm


More information about the Vm-dev mailing list