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

commits at source.squeak.org commits at source.squeak.org
Mon May 18 20:21:00 UTC 2015


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

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

Name: VMMaker.oscog-eem.1314
Author: eem
Time: 18 May 2015, 1:18:51.827 pm
UUID: a1091890-158e-4f00-bb49-c1b2bd6f8a5b
Ancestors: VMMaker.oscog-eem.1313

Fix regression in read-before-written code when
rewriting to only initialize simple types.

Fix ARM-only regression in StackToRegisterMappingCogit's
PIC aborts when the SimpleStackBasedCogit was fixed.

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

Item was changed:
  ----- Method: Cogit>>genInnerPICAbortTrampoline: (in category 'initialization') -----
  genInnerPICAbortTrampoline: name
  	"Generate the abort for a PIC.  This abort performs either a call of
  	 ceInterpretMethodFromPIC:receiver: to handle invoking an uncogged target
  	 or a call of ceMNUFromPICMNUMethod:receiver: to handle an MNU dispatch
  	 in a closed PIC.  It distinguishes the two by testing ClassReg.  If the register
  	 is zero then this is an MNU.
  	
  	 This poses a problem in 32-bit Spur, where zero is the cache tag for immediate
  	 characters (tag pattern 2r10) because SmallIntegers have tag patterns 2r11
  	 and 2r01, so anding with 1 reduces these to 0 & 1.  We solve the ambiguity by
  	 patching send sites with a 0 cache tag to open PICs instead of closed PICs."
  	<var: #name type: #'char *'>
  	| jumpMNUCase |
  	<var: #jumpMNUCase type: #'AbstractInstruction *'>
  	self CmpCq: self picAbortDiscriminatorValue R: ClassReg.
  	jumpMNUCase := self JumpZero: 0.
  	self compileTrampolineFor: #ceInterpretMethodFromPIC:receiver:
  		numArgs: 2
  		arg: SendNumArgsReg
  		arg: ReceiverResultReg
  		arg: nil
  		arg: nil
  		saveRegs: false
+ 		pushLinkReg: false
- 		pushLinkReg: true
  		resultReg: nil.
  	jumpMNUCase jmpTarget: self Label.
  	^self genTrampolineFor: #ceMNUFromPICMNUMethod:receiver:
  		called: name
  		numArgs: 2
  		arg: SendNumArgsReg
  		arg: ReceiverResultReg
  		arg: nil
  		arg: nil
  		saveRegs: false
+ 		pushLinkReg: false
- 		pushLinkReg: true
  		resultReg: nil
  		appendOpcodes: true!

Item was changed:
  ----- Method: Cogit>>genPICAbortTrampoline (in category 'initialization') -----
  genPICAbortTrampoline
  	"Generate the abort for a PIC.  This abort performs either a call of
  	 ceInterpretMethodFromPIC:receiver: to handle invoking an uncogged
  	 target or a call of ceMNUFromPICMNUMethod:receiver: to handle an
  	 MNU dispatch in a closed PIC.  It distinguishes the two by testing
  	 ClassReg.  If the register is zero then this is an MNU."
  	opcodeIndex := 0.
+ 	backEnd hasLinkRegister ifTrue:
+ 		[self PushR: LinkReg].
  	^self genInnerPICAbortTrampoline: 'cePICAbort'!

Item was changed:
  ----- Method: TMethod>>removeUnusedTempsAndNilIfRequiredIn: (in category 'utilities') -----
  removeUnusedTempsAndNilIfRequiredIn: aCodeGen
  	"Remove all of the unused temps in this method. Answer a set of the references.
  	 As a side-effect introduce explicit temp := nil statements for temps that are
  	 tested for nil before necessarily being assigned."
  	| refs readBeforeAssigned simplyTypedLocals |
  	refs := self removeUnusedTempsIn: aCodeGen.
  	"reset the locals to be only those still referred to"
  	locals := locals select: [:e| refs includes: e].
  	(locals notEmpty
  	 and: [aCodeGen
  			pushScope: declarations
  			while: [simplyTypedLocals := locals select:
+ 											[:var|
+ 											 declarations
+ 												at: var
+ 												ifPresent: [:decl| aCodeGen isSimpleType: (aCodeGen extractTypeFor: var fromDeclaration: decl)]
+ 												ifAbsent: [true]].
- 											[:ea|
- 											(self typeFor: ea in: aCodeGen)
- 												ifNil: [false]
- 												ifNotNil: [:type| aCodeGen isSimpleType: type]].
  				(readBeforeAssigned := (self findReadBeforeAssignedIn: simplyTypedLocals in: aCodeGen)) notEmpty]]) ifTrue:
  		[readBeforeAssigned := readBeforeAssigned reject:
  			[:v| | d | "don't initialize externs, arrays or the explicitly initialized."
  			 d := self declarationAt: v.
  			 (d beginsWith: 'extern') or: [(d includes: $[) or: [d includes: $=]]].
  		 parseTree statements addAllFirst:
  			(readBeforeAssigned asSortedCollection collect:
  				[:var|
  				TAssignmentNode new
  					setVariable: (TVariableNode new setName: var; yourself)
  					expression: (TConstantNode new setValue: 0; yourself)])].
  	^refs!



More information about the Vm-dev mailing list