Skip to content

Commit 831c9a2

Browse files
committed
Add push and pop operations on specific stack pages
1 parent 712f838 commit 831c9a2

File tree

1 file changed

+30
-3
lines changed

1 file changed

+30
-3
lines changed

smalltalksrc/VMMaker/StackInterpreter.class.st

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4926,9 +4926,9 @@ StackInterpreter >> divorceFrame: theFP andContext: ctxt [
49264926
- pop the instruction pointer
49274927
- pop the suspension reason too
49284928
- push the instruction pointer back"
4929-
savedIP := self popStack.
4930-
self popStack.
4931-
self push: savedIP ].
4929+
savedIP := self popFromStackPage: thePage.
4930+
self popFromStackPage: thePage.
4931+
self pushValue: savedIP toStackPage: thePage ].
49324932
self updateStateOfSpouseContextForFrame: theFP WithSP: theSP.
49334933

49344934
callerCtx := self ensureCallerContext: theFP.
@@ -10590,6 +10590,20 @@ StackInterpreter >> popFloat [
1059010590
^objectMemory floatValueOf: self popStack
1059110591
]
1059210592

10593+
{ #category : 'internal interpreter access' }
10594+
StackInterpreter >> popFromStackPage: aPage [
10595+
"In the StackInterpreter stacks grow down."
10596+
<api>
10597+
| top |
10598+
<inline: true>
10599+
10600+
aPage == stackPage ifTrue: [ ^ self popStack ].
10601+
10602+
top := stackPages unsignedLongAt: aPage headSP.
10603+
aPage headSP: aPage headSP + objectMemory wordSize.
10604+
^top
10605+
]
10606+
1059310607
{ #category : 'internal interpreter access' }
1059410608
StackInterpreter >> popPos32BitInteger [
1059510609
"May set successFlag, and return false if not valid"
@@ -12988,6 +13002,19 @@ StackInterpreter >> pushTemporaryVariableBytecode [
1298813002
self fetchNextBytecode]
1298913003
]
1299013004

13005+
{ #category : 'internal interpreter access' }
13006+
StackInterpreter >> pushValue: aValue toStackPage: aPage [
13007+
"In the StackInterpreter stacks grow down."
13008+
<api>
13009+
<inline: true>
13010+
<var: #sp type: #'char *'>
13011+
| sp |
13012+
aPage == stackPage ifTrue: [ ^ self push: aValue ].
13013+
13014+
stackPages unsignedLongAt: (sp := aPage headSP - objectMemory wordSize) put: aValue.
13015+
aPage headSP: sp
13016+
]
13017+
1299113018
{ #category : 'frame access' }
1299213019
StackInterpreter >> pushedReceiverOrClosureOfFrame: theFP [
1299313020
"The receiver of a message send or the closure of a block activation is

0 commit comments

Comments
 (0)