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

commits at source.squeak.org commits at source.squeak.org
Sat Feb 1 00:28:30 UTC 2014


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

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

Name: VMMaker.oscog-eem.599
Author: eem
Time: 31 January 2014, 4:25:23.549 pm
UUID: 3f317156-92ed-49c4-a5bd-81491c3489a2
Ancestors: VMMaker.oscog-eem.598

Remember to follow the specialObjectsOop during scavenges.

Fix a typo in a selector.

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

Item was added:
+ ----- Method: CogObjectRepresentation>>genEnsureObjInRegNotForwarded:scratchReg: (in category 'compile abstract instructions') -----
+ genEnsureObjInRegNotForwarded: reg scratchReg: scratch
+ 	"Make sure that the object in reg is not forwarded.  By default there is
+ 	 nothing to do.  Subclasses for memory managers that forward will override."
+ 	^0!

Item was removed:
- ----- Method: CogObjectRepresentation>>genEnsureObjInRegRegNotForwarded:scratchReg: (in category 'compile abstract instructions') -----
- genEnsureObjInRegRegNotForwarded: reg scratchReg: scratch
- 	"Make sure that the object in reg is not forwarded.  By default there is
- 	 nothing to do.  Subclasses for memory managers that forward will override."
- 	^0!

Item was added:
+ ----- Method: CogObjectRepresentationForSpur>>genEnsureObjInRegNotForwarded:scratchReg: (in category 'compile abstract instructions') -----
+ genEnsureObjInRegNotForwarded: reg scratchReg: scratch
+ 	"Make sure that the object in reg is not forwarded."
+ 	| loop ok |
+ 	<var: #ok type: #'AbstractInstruction *'>
+ 	<var: #loop type: #'AbstractInstruction *'>
+ 	self assert: reg ~= scratch.
+ 	loop := cogit Label.
+ 	self genGetClassIndexOfNonImm: reg into: scratch.
+ 	cogit CmpCq: objectMemory isForwardedObjectClassIndexPun
+ 		R: TempReg.
+ 	ok := cogit JumpNonZero:  0.
+ 	self genLoadSlot: 0 sourceReg: reg destReg: reg.
+ 	cogit Jump: loop.
+ 	ok jmpTarget: cogit Label.
+ 	^0!

Item was removed:
- ----- Method: CogObjectRepresentationForSpur>>genEnsureObjInRegRegNotForwarded:scratchReg: (in category 'compile abstract instructions') -----
- genEnsureObjInRegRegNotForwarded: reg scratchReg: scratch
- 	"Make sure that the obejct in reg is not forwarded."
- 	| loop ok |
- 	<var: #ok type: #'AbstractInstruction *'>
- 	<var: #loop type: #'AbstractInstruction *'>
- 	self assert: reg ~= scratch.
- 	loop := cogit Label.
- 	self genGetClassIndexOfNonImm: reg into: scratch.
- 	cogit CmpCq: objectMemory isForwardedObjectClassIndexPun
- 		R: TempReg.
- 	ok := cogit JumpNonZero:  0.
- 	self genLoadSlot: 0 sourceReg: reg destReg: reg.
- 	cogit Jump: loop.
- 	ok jmpTarget: cogit Label.
- 	^0!

Item was changed:
  ----- Method: CogObjectRepresentationForSpur>>genInnerPrimitiveIdentical:orNotIf: (in category 'primitive generators') -----
  genInnerPrimitiveIdentical: retNoffset orNotIf: orNot
  	| jumpImmediate jumpCmp |
  	<var: #jumpCmp type: #'AbstractInstruction *'>
  	<var: #jumpImmediate type: #'AbstractInstruction *'>
  	cogit MoveR: Arg0Reg R: TempReg.
  	jumpImmediate := self genJumpImmediateInScratchReg: TempReg.
+ 	self genEnsureObjInRegNotForwarded: Arg0Reg scratchReg: TempReg.
- 	self genEnsureObjInRegRegNotForwarded: Arg0Reg scratchReg: TempReg.
  	jumpImmediate jmpTarget:
  		(cogit CmpR: Arg0Reg R: ReceiverResultReg).
  	jumpCmp := orNot
  					ifTrue: [cogit JumpZero: 0]
  					ifFalse: [cogit JumpNonZero: 0].
  	cogit annotate: (cogit MoveCw: objectMemory trueObject R: ReceiverResultReg)
  		objRef: objectMemory trueObject.
  	cogit RetN: retNoffset.
  	jumpCmp jmpTarget: (cogit annotate: (cogit MoveCw: objectMemory falseObject R: ReceiverResultReg)
  								objRef: objectMemory falseObject).
  	cogit RetN: retNoffset.
  	^0!

