Class RTStack
java.lang.Object
svm.RTStack
Runtime Stack.
STACK -----------. OUTMOST STACK ... | STACK -----------' FRAME: EXPORT ? -------. FRAME HEAD IMPORT | ... | IMPORT | RETURN ADDRESS | LOCAL | ... | LOCAL -----------' STACK -----------. LOCAL STACK ... | STACK -----------' MORE FRAMES ?
Link to GitHub: Source File.
- Author:
- Øystein Myhre Andersen
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic Stack<CallStackFrame> The CALL Stackstatic Stack<CallStackFrame> The PRECALL StackThe Runtime Stack -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddExport(int nSlotStacked, int nExportSlots) Add EXPORT slots to the Current Stack Frame.static CallStackFrameReturns the CALL Stack TOPstatic voidCheck RTStack emptystatic intcurSize()Returns Stack size within the current Framestatic voiddumpRTStack(String title) Dump the RTStackstatic voiddup(int n) Duplicate the 'n' top values on the stackstatic intReturns the current Frame indexstatic Valueload(int index) Returns the value at the given indexstatic Valuepeek()Returns the value at the top of this stackstatic intpeekInt()Returns the value at the top of this stack as n intstatic Valuepop()Pop the top off this stack and returns that value.static GeneralAddresspopGADDR()Pop the top two values off this stack and return it as a GeneralAddress.static ObjectAddressPop the top two values off this stack and return it as an ObjectAddress.static intpopInt()Pop the top off this stack and returns that value as an intstatic doublePop the top off this stack and returns that value as a doublestatic ObjectAddresspopOADDR()Pop the top off this stack and returns that value as an ObjectAddress value.static floatpopReal()Pop the top off this stack and returns that value as a floatstatic StringPop the top three items off this stack as an infix(string).popx(int n) Pop the top 'n' values off this stack.static voidprintCallTrace(String title) Print the entire Call Stackstatic voidPush a value onto the stackstatic voidPush a set of values onto the stackstatic intsize()Returns The total Stack sizestatic voidStore a value at the given indexstatic StringtoLine()Listing utility: Edit the RTStack as a single line
-
Field Details
-
stack
-
precallStack
The PRECALL Stack -
callStack
The CALL Stack
-
-
Constructor Details
-
RTStack
public RTStack()Default Constructor
-
-
Method Details
-
checkStackEmpty
public static void checkStackEmpty()Check RTStack empty -
callStack_TOP
-
printCallTrace
Print the entire Call Stack- Parameters:
title- the title of the printout
-
curSize
public static int curSize()Returns Stack size within the current Frame- Returns:
- Stack size within the current Frame
-
size
public static int size()Returns The total Stack size- Returns:
- The total Stack size
-
load
Returns the value at the given index- Parameters:
index- the index- Returns:
- the value at the given index
-
store
Store a value at the given index- Parameters:
index- the indexvalue- the value
-
dup
public static void dup(int n) Duplicate the 'n' top values on the stack- Parameters:
n- number of values to be duplicated
-
push
-
addExport
public static void addExport(int nSlotStacked, int nExportSlots) Add EXPORT slots to the Current Stack Frame.
Current Stack; IMPORT idx = last - (nSlotStacked - 1) ... nSlotStacked TOP: IMPORT idx = last===>
EXPORT ... nExportSlots EXPORT IMPORT ... nSlotStacked TOP: IMPORT- Parameters:
nSlotStacked- number of slots stackednExportSlots- number of Exports slots
-
pop
Pop the top off this stack and returns that value.- Returns:
- the value popped off the stack
-
peek
Returns the value at the top of this stack- Returns:
- the value at the top of this stack
-
pushx
-
popx
-
peekInt
public static int peekInt()Returns the value at the top of this stack as n int- Returns:
- the value at the top of this stack as an int
-
popInt
public static int popInt()Pop the top off this stack and returns that value as an int- Returns:
- the int value popped off the stack
-
popReal
public static float popReal()Pop the top off this stack and returns that value as a float- Returns:
- the floar value popped off the stack
-
popLongReal
public static double popLongReal()Pop the top off this stack and returns that value as a double- Returns:
- the double value popped off the stack
-
popGADDR
Pop the top two values off this stack and return it as a GeneralAddress.- Returns:
- the GeneralAddress value popped off the stack
-
popGADDRasOADDR
Pop the top two values off this stack and return it as an ObjectAddress.- Returns:
- the ObjectAddress value popped off the stack
-
frameIndex
public static int frameIndex()Returns the current Frame index- Returns:
- the current Frame index
-
popOADDR
Pop the top off this stack and returns that value as an ObjectAddress value.- Returns:
- the ObjectAddress value popped off the stack
-
popString
Pop the top three items off this stack as an infix(string). Then, use it to form a Java String value.- Returns:
- the Java String formed
-
toLine
Listing utility: Edit the RTStack as a single line- Returns:
- the RTStack as a single line
-
dumpRTStack
Dump the RTStack- Parameters:
title- the title of the dump printout
-