[Vm-dev] VM Maker: VMMaker.oscog-eem.792.mcz
commits at source.squeak.org
commits at source.squeak.org
Wed Jul 2 03:11:22 UTC 2014
Eliot Miranda uploaded a new version of VMMaker to project VM Maker:
http://source.squeak.org/VMMaker/VMMaker.oscog-eem.792.mcz
==================== Summary ====================
Name: VMMaker.oscog-eem.792
Author: eem
Time: 1 July 2014, 8:08:46.954 pm
UUID: 9d8d23c8-c855-48a6-8bdd-402765c01a99
Ancestors: VMMaker.oscog-eem.791
Fix potential liveness of ReceiverResultReg across counting
jumps by reloading ReceiverResultReg before returning from
the trampoline through which ceCounterTripped: is called.
=============== Diff against VMMaker.oscog-eem.791 ===============
Item was changed:
----- Method: SistaStackToRegisterMappingCogit>>genMustBeBooleanTrampolineFor:called: (in category 'initialization') -----
genMustBeBooleanTrampolineFor: boolean called: trampolineName
"This can be entered in one of two states, depending on SendNumArgsReg. See
e.g. genJumpIf:to:. If SendNumArgsReg is non-zero then this has been entered via
the initial test of the counter in the jump executed count (i.e. the counter has
tripped). In this case TempReg contains the boolean to be tested and should not
be offset, and ceCounterTripped should be invoked with the unoffset TempReg.
If SendNumArgsReg is zero then this has been entered for must-be-boolean
processing. TempReg has been offset by boolean and must be corrected and
ceSendMustBeBoolean: invoked with the corrected value."
<var: #trampolineName type: #'char *'>
| jumpMBB |
<var: #jumpMBB type: #'AbstractInstruction *'>
<inline: false>
opcodeIndex := 0.
self CmpCq: 0 R: SendNumArgsReg.
jumpMBB := self JumpZero: 0.
+ "Open-code self compileTrampolineFor: #ceCounterTripped: numArgs: 1 arg: TempReg ...
+ so we can restore ResultReceiverReg."
+ backEnd hasLinkRegister ifTrue:
+ [self PushR: LinkReg].
+ self genSmalltalkToCStackSwitch.
+ self
+ compileCallFor: #ceCounterTripped:
- self compileTrampolineFor: #ceCounterTripped:
numArgs: 1
arg: TempReg
arg: nil
arg: nil
arg: nil
+ resultReg: TempReg "(*)"
+ saveRegs: false.
+ "(*) For the case where the ceCounterTripped: call returns (e.g. because there's no callback selector
- saveRegs: false
- pushLinkReg: true
- resultReg: nil.
- "For the case where the ceCounterTripped: call returns (e.g. because there's no callback selector
installed), the call to the ceSendMustBeBooleanAddTrue/FalseTrampoline is followed by a jump
back to the start of the counter/condition test sequence. For this case copy the C result to
TempReg (the register that is tested), to reload it with the boolean to be tested."
+ backEnd genLoadStackPointers.
+ backEnd hasLinkRegister ifTrue:
+ [self PopR: LinkReg].
+ "To keep ResultReceiverReg live if optStatus thiught it was, simply reload it
+ from the frame pointer. This avoids having to reload it in the common case
+ (counter does not trip) if it was live."
+ self MoveMw: FoxMFReceiver r: FPReg R: ReceiverResultReg.
+ self RetN: 0.
- backEnd cResultRegister ~= TempReg ifTrue:
- [self MoveR: backEnd cResultRegister R: TempReg].
"If the objectRepresentation does want true & false to be mobile then we need to record these addresses."
self assert: (objectRepresentation shouldAnnotateObjectReference: boolean) not.
jumpMBB jmpTarget: (self AddCq: boolean R: TempReg).
^self genTrampolineFor: #ceSendMustBeBoolean:
called: trampolineName
numArgs: 1
arg: TempReg
arg: nil
arg: nil
arg: nil
saveRegs: false
pushLinkReg: true
resultReg: nil
appendOpcodes: true!
More information about the Vm-dev
mailing list