Item was changed:
  ----- Method: SimpleStackBasedCogit>>genPushLiteralVariable: (in category 'bytecode generators') -----
  genPushLiteralVariable: literalIndex
  	<inline: false>
  	| association |
  	association := self getLiteral: literalIndex.
  	"N.B. Do _not_ use ReceiverResultReg to avoid overwriting receiver in assignment in frameless methods."
  	self annotate: (self MoveCw: association R: ClassReg) objRef: association.
  	objectRepresentation
+ 		genEnsureObjInRegNotForwarded: ClassReg
- 		genEnsureObjInRegRegNotForwarded: ClassReg
  		scratchReg: TempReg.
  	objectRepresentation
  		genLoadSlot: ValueIndex
  		sourceReg: ClassReg
  		destReg: TempReg.
  	self PushR: TempReg.
  	^0!

Item was changed:
  ----- Method: SimpleStackBasedCogit>>genSpecialSelectorEqualsEquals (in category 'bytecode generators') -----
  genSpecialSelectorEqualsEquals
  	| jumpNotEqual jumpPush |
  	<var: #jumpNotEqual type: #'AbstractInstruction *'>
  	<var: #jumpPush type: #'AbstractInstruction *'>
  	self PopR: Arg0Reg.
  	objectRepresentation
+ 		genEnsureObjInRegNotForwarded: Arg0Reg
- 		genEnsureObjInRegRegNotForwarded: Arg0Reg
  		scratchReg: TempReg.
  	self MoveMw: 0 r: SPReg R: ClassReg.
  	objectRepresentation
+ 		genEnsureObjInRegNotForwarded: ClassReg
- 		genEnsureObjInRegRegNotForwarded: ClassReg
  		scratchReg: TempReg.
  	self CmpR: Arg0Reg R: ClassReg.
  	jumpNotEqual := self JumpNonZero: 0.
  	self annotate: (self MoveCw: objectMemory trueObject R: Arg0Reg)
  		objRef: objectMemory trueObject.
  	jumpPush := self Jump: 0.
  	jumpNotEqual jmpTarget: (self annotate: (self MoveCw: objectMemory falseObject R: Arg0Reg)
  							objRef: objectMemory falseObject).
  	jumpPush jmpTarget: (self MoveR: Arg0Reg Mw: 0 r: SPReg).
  	^0!

Item was changed:
  ----- Method: SimpleStackBasedCogit>>genStorePop:LiteralVariable: (in category 'bytecode generators') -----
  genStorePop: popBoolean LiteralVariable: litVarIndex
  	<inline: false>
  	| association |
  	self assert: needsFrame.
  	association := self getLiteral: litVarIndex.
  	self annotate: (self MoveCw: association R: ReceiverResultReg) objRef: association.
  	objectRepresentation
+ 		genEnsureObjInRegNotForwarded: ReceiverResultReg
- 		genEnsureObjInRegRegNotForwarded: ReceiverResultReg
  		scratchReg: TempReg.
  	popBoolean
  		ifTrue: [self PopR: ClassReg]
  		ifFalse: [self MoveMw: 0 r: SPReg R: ClassReg].
  	traceStores > 0 ifTrue:
  		[self CallRT: ceTraceStoreTrampoline].
  	^objectRepresentation
  		genStoreSourceReg: ClassReg
  		slotIndex: ValueIndex
  		destReg: ReceiverResultReg
  		scratchReg: TempReg!

Item was changed:
  ----- Method: SpurMemoryManager>>mapExtraRoots (in category 'gc - global') -----
  mapExtraRoots
+ 	(self shouldRemapObj: specialObjectsOop) ifTrue:
+ 		[specialObjectsOop := self remapObj: specialObjectsOop].
  	self assert: remapBufferCount = 0.
  	"1 to: remapBufferCount do:
  		[:i | | oop |
  		oop := remapBufferCount at: i.
  		((self isImmediate: oop) or: [self isFreeObject: oop]) ifFalse:
  			[(self shouldRemapObj: oop) ifTrue:
  				[remapBuffer at: i put: (self remapObj: oop)]]]."
  	1 to: extraRootCount do:
  		[:i | | oop |
  		oop := (extraRoots at: i) at: 0.
  		((self isImmediate: oop) or: [self isFreeObject: oop]) ifFalse:
  			[(self shouldRemapObj: oop) ifTrue:
  				[(extraRoots at: i) at: 0 put: (self remapObj: oop)]]]!

