|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectTranslate.Frame
public abstract class Frame
Frame is an abstract class whose concrete instances represent frames on the target machine.
Nested Class Summary | |
---|---|
class |
Frame.Access
An Access represents storage for a local variable in this frame. |
Field Summary | |
---|---|
java.util.LinkedList<Frame.Access> |
formals
LinkedList of the allocated formals. |
int |
maxArgsOut
Maximum number of arguments used by calls in this frame; |
Temp.Label |
name
The label for this frame. |
Constructor Summary | |
---|---|
protected |
Frame(Temp.Label n)
|
Method Summary | |
---|---|
abstract Frame.Access |
allocFormal(Temp t)
Allocate a formal parameter represented by temporary t. |
abstract Frame.Access |
allocLocal(Temp t)
Allocate a local variable represented by temporary t. |
abstract Temp.Label |
badPtr()
Get the label to branch to for null pointers |
abstract Temp.Label |
badSub()
Get the label to branch to for bad subscripts |
abstract Tree.Visitor<java.util.LinkedList<Instr>,Temp> |
codegen()
Obtain a code generator visitor for the target, producing a list of assembler instructions. |
abstract Tree.Exp |
external(java.lang.String func)
Get a reference to an external procedure. |
abstract Frame |
mainFrame()
The frame of the C main procedure. |
abstract Frame |
newFrame(java.lang.String name)
Factory for obtaining concrete instances of the target frame. |
abstract void |
procEntryExit1(java.util.LinkedList<Tree.Stm> body)
Wrap the statement tree body of a procedure with entry/exit after translation. |
abstract void |
procEntryExit2(java.util.LinkedList<Instr> insns)
Wrap the assembly body of a procedure with entry/exit after code generation. |
abstract void |
procEntryExit3(java.util.LinkedList<Instr> insns,
Temp.Map map)
Wrap the assembly body of a procedure with entry/exit after register allocation. |
abstract java.lang.String |
record(Temp.Label label,
int words)
Allocate a zeroed static record |
abstract Temp[] |
registers()
The registers supported by this target. |
abstract Tree.Exp |
RV()
An expression for the return value of this frame. |
abstract java.lang.String |
string(Temp.Label label,
java.lang.String value)
Allocate an initialized static string literal. |
abstract java.lang.String |
vtable(Temp.Label label,
java.util.Collection<Temp.Label> methods)
Allocate and initialize a static virtual dispatch table |
abstract int |
wordSize()
The word size (in bytes) of this target. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public final Temp.Label name
public final java.util.LinkedList<Frame.Access> formals
public int maxArgsOut
Constructor Detail |
---|
protected Frame(Temp.Label n)
Method Detail |
---|
public abstract Frame newFrame(java.lang.String name)
name
- the name of the method
public abstract Frame mainFrame()
public abstract Frame.Access allocFormal(Temp t)
public abstract Frame.Access allocLocal(Temp t)
public abstract Temp[] registers()
public abstract int wordSize()
public abstract Tree.Exp external(java.lang.String func)
public abstract Tree.Exp RV()
public abstract java.lang.String string(Temp.Label label, java.lang.String value)
label
- the label to use for the stringvalue
- the value of the literal
public abstract java.lang.String record(Temp.Label label, int words)
label
- the label to use for the recordwords
- the size of the record in words
public abstract java.lang.String vtable(Temp.Label label, java.util.Collection<Temp.Label> methods)
label
- the label to use for the recordmethods
- the labels of the methods in the table
public abstract Temp.Label badPtr()
public abstract Temp.Label badSub()
public abstract void procEntryExit1(java.util.LinkedList<Tree.Stm> body)
body
- the procedure bodypublic abstract Tree.Visitor<java.util.LinkedList<Instr>,Temp> codegen()
public abstract void procEntryExit2(java.util.LinkedList<Instr> insns)
insns
- the procedure bodypublic abstract void procEntryExit3(java.util.LinkedList<Instr> insns, Temp.Map map)
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 |