PPC
Class PPCFrame
java.lang.Object
Frame.Frame
PPC.PPCFrame
- Direct Known Subclasses:
- DarwinFrame, LinuxFrame
- public abstract class PPCFrame
- extends Frame
Represents PowerPC stack frames.
ppc stack frames look like this after procedure prolog has
been executed:
Higher address:
.........
+-------------------------------+
| caller's LR |
+-------------------------------+
| caller's CR |
+-------------------------------+
Caller's SP->| caller's caller's sp | ^^ Caller's Frame ^^
+===============================+ vv Callee's Frame vv
| Save Area for | FPF 31
..........
| Caller's FPF's | FPF n
+-------------------------------+
| Save Area for | GRF 31
..........
| Caller's GRF's | GRF n
+-------------------------------+
| alignment pad |
............
| (if necessary) |
+-------------------------------+
| Local |
........
| Variables |
+-------------------------------+
SP + X -> | aN for FUTURE call |
+-------------------------------+
..........
+-------------------------------+
SP + 28 -> | a1 for FUTURE call |
+-------------------------------+
SP + 24 -> | a0 for FUTURE call |
+-------------------------------+
SP + 20 -> | caller's TOC |
+-------------------------------+
SP + 16 -> | reserved |
+-------------------------------+
SP + 12 -> | reserved |
+-------------------------------+
SP + 8 -> | LR callee-save for FUTURE call|
+-------------------------------+
SP + 4 -> | CR callee-save for FUTURE call|
+-------------------------------+
SP -> | caller's sp |
+===============================+
Lower address:
NOTE: All state with the exception of LR and CR are saved in the
callee's frame. LR and CR are saved in the CALLER'S FRAME.
ALSO NOTE: Args to the callee are found in the caller's frame.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
RV
public Temp RV
PPCFrame
public PPCFrame()
wordSize
public int wordSize()
- Specified by:
wordSize
in class Frame
allocFormal
public Access allocFormal(java.lang.String s)
- Description copied from class:
Frame
- Allocate a formal parameter named s in this frame.
- Specified by:
allocFormal
in class Frame
allocLocal
public Access allocLocal(java.lang.String s)
- Description copied from class:
Frame
- Allocate a local variable named s in this frame.
If s is null, then the variable is forced to be allocated in memory in
the frame.
If s is non-null, then the variable is eligible for register
allocation.
- Specified by:
allocLocal
in class Frame
RV
public Exp RV()
- Specified by:
RV
in class Frame
string
public java.lang.String string(Label lab,
java.lang.String string)
- Specified by:
string
in class Frame
record
public java.lang.String record(Label lab,
int words)
- Specified by:
record
in class Frame
vtable
public java.lang.String vtable(Label lab,
java.util.LinkedList<Label> values)
- Specified by:
vtable
in class Frame
badPtr
public Label badPtr()
- Specified by:
badPtr
in class Frame
badSub
public Label badSub()
- Specified by:
badSub
in class Frame
codegen
public Visitor<Temp,java.util.LinkedList<Instr>> codegen()
- Specified by:
codegen
in class Frame
procEntryExit1
public void procEntryExit1(java.util.LinkedList<Stm> body)
- Specified by:
procEntryExit1
in class Frame
procEntryExit2
public void procEntryExit2(java.util.LinkedList<Instr> insns)
- Specified by:
procEntryExit2
in class Frame
procEntryExit3
public void procEntryExit3(java.util.LinkedList<Instr> insns,
TempMap map)
- Specified by:
procEntryExit3
in class Frame