|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectharpoon.Backend.Generic.CodeGen
public abstract class CodeGen
Generic.CodeGen
is a general class for specific Backends to
extend. Typically a Specfile for a specific backend will be
designed as an extension of this class.
Field Summary | |
---|---|
Frame |
frame
|
protected InstrFactory |
instrFactory
InstrFactory for Instr s currently
generated by CodeGen#emit . |
Constructor Summary | |
---|---|
CodeGen(Frame frame)
Creates a Generic.CodeGen . |
Method Summary | |
---|---|
protected abstract Instr |
cgg_backendEmit(Instr i)
Protected helper method guaranteed to be called by emit(Instr). |
abstract List |
cgg_genCode(Code tree,
InstrFactory inf)
Creates a Instr list from the
IR.Tree.Code tree . |
abstract Instr |
cgg_genData(Data tree,
InstrFactory inf)
|
void |
debug(String s)
|
protected abstract void |
declare(Temp t,
Derivation.DList dl)
|
protected abstract void |
declare(Temp t,
HClass clz)
|
protected void |
declare(Temp t,
TreeDerivation td,
Exp e)
|
protected Instr |
emit(Instr i)
Emits i as the next instruction in the
instruction stream. |
protected void |
endGroup(InstrGroup g)
|
List |
genCode(Code tree,
InstrFactory inf)
Creates a Instr list from the
IR.Tree.Code tree . |
Instr |
genData(Data tree,
InstrFactory inf)
Creates a Instr list from the
IR.Tree.Data tree . |
String |
prettyPrint(Tree exp)
|
void |
procFixup(HMethod hm,
Code code,
int stackspace,
Set usedRegisters)
Fixes up the procedure entry and exit code for a list of instrs, once it is known how many registers and how much stack space is used. |
abstract Instr |
procFixup(HMethod hm,
Instr instr,
int stackspace,
Set usedRegisters)
Fixes up the procedure entry and exit code for a list of instrs, once it is known how many registers and how much stack space is used. |
protected InstrGroup |
startGroup(InstrGroup.Type type)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public final Frame frame
protected InstrFactory instrFactory
InstrFactory
for Instr
s currently
generated by CodeGen#emit
. (Assigned by
CodeGen#genCode
and
CodeGen#genData
).
Constructor Detail |
---|
public CodeGen(Frame frame)
Generic.CodeGen
.
Method Detail |
---|
protected InstrGroup startGroup(InstrGroup.Type type)
protected void endGroup(InstrGroup g)
protected final Instr emit(Instr i)
i
as the next instruction in the
instruction stream.
protected abstract Instr cgg_backendEmit(Instr i)
cgg_backendEmit(..)
is implemented for every
CodeGeneratorGenerator, such as MaxMunchCG
).
protected abstract void declare(Temp t, HClass clz)
protected abstract void declare(Temp t, Derivation.DList dl)
protected final void declare(Temp t, TreeDerivation td, Exp e)
public abstract Instr procFixup(HMethod hm, Instr instr, int stackspace, Set usedRegisters)
public void procFixup(HMethod hm, Code code, int stackspace, Set usedRegisters)
public final List genCode(Code tree, InstrFactory inf)
Instr
list from the
IR.Tree.Code
tree
.
Instr
s
to execute tree
, and the second element is the
Derivation
for that list of instructions.
Instr
spublic abstract List cgg_genCode(Code tree, InstrFactory inf)
Instr
list from the
IR.Tree.Code
tree
.
Instr
s
to execute tree
, and the second element is the
Derivation
for that list of instructions.
Instr
spublic final Instr genData(Data tree, InstrFactory inf)
Instr
list from the
IR.Tree.Data
tree
.
Instr
s representing the layout of
tree
.
Instr
spublic abstract Instr cgg_genData(Data tree, InstrFactory inf)
public void debug(String s)
public String prettyPrint(Tree exp)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |