[Vm-dev] VM Maker: VMMaker.oscog-eem.1892.mcz

commits at source.squeak.org commits at source.squeak.org
Thu Jun 30 00:00:46 UTC 2016


Eliot Miranda uploaded a new version of VMMaker to project VM Maker:
http://source.squeak.org/VMMaker/VMMaker.oscog-eem.1892.mcz

==================== Summary ====================

Name: VMMaker.oscog-eem.1892
Author: eem
Time: 29 June 2016, 4:59:05.109418 pm
UUID: 51671a87-df9b-49c2-8972-b9fe8eb0cf5f
Ancestors: VMMaker.oscog-eem.1891

Fix assert failure in primitiveVoidVMStateForMethod.  The instructrionPointer must be pushed after the frame is married.

In 1892 the Liverpool Football Club is founded by John Houlding, the owner of Anfield. Houlding decides to form his own team after Everton leaves Anfield in an argument over rent.

=============== Diff against VMMaker.oscog-eem.1891 ===============

Item was changed:
  ----- Method: CoInterpreterPrimitives>>primitiveVoidVMStateForMethod (in category 'system control primitives') -----
  primitiveVoidVMStateForMethod
  	"The receiver is a compiledMethod.  Clear all VM state associated with the method,
  	 including any machine code, or machine code pcs in context objects."
  	| activeContext methodObj hasCogMethod theFrame thePage |
  	<var: #theFrame type: #'char *'>
  	<var: #thePage type: #'StackPage *'>
  	super primitiveFlushCacheByMethod.
  	"One might think (as this author did) that the heap scan is unnecessary if the method does not
  	 have a cog method.  But it could be the case that the code zone has recently been reclaimed
  	 and so not having a cog method is no indication that it didn't have a cog method some time in
  	 the recent past, and that there are indeed still contexts with machine code pcs out there.  The
  	 only steps that can be avoided is divorcing frames in the stack zone, and scanning to unlink and
  	 free if there isn't a cog method."
  	methodObj := self stackTop.
+ 	activeContext := self ensureFrameIsMarried: framePointer SP: stackPointer.
+ 	self ensurePushedInstructionPointer.
- 	self push: instructionPointer.
  	self externalWriteBackHeadFramePointers.
- 	activeContext := self ensureFrameIsMarried: framePointer SP: stackPointer - objectMemory wordSize.
  	(hasCogMethod := self methodHasCogMethod: methodObj) ifTrue:
  		[self divorceMachineCodeFramesWithMethod: methodObj].
  	self ensureAllContextsWithMethodHaveBytecodePCs: methodObj.
  	hasCogMethod ifTrue:
  		[cogit unlinkSendsTo: methodObj andFreeIf: true].
  	(self isStillMarriedContext: activeContext)
  		ifTrue:
  			[theFrame := self frameOfMarriedContext: activeContext.
  			 thePage := stackPages stackPageFor: theFrame.
  			 self assert: thePage headFP = theFrame.
  			 self setStackPageAndLimit: thePage.
  			 stackPointer := thePage headSP.
  			 framePointer := thePage headFP.
  			 instructionPointer := self popStack.
  			 self assert: methodObj = self stackTop]
  		ifFalse:
  			[self zeroStackPage. "to avoid assert in marryContextInNewStackPageAndInitializeInterpreterRegisters:"
  			 self marryContextInNewStackPageAndInitializeInterpreterRegisters: activeContext.
  			 self popStack. "pop bogus machine-code instructionPointer"
  			 self assert: methodObj = self stackTop.
  			 self siglong: reenterInterpreter jmp: ReturnToInterpreter]!



More information about the Vm-dev mailing list