[Vm-dev] VM Maker: VMMaker.oscog-cb.1918.mcz

commits at source.squeak.org commits at source.squeak.org
Wed Aug 17 13:27:21 UTC 2016


ClementBera uploaded a new version of VMMaker to project VM Maker:
http://source.squeak.org/VMMaker/VMMaker.oscog-cb.1918.mcz

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

Name: VMMaker.oscog-cb.1918
Author: cb
Time: 17 August 2016, 3:26:11.629947 pm
UUID: d3b3d964-2664-4ebb-b2e7-0a21cb23ddfe
Ancestors: VMMaker.oscog-eem.1917

fixed a store check minor detail in sista vMs

fixed branches from C runtime to cppIf

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

Item was removed:
- ----- Method: StackToRegisterMappingCogit>>extBSpecifiesNoImmCheck (in category 'testing') -----
- extBSpecifiesNoImmCheck 
- 	<inline: true>
- 	^ extB anyMask: 4!

Item was removed:
- ----- Method: StackToRegisterMappingCogit>>extBSpecifiesNoStoreCheck (in category 'testing') -----
- extBSpecifiesNoStoreCheck 
- 	<inline: true>
- 	^ extB anyMask: 1!

Item was added:
+ ----- Method: StackToRegisterMappingCogit>>extBSpecifiesStoreCheck (in category 'testing') -----
+ extBSpecifiesStoreCheck 
+ 	"This is a negative check"
+ 	<inline: true>
+ 	^ extB noMask: 1!

Item was changed:
  ----- Method: StackToRegisterMappingCogit>>genGenericStorePop:MaybeContextSlotIndex:needsStoreCheck:needsRestoreRcvr:needsImmutabilityCheck: (in category 'bytecode generator stores') -----
  genGenericStorePop: popBoolean MaybeContextSlotIndex: slotIndex needsStoreCheck: needsStoreCheck needsRestoreRcvr: needsRestoreReceiver needsImmutabilityCheck: needsImmCheck
  	"Generates a store into an object that *may* be a context.
  	Multiple settings:
  	- needsStoreCheck (young into old object check)
  	- needRestoreRcvr (ensures the recevier is live across the store)
  	- needsImmCheck (do the call-back if the receiver is immutable)"
  	<inline: true>
  	| jmpSingle jmpDone |
  	<var: #jmpSingle type: #'AbstractInstruction *'>
  	<var: #jmpDone type: #'AbstractInstruction *'>
  	"The reason we need a frame here is that assigning to an inst var of a context may
  	 involve wholesale reorganization of stack pages, and the only way to preserve the
  	 execution state of an activation in that case is if it has a frame."
  	"Context stores do not require Imm checks as contexts can't be immutable"
  	self assert: needsFrame.
  	self ssPop: 1.
  	self ssAllocateCallReg: ClassReg and: SendNumArgsReg. "for ceStoreContextInstVarTrampoline"
  	self ssPush: 1.
  	objectRepresentation
  		genLoadSlot: SenderIndex
  		sourceReg: ReceiverResultReg
  		destReg: TempReg.
  	self ssStoreAndReplacePop: popBoolean toReg: ClassReg.
  	jmpSingle := objectRepresentation genJumpNotSmallIntegerInScratchReg: TempReg.
  	self MoveCq: slotIndex R: SendNumArgsReg.
  	self CallRT: ceStoreContextInstVarTrampoline.
  	jmpDone := self Jump: 0.
  	jmpSingle jmpTarget: self Label.
+ 	self 
+ 		cppIf: IMMUTABILITY
+ 		ifTrue:
+ 			[needsImmCheck
+ 				ifTrue: 
+ 					[objectRepresentation 
+ 						genStoreWithImmutabilityCheckSourceReg: ClassReg 
+ 						slotIndex: slotIndex 
+ 						destReg: ReceiverResultReg 
+ 						scratchReg: TempReg 
+ 						needsStoreCheck: needsStoreCheck 
+ 						needRestoreRcvr: needsRestoreReceiver.
+ 					jmpDone jmpTarget: self Label.
+ 					^0]].
+ 	objectRepresentation
+ 			genStoreSourceReg: ClassReg
+ 			slotIndex: slotIndex
+ 			destReg: ReceiverResultReg
+ 			scratchReg: TempReg
+ 			inFrame: true
+ 			needsStoreCheck: needsStoreCheck.
- 	(IMMUTABILITY and: [needsImmCheck])
- 		ifTrue: 
- 			[objectRepresentation 
- 				genStoreWithImmutabilityCheckSourceReg: ClassReg 
- 				slotIndex: slotIndex 
- 				destReg: ReceiverResultReg 
- 				scratchReg: TempReg 
- 				needsStoreCheck: needsStoreCheck 
- 				needRestoreRcvr: needsRestoreReceiver]
- 		ifFalse:
- 			[objectRepresentation
- 				genStoreSourceReg: ClassReg
- 				slotIndex: slotIndex
- 				destReg: ReceiverResultReg
- 				scratchReg: TempReg
- 				inFrame: true
- 				needsStoreCheck: needsStoreCheck].
  	jmpDone jmpTarget: self Label.
  	^0!

