[Vm-dev] Re: inInterpreter assignment position

Ben Coman btc at openinworld.com
Thu May 19 18:25:13 UTC 2016


Just to follow up myself, I notice that #transferTo:from:
zeros instructionPointer after it is pushed to the stack.
So the assignment has to be at least before that.
cheers -ben

On Thu, May 19, 2016 at 8:01 PM, Ben Coman <btc at openinworld.com> wrote:
> At the end of CoInterpreterPrimitives>>primitiveEnterCriticalSection we have...
>   inInterpreter := instructionPointer >= objectMemory startOfMemory.
>   self addLastLink: activeProc toList: criticalSection.
>   self transferTo: self wakeHighestPriority from: CSEnterCriticalSection.
>   self forProcessPrimitiveReturnToExecutivePostContextSwitch: inInterpreter
>
> The natural place to assign inInterpreter would seem to be the line
> before it is used, so my curiosity is piqued...  Is it important the
> assignment to inInterpreter occurs where it does, before both
> addLastLink:toList and transferTo:from:  ?  From looking at the call
> to startOfMemory it seems that its not.
>
> The reason I ask is (for example) the addLastLink line is identical to
> InterpreterPrimitives>>primitiveEnterCriticalSection, so if that line
> moved up, the two methods would be more alike, so when flipping
> between the two implementations in "Implementors of", the differences
> would be more pronounced.  Also its a chance to learn another small
> part of the VM. Till now I just blindly copied that part for the
> OwnedLock primitives,
>
> cheers -ben


More information about the Vm-dev mailing list