'From Squeak3.2gamma of 15 January 2002 [latest update: #4913] on 9 August 2002 at 11:27:53 am'! "Change Set: MorePluginTerm(ination)-JMM Date: 9 August 2002 Author: johnmci@smalltalkconsulting.com when we run as a browser plugin we need to know when to terminate the interp main loop. This is done by checking a flag and invoking plugInTimeToReturn which becomes a C macro to issue the return. This was done at on a long unconditional jump, or execution of a new method. However in the case were Squeak is idle, and only the idle processes is running, then the termination code will not run. Therefore I made an additional call in internalExecuteNewMethod to do the check after invoking a primitive. This cleaned up cases of hung Squeak plugins under os-x"! !Interpreter methodsFor: 'message sending' stamp: 'JMM 8/9/2002 10:39'! internalExecuteNewMethod | localPrimIndex | self inline: true. localPrimIndex _ primitiveIndex. localPrimIndex > 0 ifTrue: [(localPrimIndex > 255 and: [localPrimIndex < 520]) ifTrue: ["Internal return instvars" localPrimIndex >= 264 ifTrue: [^ self internalPop: 1 thenPush: (self fetchPointer: localPrimIndex-264 ofObject: self internalStackTop)] ifFalse: ["Internal return constants" localPrimIndex = 256 ifTrue: [^ nil "^ self"]. localPrimIndex = 257 ifTrue: [^ self internalPop: 1 thenPush: trueObj]. localPrimIndex = 258 ifTrue: [^ self internalPop: 1 thenPush: falseObj]. localPrimIndex = 259 ifTrue: [^ self internalPop: 1 thenPush: nilObj]. ^ self internalPop: 1 thenPush: (self integerObjectOf: localPrimIndex-261)]] ifFalse: [self externalizeIPandSP. self primitiveResponse. self internalizeIPandSP. successFlag ifTrue: ["When Squeak runs as a browser plugin, it must return control to the browser periodically. This should done only when the state of the currently running Squeak thread is safely stored in the object heap, as is the case at this point. Since this method is inlined, the message 'ReturnFromInterpret' is actually a C macro that returns control from the interpret() method to the browser that called it." GenerateBrowserPlugin ifTrue: [self plugInTimeToReturn ifTrue: [self ReturnFromInterpret]]. ^ nil]]]. "if not primitive, or primitive failed, activate the method" self internalActivateNewMethod. "check for possible interrupts at each real send" self internalQuickCheckForInterrupts! !