Item was changed:
  ----- Method: StackToRegisterMappingCogit>>genGenericStorePop:slotIndex:destReg:needsStoreCheck:needsRestoreRcvr:needsImmutabilityCheck: (in category 'bytecode generator stores') -----
  genGenericStorePop: popBoolean slotIndex: slotIndex destReg: destReg needsStoreCheck: needsStoreCheck needsRestoreRcvr: needsRestoreReceiver needsImmutabilityCheck: needsImmCheck
  	"Generates a store into an object that *cannot* be a context.
  	 This code is common between multiple stores (litVar, instVar, remoteInstVar, RemoteTemp)
  	 Multiple settings:
  	- needsStoreCheck (young into old object check)
  	- needRestoreRcvr (ensures the receiver is live across the store)
  	- needsImmCheck (do the call-back if the receiver is immutable)"
  	<inline: true>
  	"We have two very different paths as only the immutability path requires a specific register 
  	for the value on top of stack as well as the stack flush"
+ 	| topReg |
+ 	self 
+ 		cppIf: IMMUTABILITY
+ 		ifTrue:
+ 			[needsImmCheck
+ 				ifTrue: 
+ 					[self ssAllocateRequiredReg: ClassReg.
+ 					 "we replace the top value for the flush"
+ 					 self ssStoreAndReplacePop: popBoolean toReg: ClassReg.
+ 					 self ssFlushTo: simStackPtr.
+ 					 ^objectRepresentation 
+ 						genStoreWithImmutabilityCheckSourceReg: ClassReg 
+ 						slotIndex: slotIndex 
+ 						destReg: destReg 
+ 						scratchReg: TempReg 
+ 						needsStoreCheck: needsStoreCheck 
+ 						needRestoreRcvr: needsRestoreReceiver]].
+ 		 topReg := self 
+ 					allocateRegForStackEntryAt: 0 
+ 					notConflictingWith: (self registerMaskFor: destReg). 
+ 		 self ssStorePop: popBoolean toReg: topReg.
+ 		 ^objectRepresentation
+ 			genStoreSourceReg: topReg
+ 			slotIndex: slotIndex
+ 			destReg: destReg
+ 			scratchReg: TempReg
+ 			inFrame: needsFrame
+ 			needsStoreCheck: needsStoreCheck
- 	(IMMUTABILITY and: [needsImmCheck])
- 		ifTrue: 
- 			[self ssAllocateRequiredReg: ClassReg.
- 			 "we replace the top value for the flush"
- 			 self ssStoreAndReplacePop: popBoolean toReg: ClassReg.
- 			 self ssFlushTo: simStackPtr.
- 			 objectRepresentation 
- 				genStoreWithImmutabilityCheckSourceReg: ClassReg 
- 				slotIndex: slotIndex 
- 				destReg: destReg 
- 				scratchReg: TempReg 
- 				needsStoreCheck: needsStoreCheck 
- 				needRestoreRcvr: needsRestoreReceiver ]
- 		ifFalse:
- 			[| topReg |
- 			 topReg := self 
- 						allocateRegForStackEntryAt: 0 
- 						notConflictingWith: (self registerMaskFor: destReg). 
- 			 self ssStorePop: popBoolean toReg: topReg.
- 			 objectRepresentation
- 				genStoreSourceReg: topReg
- 				slotIndex: slotIndex
- 				destReg: destReg
- 				scratchReg: TempReg
- 				inFrame: needsFrame
- 				needsStoreCheck: needsStoreCheck].
- 	^ 0
  	!

Item was changed:
  ----- Method: StackToRegisterMappingCogit>>sistaNeedsStoreCheck (in category 'testing') -----
  sistaNeedsStoreCheck
  	<inline: true>
  	"The store check can be ignored if the value assigned doesn't need it (immediate, etc)
  	In addition, the extB low bit is marked by the optimizer if the store check is not required"
+ 	^ self ssTopNeedsStoreCheck and: [ self extBSpecifiesStoreCheck ]!
- 	^ self ssTopNeedsStoreCheck and: [ self extBSpecifiesNoStoreCheck ]!



More information about the Vm-dev mailing list