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

commits at source.squeak.org commits at source.squeak.org
Wed Jul 17 19:29:40 UTC 2013


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

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

Name: VMMaker.oscog-eem.304
Author: eem
Time: 17 July 2013, 12:25:05.226 pm
UUID: 79d06b10-06eb-49bc-a33a-a36bd68ab3c2
Ancestors: VMMaker.oscog-eem.303

Make deferStackLimitSmashAround:[with:] answer true so it can be
invoked in an assert and hence be optimized out in a non-assert VM,
hence optimizing away assertValidExecutionPointe:r:s:imbar:line:.

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

Item was changed:
  ----- Method: CoInterpreter>>assertValidExecutionPointe:r:s:imbar:line: (in category 'debug support') -----
  assertValidExecutionPointe: lip r: lifp s: lisp imbar: inInterpreter line: ln
  	<var: #lip type: #usqInt>
  	<var: #lifp type: #'char *'>
  	<var: #lisp type: #'char *'>
  	| methodField cogMethod |
  	<var: #cogMethod type: #'CogMethod *'>
  	self assert: stackPage = (stackPages stackPageFor: lifp) l: ln.
  	self assert: stackPage = stackPages mostRecentlyUsedPage l: ln.
+ 	self assert: (self deferStackLimitSmashAround: #assertValidStackLimits: asSymbol with: ln).
- 	self deferStackLimitSmashAround: #assertValidStackLimits: asSymbol with: ln.
  	self assert: lifp < stackPage baseAddress l: ln.
  	self assert: lisp < lifp l: ln.
  	self assert: lifp > lisp l: ln.
  	self assert: lisp >= (stackPage realStackLimit - self stackLimitOffset) l: ln.
  	self assert:  (lifp - lisp) < LargeContextSize l: ln.
  	methodField := self frameMethodField: lifp.
  	inInterpreter
  		ifTrue:
  			[self assert: (self isMachineCodeFrame: lifp) not l: ln.
  			 self assert: method = methodField l: ln.
  			 self cppIf: MULTIPLEBYTECODESETS
  				ifTrue: [self assert: (self methodUsesAlternateBytecodeSet: method) = (bytecodeSetSelector = 256) l: ln].
  			 ((self asserta: methodField asUnsignedInteger > objectMemory startOfMemory l: ln)
  			   and: [self asserta: methodField asUnsignedInteger < objectMemory freeStart l: ln]) ifTrue:
  				[lip ~= cogit ceReturnToInterpreterPC ifTrue:
  					[self assert: (lip >= (methodField + (objectMemory lastPointerOf: methodField) + BaseHeaderSize - 1)
  								  and: [lip < (methodField + (objectMemory byteLengthOf: methodField) + BaseHeaderSize)])
  						l: ln]].
  			 self assert: ((self iframeIsBlockActivation: lifp)
  					or: [(self pushedReceiverOrClosureOfFrame: lifp) = (self iframeReceiver: lifp)])
  				l: ln]
  		ifFalse:
  			[self assert: (self isMachineCodeFrame: lifp) l: ln.
  			 ((self asserta: methodField asUnsignedInteger >= cogit minCogMethodAddress l: ln)
  			  and: [self asserta: methodField asUnsignedInteger < cogit maxCogMethodAddress l: ln]) ifTrue:
  				[cogMethod := self mframeHomeMethod: lifp.
  				 self assert: (lip > (methodField + ((self mframeIsBlockActivation: lifp)
  													ifTrue: [self sizeof: CogBlockMethod]
  													ifFalse: [self sizeof: CogMethod]))
  						and: [lip < (methodField + cogMethod blockSize)])
  					l: ln].
  			 self assert: ((self mframeIsBlockActivation: lifp)
  					or: [(self pushedReceiverOrClosureOfFrame: lifp) = (self mframeReceiver: lifp)])
  				l: ln].
  	(self isBaseFrame: lifp) ifTrue:
  		[self assert: (self frameHasContext: lifp) l: ln.
  		 self assert: (self frameContext: lifp) = (stackPages longAt: stackPage baseAddress - BytesPerWord) l: ln]!

Item was changed:
  ----- Method: CoInterpreter>>deferStackLimitSmashAround: (in category 'process primitive support') -----
  deferStackLimitSmashAround: functionSymbol
  	"Defer smashes of the stackLimit around the call of functionSymbol (for assert checks)"
  	<var: #functionSymbol declareC: 'void (*functionSymbol)(void)'>
  	deferSmash := true.
  	self perform: functionSymbol.
  	deferSmash := false.
  	deferredSmash ifTrue:
  		[deferredSmash := false.
+ 		 self forceInterruptCheck].
+ 	^true "called from assert"!
- 		 self forceInterruptCheck]!

Item was changed:
  ----- Method: CoInterpreter>>deferStackLimitSmashAround:with: (in category 'process primitive support') -----
  deferStackLimitSmashAround: functionSymbol with: arg
  	"Defer smashes of the stackLimit around the call of functionSymbol (for assert checks)"
  	<var: #functionSymbol declareC: 'void (*functionSymbol)(sqInt)'>
  	deferSmash := true.
  	self sqLowLevelMFence.
  	self perform: functionSymbol with: arg.
  	deferSmash := false.
  	self sqLowLevelMFence.
  	deferredSmash ifTrue:
  		[deferredSmash := false.
  		 self sqLowLevelMFence.
+ 		 self forceInterruptCheck].
+ 	^true "called from assert"!
- 		 self forceInterruptCheck]!

Item was changed:
  ----- Method: CoInterpreterMT>>deferStackLimitSmashAround: (in category 'process primitive support') -----
  deferStackLimitSmashAround: functionSymbol
  	"Defer smashes of the stackLimit around the call of functionSymbol (for assert checks).	
  
  	 N.B. SYNCHRONIZE WITH forceInterruptCheckFromHeartbeat"
  
  	<var: #functionSymbol declareC: 'void (*functionSymbol)(void)'>
  	deferSmash := true.
  	self perform: functionSymbol.
  	deferSmash := false.
  	deferredSmash ifTrue:
  		[deferredSmash := false.
  		 self forceInterruptCheck.
+ 		 self checkVMOwnershipFromHeartbeat].
+ 	^true "called from assert"!
- 		 self checkVMOwnershipFromHeartbeat]!

Item was changed:
  ----- Method: CoInterpreterMT>>deferStackLimitSmashAround:with: (in category 'process primitive support') -----
  deferStackLimitSmashAround: functionSymbol with: arg
  	"Defer smashes of the stackLimit around the call of functionSymbol (for assert checks).	
  
  	 N.B. SYNCHRONIZE WITH forceInterruptCheckFromHeartbeat"
  
  	<var: #functionSymbol declareC: 'void (*functionSymbol)(sqInt)'>
  	deferSmash := true.
  	self sqLowLevelMFence.
  	self perform: functionSymbol with: arg.
  	deferSmash := false.
  	self sqLowLevelMFence.
  	deferredSmash ifTrue:
  		[deferredSmash := false.
  		 self sqLowLevelMFence.
  		 self forceInterruptCheck.
+ 		 self checkVMOwnershipFromHeartbeat].
+ 	^true "called from assert"!
- 		 self checkVMOwnershipFromHeartbeat]!



More information about the Vm-dev mailing list