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

commits at source.squeak.org commits at source.squeak.org
Fri Nov 18 17:39:49 UTC 2011


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

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

Name: VMMaker.oscog-eem.139
Author: eem
Time: 18 November 2011, 9:38:13.812 am
UUID: c2849383-9768-4948-b9b2-a5c22d482b07
Ancestors: VMMaker.oscog-eem.138

Replace bogus fix for frameless foo: arg instVar := instVar code gen
bug (apparent failure to pop spills on frameless return), with correct
fix, which is not to flush the top of stack when pop/storing receiver
and/or temp vars.  i.e. ssFlushUpThroughReceiverVariable: &
ssFlushUpThroughTemporaryVariable: skip the entry at simStackPtr.

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

Item was changed:
  ----- Method: StackToRegisterMappingCogit>>genUpArrowReturn (in category 'bytecode generators') -----
  genUpArrowReturn
  	"Generate a method return from within a method or a block.
  	 Frameless method activation looks like
  				receiver
  				args
  		sp->	ret pc.
  	 Return pops receiver and arguments off the stack.  Callee pushes the result."
  	inBlock ifTrue:
  		[self assert: needsFrame.
  		 self annotateBytecode: (self CallRT: ceNonLocalReturnTrampoline).
  		 ^0].
  	needsFrame
  		ifTrue:
  			[self MoveR: FPReg R: SPReg.
  			 self PopR: FPReg.
  			 self RetN: methodOrBlockNumArgs + 1 * BytesPerWord]
  		ifFalse:
+ 			[self RetN: ((methodOrBlockNumArgs > self numRegArgs
- 			[self ssPopSpillsFrom: methodOrBlockNumArgs - 1.
- 			 self RetN: ((methodOrBlockNumArgs > self numRegArgs
  						"A method with an interpreter prim will push its register args for the prim.  If the failure
  						 body is frameless the args must still be popped, see e.g. Behavior>>nextInstance."
  						or: [regArgsHaveBeenPushed])
  							ifTrue: [methodOrBlockNumArgs + 1 * BytesPerWord]
  							ifFalse: [0])].
  	^0!

Item was changed:
  ----- Method: StackToRegisterMappingCogit>>ssFlushTo: (in category 'simulation stack') -----
  ssFlushTo: index
  	methodOrBlockNumTemps to: simSpillBase - 1 do:
  		[:i| self assert: (self simStackAt: i) spilled].
  	simSpillBase <= index ifTrue:
  		[(simSpillBase max: 0) to: index do:
  			[:i|
+ 			self assert: needsFrame.
- 			self assert: (needsFrame
- 						or: [((self simStackAt: i) type = SSBaseOffset
- 							or: [(self simStackAt: i) type = SSRegister])
- 							and: [self isValidFramelessRegister: (self simStackAt: i) register]]).
  			(self simStackAt: i)
  				ensureSpilledAt: (self frameOffsetOfTemporary: i)
  				from: FPReg].
  		 simSpillBase := index + 1]!

Item was changed:
  ----- Method: StackToRegisterMappingCogit>>ssFlushUpThroughReceiverVariable: (in category 'simulation stack') -----
  ssFlushUpThroughReceiverVariable: slotIndex
+ 	"Any occurrences on the stack of the value being stored (which is the top of stack)
+ 	 must be flushed, and hence any values colder than them stack."
- 	"Any occurrences on the stack of the value being stored must
- 	 be flushed, and hence any values colder than them stack."
  	<var: #desc type: #'CogSimStackEntry *'>
+ 	simStackPtr - 1 to: (simSpillBase max: 0) by: -1 do:
- 	simStackPtr to: (simSpillBase max: 0) by: -1 do:
  		[:index| | desc |
  		desc := self simStackAt: index.
  		(desc type = SSBaseOffset
  		 and: [desc register = ReceiverResultReg
  		 and: [desc offset = (objectRepresentation slotOffsetOfInstVarIndex: slotIndex)]]) ifTrue:
  			[self ssFlushTo: index.
  			 ^self]]!

Item was changed:
  ----- Method: StackToRegisterMappingCogit>>ssFlushUpThroughTemporaryVariable: (in category 'simulation stack') -----
  ssFlushUpThroughTemporaryVariable: tempIndex
+ 	"Any occurrences on the stack of the value being stored (which is the top of stack)
+ 	 must be flushed, and hence any values colder than them stack."
- 	"Any occurrences on the stack of the value being stored must
- 	 be flushed, and hence any values colder than them stack."
  	<var: #desc type: #'CogSimStackEntry *'>
+ 	simStackPtr - 1 to: simSpillBase by: -1 do:
- 	simStackPtr to: simSpillBase by: -1 do:
  		[:index| | desc |
  		desc := self simStackAt: index.
  		(desc type = SSBaseOffset
  		 and: [desc register = FPReg
  		 and: [desc offset = (self frameOffsetOfTemporary: tempIndex)]]) ifTrue:
  			[self ssFlushTo: index.
  			 ^self]]!

Item was removed:
- ----- Method: StackToRegisterMappingCogit>>ssPopSpillsFrom: (in category 'simulation stack') -----
- ssPopSpillsFrom: index
- 	"Pop any spilled items on the sim stack from index, used to balance the stack on return."
- 	index to: simStackPtr do:
- 		[:i|
- 		(self simStackAt: i) spilled ifTrue:
- 			[self ssTop popToReg: TempReg]]!



More information about the Vm-dev mailing list