hardware
Class Frame
java.lang.Object
|
+--hardware.Frame
- public class Frame
- extends java.lang.Object
Encapsulates a hardware-dependent subprogram frame. Makes assumptions
about the wordsize of the machine as well as the procedure calling
convention.
Specifically, it assumes that the FP register is a pointer to the
first procedure argument, with subsequent arguments at numerically
greater offsets (toward the base of the stack). The local
variables are located starting at FP minus the wordsize, and Frame
initializes the offsetLocal variable in that way. The computed
frame size (cbSize, in bytes) does not include space required for
the parameters--they are assumed to be either in registers or added
on to the caller's stack.
Constructor Summary |
Frame()
|
Method Summary |
int |
addLocal()
Create a new local in the frame. |
int |
addLocal(int size)
|
int |
addParam()
Create a new parameter in the frame. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
wordsize
public static final int wordsize
cbSize
public int cbSize
offsetLocal
public int offsetLocal
offsetParam
public int offsetParam
Frame
public Frame()
addLocal
public int addLocal()
- Create a new local in the frame. Offsets grow more negative from FP.
addLocal
public int addLocal(int size)
addParam
public int addParam()
- Create a new parameter in the frame. Offsets grow more positive from
FP. Parameters do not contribute to the frame size, since they are
allocated in the caller's frame.