[Vm-dev] VM Maker: VMMaker.oscog-eem.2242.mcz
commits at source.squeak.org
commits at source.squeak.org
Mon Jun 12 21:12:59 UTC 2017
Eliot Miranda uploaded a new version of VMMaker to project VM Maker:
http://source.squeak.org/VMMaker/VMMaker.oscog-eem.2242.mcz
==================== Summary ====================
Name: VMMaker.oscog-eem.2242
Author: eem
Time: 12 June 2017, 2:11:49.884748 pm
UUID: 962fc704-64b1-41a9-9080-3eb3eb75c494
Ancestors: VMMaker.oscog-eem.2241
The self assert: (stackPages isFree: thePage) not in findSPOf:on:startingFrom: is misplaced. Relocate it to avoid a bogus assert ail running the Cadence debugger tests.
=============== Diff against VMMaker.oscog-eem.2241 ===============
Item was changed:
----- Method: StackInterpreter>>checkStackPointerIndexForFrame: (in category 'frame access') -----
checkStackPointerIndexForFrame: theFP
"Version of stackPointerIndexForFrame: that does not depend on writing back head frame pointers.
Used for assertion checking. Safe only in external primitives (framePointer valid).
Answer the 0-based index rel to the given frame.
(This is what stackPointer used to be before conversion to pointer)"
"In the StackInterpreter stacks grow down."
| thePage theSP |
<inline: false>
<var: #theFP type: #'char *'>
<var: #thePage type: #'StackPage *'>
<var: #theSP type: #'char *'>
theFP = framePointer ifTrue:
[^self stackPointerIndexForFrame: theFP WithSP: stackPointer].
thePage := stackPages stackPageFor: theFP.
theSP := self findSPOrNilOf: theFP
on: thePage
startingFrom: (thePage = stackPage ifTrue: [framePointer] ifFalse: [thePage headFP]).
+ theSP ifNil: [^-1].
^self stackPointerIndexForFrame: theFP WithSP: theSP!
Item was changed:
----- Method: StackInterpreter>>findSPOf:on: (in category 'frame access') -----
findSPOf: theFP on: thePage
"Search for the stack pointer for theFP. This points to the hottest item on the frame's stack.
DO NOT CALL THIS WITH theFP == localFP OR theFP == framePointer!!"
<var: #theFP type: #'char *'>
<var: #thePage type: #'StackPage *'>
<returnTypeC: #'char *'>
| theSP |
<inline: false>
<var: #theSP type: #'char *'>
+ self deny: (stackPages isFree: thePage).
theSP := self findSPOrNilOf: theFP on: thePage startingFrom: thePage headFP.
+ theSP ifNotNil:
- theSP notNil ifTrue:
[^theSP].
self error: 'did not find theFP in stack page'.
^0!
Item was changed:
----- Method: StackInterpreter>>findSPOrNilOf:on:startingFrom: (in category 'frame access') -----
findSPOrNilOf: theFP on: thePage startingFrom: startFrame
"Search for the stack pointer for theFP. This points to the hottest item on the frame's stack.
DO NOT CALL THIS WITH theFP == localFP OR theFP == framePointer!!"
<var: #theFP type: #'char *'>
<var: #thePage type: #'StackPage *'>
<var: #startFrame type: #'char *'>
<returnTypeC: #'char *'>
| aFrame prevFrame |
<inline: true>
<var: #aFrame type: #'char *'>
<var: #prevFrame type: #'char *'>
- self assert: (stackPages isFree: thePage) not.
startFrame = theFP ifTrue:
[thePage headSP >= startFrame ifTrue:
["If the SP is invalid return the pointer to the receiver field."
^self frameReceiverLocation: theFP].
"Skip the instruction pointer on top of stack of inactive pages."
^thePage = stackPage
ifTrue: [thePage headSP]
ifFalse: [thePage headSP + objectMemory wordSize]].
aFrame := startFrame.
[prevFrame := aFrame.
aFrame := self frameCallerFP: aFrame.
aFrame ~= 0] whileTrue:
[theFP = aFrame ifTrue:
[^self frameCallerSP: prevFrame]].
^nil!
More information about the Vm-dev
mailing list