Item was changed:
  ----- Method: StackToRegisterMappingCogit>>genPushLiteralVariable: (in category 'bytecode generators') -----
  genPushLiteralVariable: literalIndex
  	<inline: false>
  	| association freeReg |
  	freeReg := self ssAllocatePreferredReg: ClassReg.
  	association := self getLiteral: literalIndex.
  	"N.B. Do _not_ use ReceiverResultReg to avoid overwriting receiver in assignment in frameless methods."
  	"So far descriptors are not rich enough to describe the entire dereference so generate the register
  	 load but don't push the result.  There is an order-of-evaluation issue if we defer the dereference."
  	self annotate: (self MoveCw: association R: TempReg) objRef: association.
  	objectRepresentation
+ 		genEnsureObjInRegNotForwarded: TempReg
- 		genEnsureObjInRegRegNotForwarded: TempReg
  		scratchReg: freeReg.
  	objectRepresentation
  		genLoadSlot: ValueIndex
  		sourceReg: TempReg
  		destReg: freeReg.
  	self ssPushRegister: freeReg.
  	^0!

Item was changed:
  ----- Method: StackToRegisterMappingCogit>>genStorePop:LiteralVariable: (in category 'bytecode generators') -----
  genStorePop: popBoolean LiteralVariable: litVarIndex
  	<inline: false>
  	| topReg valueReg association constVal |
  	self flag: 'with better register allocation this wouldn''t need a frame.  e.g. use SendNumArgs instead of ReceiverResultReg'.
  	self assert: needsFrame.
  	optStatus isReceiverResultRegLive: false.
  	"N.B.  No need to check the stack for references because we generate code for
  	 literal variable loads that stores the result in a register, deferring only the register push."
  	association := self getLiteral: litVarIndex.
  	constVal := self ssTop maybeConstant.
  	"Avoid store check for immediate values"
  	(self ssTop type = SSConstant
  	 and: [(objectRepresentation shouldAnnotateObjectReference: constVal) not]) ifTrue:
  		[self ssAllocateRequiredReg: ReceiverResultReg.
  		 self annotate: (self MoveCw: association R: ReceiverResultReg) objRef: association.
  		 objectRepresentation
+ 			genEnsureObjInRegNotForwarded: ReceiverResultReg
- 			genEnsureObjInRegRegNotForwarded: ReceiverResultReg
  			scratchReg: TempReg.
  		 self ssStorePop: popBoolean toPreferredReg: TempReg.
  		 traceStores > 0 ifTrue:
  			[self CallRT: ceTraceStoreTrampoline].
  		 ^objectRepresentation
  			genStoreImmediateInSourceReg: TempReg
  			slotIndex: ValueIndex
  			destReg: ReceiverResultReg].
  	((topReg := self ssTop registerOrNil) isNil
  	 or: [topReg = ReceiverResultReg]) ifTrue:
  		[topReg := ClassReg].
  	self ssPop: 1.
  	self ssAllocateCallReg: topReg. "for the ceStoreCheck call in genStoreSourceReg:... below"
  	self ssPush: 1.
  	valueReg := self ssStorePop: popBoolean toPreferredReg: topReg.
  	valueReg = ReceiverResultReg ifTrue:
  		[self MoveR: valueReg R: topReg].
  	self ssAllocateCallReg: ReceiverResultReg.
  	self annotate: (self MoveCw: association R: ReceiverResultReg) objRef: association.
+ 	objectRepresentation genEnsureObjInRegNotForwarded: ReceiverResultReg scratchReg: TempReg.
- 	objectRepresentation genEnsureObjInRegRegNotForwarded: ReceiverResultReg scratchReg: TempReg.
  	traceStores > 0 ifTrue:
  		[self MoveR: topReg R: TempReg.
  		 self CallRT: ceTraceStoreTrampoline].
  	^objectRepresentation
  		genStoreSourceReg: topReg
  		slotIndex: ValueIndex
  		destReg: ReceiverResultReg
  		scratchReg: TempReg!



More information about the Vm-dev mailing list