[Vm-dev] VM Maker: VMMaker.oscog-eem.692.mcz
commits at source.squeak.org
commits at source.squeak.org
Thu May 1 03:50:08 UTC 2014
Eliot Miranda uploaded a new version of VMMaker to project VM Maker:
http://source.squeak.org/VMMaker/VMMaker.oscog-eem.692.mcz
==================== Summary ====================
Name: VMMaker.oscog-eem.692
Author: eem
Time: 30 April 2014, 8:46:16.266 pm
UUID: 16a360de-d597-4a2a-8d16-f6fa6af61760
Ancestors: VMMaker.oscog-eem.691
Fix the return type of convertToMachineCodeFrame:bcpc: to
match the change to answer the absolute pc, not the relative
pc of the backward jump done in VMMaker.oscog-eem.674.
=============== Diff against VMMaker.oscog-eem.691 ===============
Item was changed:
----- Method: CoInterpreter>>convertToMachineCodeFrame:bcpc: (in category 'frame access') -----
convertToMachineCodeFrame: cogHomeMethod bcpc: bcpc
<var: #cogHomeMethod type: #'CogHomeMethod *'>
+ <returnTypeC: #usqInt>
"Convert the current interpreter frame into a machine code frame
and answer the machine code pc matching bcpc."
| startBcpc methodField closure cogMethod pc |
<var: #cogMethod type: #'CogBlockMethod *'>
<var: #p type: #'char *'>
self assert: (self isMachineCodeFrame: framePointer) not.
"Update the return pc, perhaps saving it in the caller's iframeSavedIP."
(self isBaseFrame: framePointer)
ifTrue:
[stackPages
longAt: framePointer + FoxCallerSavedIP
put: cogit ceBaseFrameReturnPC]
ifFalse:
[(self isMachineCodeFrame: (self frameCallerFP: framePointer)) ifFalse:
[self iframeSavedIP: (self frameCallerFP: framePointer)
put: (self frameCallerSavedIP: framePointer) asInteger.
stackPages
longAt: framePointer + FoxCallerSavedIP
put: cogit ceReturnToInterpreterPC]].
"Set the cog method field"
(self iframeIsBlockActivation: framePointer)
ifTrue:
[closure := self pushedReceiverOrClosureOfFrame: framePointer.
startBcpc := self startPCOfClosure: closure.
cogMethod := cogit
findMethodForStartBcpc: startBcpc
inHomeMethod: cogHomeMethod.
methodField := cogMethod asInteger + MFMethodFlagIsBlockFlag]
ifFalse:
[startBcpc := self startPCOfMethodHeader: cogHomeMethod methodHeader.
cogMethod := self cCoerceSimple: cogHomeMethod to: #'CogBlockMethod *'.
methodField := cogHomeMethod asInteger].
stackPages
longAt: framePointer + FoxMethod
put: methodField
+ ((self iframeHasContext: framePointer)
ifTrue: [MFMethodFlagHasContextFlag]
ifFalse: [0]).
framePointer + FoxIFReceiver to: stackPointer by: BytesPerWord negated do:
[:p|
stackPages longAt: p + FoxMFReceiver - FoxIFReceiver put: (stackPages longAt: p)].
stackPointer := stackPointer + FoxMFReceiver - FoxIFReceiver.
pc := cogit mcPCForBackwardBranch: bcpc startBcpc: startBcpc in: cogMethod.
+ self assert: pc > (cogMethod asUnsignedInteger + cogit noCheckEntryOffset).
- self assert: pc > (cogMethod asInteger + cogit noCheckEntryOffset).
^pc!
More information about the Vm-dev
mailing list