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

commits at source.squeak.org commits at source.squeak.org
Mon Sep 5 14:01:24 UTC 2016


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

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

Name: VMMaker.oscog-cb.1939
Author: cb
Time: 5 September 2016, 3:58:55.398749 pm
UUID: 219cd49b-a063-4099-90ef-596b3419bfb6
Ancestors: VMMaker.oscog-eem.1938

Now have frame building for frameless fullblock working.

It's not clear what happens for frameless block with only a copied, temp or arg.

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

Item was changed:
  ----- Method: SimpleStackBasedCogit>>compileBlockFramelessEntry: (in category 'compile abstract instructions') -----
  compileBlockFramelessEntry: blockStart
  	"Make sure ReceiverResultReg holds the receiver, loaded from the closure,
  	 which is what is initially in ReceiverResultReg.  We must annotate the first
  	 instruction in vanilla blocks so that findMethodForStartBcpc:inHomeMethod:
  	 can function. We need two annotations because the first is a fiducial."
  	<var: #blockStart type: #'BlockStart *'>
- 	self deny: blockStart hasInstVarRef. "Else we would need to unforward the receiver in Spur"
  	blockStart entryLabel ifNotNil:
  		[self annotateBytecode: blockStart entryLabel.
  		 self annotateBytecode: blockStart entryLabel].
+ 	blockStart hasInstVarRef
+ 		ifTrue: "Use ReceiverResultReg for Context to agree with store check trampoline"
+ 			[objectRepresentation
+ 				genLoadSlot: ClosureOuterContextIndex
+ 					sourceReg: ReceiverResultReg
+ 						destReg: ReceiverResultReg;
+ 				genLoadSlot: ReceiverIndex
+ 					sourceReg: ReceiverResultReg
+ 						destReg: Arg0Reg.
+ 			objectRepresentation
+ 				genEnsureOopInRegNotForwarded: Arg0Reg scratchReg: TempReg updatingSlot: ReceiverIndex in: ReceiverResultReg.
+ 			self MoveR: Arg0Reg R: ReceiverResultReg]
+ 		ifFalse:
+ 			[objectRepresentation
+ 				genLoadSlot: ClosureOuterContextIndex
+ 					sourceReg: ReceiverResultReg
+ 						destReg: TempReg;
+ 				genLoadSlot: ReceiverIndex
+ 					sourceReg: TempReg
+ 						destReg: ReceiverResultReg].!
- 	objectRepresentation
- 		genLoadSlot: ClosureOuterContextIndex
- 			sourceReg: ReceiverResultReg
- 				destReg: TempReg;
- 		genLoadSlot: ReceiverIndex
- 			sourceReg: TempReg
- 				destReg: ReceiverResultReg!

Item was added:
+ ----- Method: SimpleStackBasedCogit>>compileFullBlockFramelessEntry: (in category 'compile abstract instructions') -----
+ compileFullBlockFramelessEntry: numCopied 
+ 	"Make sure ReceiverResultReg holds the receiver, loaded from the closure,
+ 	 which is what is initially in ReceiverResultReg.  "
+ 	"Use ReceiverResultReg for Context to agree with store check trampoline"
+ 	objectRepresentation
+ 		genLoadSlot: ClosureOuterContextIndex
+ 			sourceReg: ReceiverResultReg
+ 				destReg: ReceiverResultReg;
+ 		genLoadSlot: ReceiverIndex
+ 			sourceReg: ReceiverResultReg
+ 				destReg: Arg0Reg.
+ 	self flag: #TODO. "we could follow the receiver only if the block has inst var ref. Currently we use scanMethod for fullBlock 
+ 	and that scanner does not provide this information. We could extend it based on the scanBlock: method"
+ 	objectRepresentation
+ 		genEnsureOopInRegNotForwarded: Arg0Reg scratchReg: TempReg updatingSlot: ReceiverIndex in: ReceiverResultReg.
+ 	self MoveR: Arg0Reg R: ReceiverResultReg
+ !

Item was added:
+ ----- Method: StackToRegisterMappingCogit>>compileFullBlockFramelessEntry: (in category 'compile abstract instructions') -----
+ compileFullBlockFramelessEntry: numCopied
+ 	"Make sure ReceiverResultReg holds the receiver, loaded from
+ 	 the closure, which is what is initially in ReceiverResultReg"
+ 	self initSimStackForFramelessBlock: initialPC.
+ 	super compileFullBlockFramelessEntry: numCopied!

Item was changed:
  ----- Method: StackToRegisterMappingCogit>>compileFullBlockMethodFrameBuild: (in category 'compile abstract instructions') -----
  compileFullBlockMethodFrameBuild: numCopied
  	<option: #SistaV1BytecodeSet>
- 	| blockStart |
- 	<var: 'blockStart' type: #CogBlockStart>
  	needsFrame ifFalse:
+ 		[self assert: numCopied = 0.
+ 		 self compileFullBlockFramelessEntry: numCopied.
+ 		 self initSimStackForFramelessBlock: initialPC.
- 		[self cCode: [] inSmalltalk: [blockStart := CogBlockStart new].
- 		 blockStart
- 			startpc: initialPC;
- 			numArgs: methodOrBlockNumArgs;
- 			numCopied: numCopied;
- 			numInitialNils: 0.
- 		 self compileBlockFramelessEntry: (self addressOf: blockStart).
  		 ^self].
  	super compileFullBlockMethodFrameBuild: numCopied.
  	self initSimStackForFramefulMethod: initialPC!



More information about the Vm-dev mailing list