|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectTranslate.Frame
PPC.Frame
public abstract class 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.
Nested Class Summary | |
---|---|
static class |
Frame.Darwin
|
static class |
Frame.Linux
|
Nested classes/interfaces inherited from class Translate.Frame |
---|
Frame.Access |
Field Summary | |
---|---|
protected java.util.LinkedList<java.lang.String> |
picsymbols
|
Temp |
RV
|
Fields inherited from class Translate.Frame |
---|
formals, maxArgsOut, name |
Method Summary | |
---|---|
Frame.Access |
allocFormal(Temp t)
Allocate a formal parameter represented by temporary t. |
Frame.Access |
allocLocal(Temp t)
Allocate a local variable represented by temporary t. |
Temp.Label |
badPtr()
Get the label to branch to for null pointers |
Temp.Label |
badSub()
Get the label to branch to for bad subscripts |
Tree.Visitor<java.util.LinkedList<Instr>,Temp> |
codegen()
Obtain a code generator visitor for the target, producing a list of assembler instructions. |
void |
procEntryExit1(java.util.LinkedList<Tree.Stm> body)
Wrap the statement tree body of a procedure with entry/exit after translation. |
void |
procEntryExit2(java.util.LinkedList<Instr> insns)
Wrap the assembly body of a procedure with entry/exit after code generation. |
void |
procEntryExit3(java.util.LinkedList<Instr> insns,
Temp.Map map)
Wrap the assembly body of a procedure with entry/exit after register allocation. |
java.lang.String |
record(Temp.Label lab,
int words)
Allocate a zeroed static record |
Temp[] |
registers()
The registers supported by this target. |
Tree.Exp |
RV()
An expression for the return value of this frame. |
java.lang.String |
string(Temp.Label lab,
java.lang.String string)
Allocate an initialized static string literal. |
java.lang.String |
vtable(Temp.Label lab,
java.util.Collection<Temp.Label> values)
Allocate and initialize a static virtual dispatch table |
int |
wordSize()
The word size (in bytes) of this target. |
Methods inherited from class Translate.Frame |
---|
external, mainFrame, newFrame |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public Temp RV
protected java.util.LinkedList<java.lang.String> picsymbols
Method Detail |
---|
public int wordSize()
Frame
wordSize
in class Frame
public Frame.Access allocFormal(Temp t)
Frame
allocFormal
in class Frame
public Frame.Access allocLocal(Temp t)
Frame
allocLocal
in class Frame
public Temp[] registers()
Frame
registers
in class Frame
public Tree.Exp RV()
Frame
RV
in class Frame
public java.lang.String string(Temp.Label lab, java.lang.String string)
Frame
string
in class Frame
lab
- the label to use for the stringstring
- the value of the literal
public java.lang.String record(Temp.Label lab, int words)
Frame
record
in class Frame
lab
- the label to use for the recordwords
- the size of the record in words
public java.lang.String vtable(Temp.Label lab, java.util.Collection<Temp.Label> values)
Frame
vtable
in class Frame
lab
- the label to use for the recordvalues
- the labels of the methods in the table
public Temp.Label badPtr()
Frame
badPtr
in class Frame
public Temp.Label badSub()
Frame
badSub
in class Frame
public void procEntryExit1(java.util.LinkedList<Tree.Stm> body)
Frame
procEntryExit1
in class Frame
body
- the procedure bodypublic Tree.Visitor<java.util.LinkedList<Instr>,Temp> codegen()
Frame
codegen
in class Frame
public void procEntryExit2(java.util.LinkedList<Instr> insns)
Frame
procEntryExit2
in class Frame
insns
- the procedure bodypublic void procEntryExit3(java.util.LinkedList<Instr> insns, Temp.Map map)
Frame
procEntryExit3
in class Frame
insns
- the procedure bodymap
- the register allocation mapping temporaries to hard
registers
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |