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!
ClementBera uploaded a new version of VMMaker to project VM Maker:
http://source.squeak.org/VMMaker/VMMaker.oscog-cb.1936.mcz
==================== Summary ====================
Name: VMMaker.oscog-cb.1936
Author: cb
Time: 5 September 2016, 2:51:19.995237 pm
UUID: a0fcd00d-b0e0-4a17-841c-f90144c91fe4
Ancestors: VMMaker.oscog-cb.1935
Added a deny to ensure the block can be frameless. Works both for blocks and full blocks.
=============== Diff against VMMaker.oscog-cb.1935 ===============
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 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"
self annotateBytecode: blockStart entryLabel.
self annotateBytecode: blockStart entryLabel.
objectRepresentation
genLoadSlot: ClosureOuterContextIndex
sourceReg: ReceiverResultReg
destReg: TempReg;
genLoadSlot: ReceiverIndex
sourceReg: TempReg
destReg: ReceiverResultReg!