|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectharpoon.Backend.MIPS.StackInfo
public class StackInfo
This class encapsulates information about a given stack frame, e.g., does it grow up or down, where is the return address stored, that sort of thing.
INPUT
callInfo
is called up front for every call made by
this frame. This information is necessary for construction of the
MIPS stack frame, but it is not necessary for conventions that use a
non-virtual frame pointer.
regAllocUsedRegs
is called after register allocation
to give the stackinfo object knowledge of which callee saved
registers were used.
regAllocLocalWords
is called after the register
allocation to give the stackinfo object knowledge of how many temps
the spill code needs. It would be nice to give the types of the
temps to the stackinfo object and let it map temp index to registers
and stack offset, but that is not the current interface to the spill
information.
OUTPUT
Lots of useful offsets. The multi-word (or multi-stack slot) temp support is currently limited to two word temps. It is ugly, but its not clear that generalizing the solution is a good thing at this stage.
Field Summary | |
---|---|
static int |
BYTEALIGNMENT
|
static int |
REGISTER
|
static int |
REGSTACKSPLIT
|
static int |
STACK
|
Constructor Summary | |
---|---|
StackInfo(RegFileInfo _regfile)
Each new frame should create a new stack info object. |
Method Summary | |
---|---|
int |
argOffset(Object inv,
int arg_idx)
Argument build are is the lowest region on the mips stack, starting at 0(sp) |
Temp |
argReg(Object inv,
int arg_idx)
Return which argument register this argument goes in |
int |
argSecondOffset(Object inv,
int arg_idx)
Give a higher offset. |
Temp |
argSecondReg(Object inv,
int arg_idx)
Return the second argument register for a two word temporary. |
int |
argWhere(Object inv,
int arg_idx)
Call this to find out if a given argument is to be passed in a register, on the stack, or (for multi-word temporaries) split between register and stack. |
Temp |
calleeReg(int callee_idx)
Return the register for this callee saved register index |
int |
calleeSaveOffset(int callee_idx)
Return the offset for a given callee saved register index. |
int |
calleeSaveTotal()
Return how many callee saved registers there are for this frame |
void |
callInfo(INVOCATION inv)
Call callInfo with the destination label and argument list
for all calls made by this activation frame. |
void |
callInfo(METHOD meth)
For callee argument information call callInfo with
METHOD object, and we will interpret the parameter list. |
int |
frameSize()
|
int |
getFPOffset()
|
int |
getRAOffset()
|
int |
localSaveOffset(int local_idx)
Return the offset for a given local index |
void |
regAllocLocalWords(int w)
On top (highest address) of the MIPS stack frame are the locals/temporaries This isn't a great interface, but it is the info we get from RegAlloc. |
void |
regAllocUsedRegs(ArrayList used)
Give the stack frame model the array of used callee saved registers. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int REGISTER
public static final int STACK
public static final int REGSTACKSPLIT
public static final int BYTEALIGNMENT
Constructor Detail |
---|
public StackInfo(RegFileInfo _regfile)
Method Detail |
---|
public int argOffset(Object inv, int arg_idx)
public int argSecondOffset(Object inv, int arg_idx)
public int argWhere(Object inv, int arg_idx)
public Temp argReg(Object inv, int arg_idx)
public Temp argSecondReg(Object inv, int arg_idx)
public void regAllocUsedRegs(ArrayList used)
public int calleeSaveTotal()
public Temp calleeReg(int callee_idx)
public int calleeSaveOffset(int callee_idx)
public void regAllocLocalWords(int w)
public int localSaveOffset(int local_idx)
public int getFPOffset()
public int getRAOffset()
public int frameSize()
public void callInfo(INVOCATION inv)
callInfo
with the destination label and argument list
for all calls made by this activation frame. The stack then
knows about every function it has to call.
public void callInfo(METHOD meth)
callInfo
with
METHOD object, and we will interpret the parameter list.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |