[Vm-dev] VM Maker: VMMaker.oscog-eem.2033.mcz
commits at source.squeak.org
commits at source.squeak.org
Thu Dec 8 23:19:13 UTC 2016
Eliot Miranda uploaded a new version of VMMaker to project VM Maker:
http://source.squeak.org/VMMaker/VMMaker.oscog-eem.2033.mcz
==================== Summary ====================
Name: VMMaker.oscog-eem.2033
Author: eem
Time: 8 December 2016, 3:18:30.130792 pm
UUID: dacd8710-6751-4d27-ba92-6653560eb15a
Ancestors: VMMaker.oscog-eem.2032
Work around Slang snafu with last commit. Slang can't handle the complications involved with cmHomeMethod with the SistaV1 bytecode set (full blocks).
=============== Diff against VMMaker.oscog-eem.2032 ===============
Item was changed:
----- Method: CoInterpreter>>ceSendMustBeBooleanTo:interpretingAtDelta: (in category 'trampolines') -----
ceSendMustBeBooleanTo: aNonBooleanObject interpretingAtDelta: jumpSize
"For RegisterAllocatingCogit we want the address following a conditional branch not to be reachable, so we
don't have to generate code to reload registers. Instead simply convert to an interpreter frame,
backup the pc to the branch, reenter the interpreter and hence retry the mustBeBoolean send therein."
<api>
| cogMethod methodObj methodHeader startBcpc |
<var: 'cogMethod' type: #'CogBlockMethod *'>
self assert: (objectMemory addressCouldBeOop: aNonBooleanObject).
cogMethod := self mframeCogMethod: framePointer.
((self mframeIsBlockActivation: framePointer)
and: [cogMethod cmIsFullBlock not])
ifTrue:
+ [methodHeader := (self cCoerceSimple: cogMethod cmHomeMethod to: #'CogMethod *') methodHeader.
+ methodObj := (self cCoerceSimple: cogMethod cmHomeMethod to: #'CogMethod *') methodObject.
- [methodHeader := cogMethod cmHomeMethod methodHeader.
- methodObj := cogMethod cmHomeMethod methodObject.
startBcpc := cogMethod startpc]
ifFalse:
[methodHeader := (self cCoerceSimple: cogMethod to: #'CogMethod *') methodHeader.
methodObj := (self cCoerceSimple: cogMethod to: #'CogMethod *') methodObject.
startBcpc := self startPCOfMethod: methodObj].
"Map the machine code instructionPointer to the interpreter instructionPointer of the branch."
instructionPointer := self popStack.
instructionPointer := cogit bytecodePCFor: instructionPointer startBcpc: startBcpc in: cogMethod.
instructionPointer := methodObj + objectMemory baseHeaderSize + instructionPointer - jumpSize - 1. "pre-decrement"
"Make space for the two extra fields in an interpreter frame"
stackPointer to: framePointer + FoxMFReceiver by: objectMemory wordSize do:
[:p| | oop |
oop := objectMemory longAt: p.
objectMemory
longAt: p - objectMemory wordSize - objectMemory wordSize
put: (objectMemory longAt: p)].
stackPointer := stackPointer - objectMemory wordSize - objectMemory wordSize.
self push: aNonBooleanObject.
"Fill in the fields"
objectMemory
longAt: framePointer + FoxIFrameFlags
put: (self
encodeFrameFieldHasContext: (self mframeHasContext: framePointer)
isBlock: (self mframeIsBlockActivation: framePointer)
numArgs: cogMethod cmNumArgs);
longAt: framePointer + FoxIFSavedIP
put: 0;
longAt: framePointer + FoxMethod
put: methodObj.
"and now reenter the interpreter..."
self setMethod: methodObj methodHeader: methodHeader.
self siglong: reenterInterpreter jmp: ReturnToInterpreter.!
More information about the Vm-dev
mailing list