|
||||||||||
前のクラス 次のクラス | フレームあり フレームなし | |||||||||
概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |
java.lang.Object | +--coins.backend.gen.CodeGenerator
Abstract code generator. Generators for specific machines are defined as subclasses of this class.
入れ子クラスの概要 | |
(パッケージプライベート) static class |
CodeGenerator.FunctionAttr
Keeps track of function's attributes. |
(パッケージプライベート) class |
CodeGenerator.LexpToString
Convert address expression to external form. |
(パッケージプライベート) class |
CodeGenerator.Match
Node of matching tree (or DAG) |
フィールドの概要 | |
(パッケージプライベート) int |
addrType
Address type |
(パッケージプライベート) java.io.PrintWriter |
asmWriter
Output Writer |
(パッケージプライベート) java.lang.String |
convention
OS convention |
(パッケージプライベート) java.io.PrintWriter |
debOut
Debugging message |
(パッケージプライベート) NumberSet |
disableRewrite
Flags for disabling rescanning. |
(パッケージプライベート) static int |
F128
|
(パッケージプライベート) static int |
F32
|
(パッケージプライベート) static int |
F64
|
(パッケージプライベート) Function |
func
Current function |
(パッケージプライベート) java.util.Map |
funcAttrTbl
Function attribute tables. |
(パッケージプライベート) static int |
I16
|
(パッケージプライベート) static int |
I32
|
(パッケージプライベート) static int |
I64
Commonly used type constants. |
(パッケージプライベート) static int |
I8
|
(パッケージプライベート) static int |
INLINECOPYUNIT
|
(パッケージプライベート) CodeGenerator.LexpToString |
lexpConv
|
(パッケージプライベート) LirFactory |
lir
LIR factory |
(パッケージプライベート) LocalTransformer |
localEarlyRewritingTrig
Early time pre-rewriting of LIR, function by function. |
(パッケージプライベート) LocalTransformer |
localLateRewritingTrig
Late time pre-rewriting of LIR, function by function. |
(パッケージプライベート) java.lang.String |
machineName
CPU name |
(パッケージプライベート) MachineParams |
machineParams
Feature of Machine |
(パッケージプライベート) Module |
module
L-Module |
(パッケージプライベート) boolean |
optSpeed
Flag speed/space tradeoff. |
(パッケージプライベート) LocalTransformer |
ProcessFramesTrig
|
(パッケージプライベート) Root |
root
Global variables |
(パッケージプライベート) int |
typeParamWord
Type of parameter words on stack |
コンストラクタの概要 | |
CodeGenerator()
Creator |
メソッドの概要 | |
int |
alignForType(int type)
Return alignment for type. |
(パッケージプライベート) BiList |
buildCode(Function f)
Convert FUNCTION to S-expression assembly code. |
(パッケージプライベート) ImList |
clcvnClobbers()
Return clobber list |
(パッケージプライベート) LirNode |
clcvnParamMem(int type,
int location,
boolean caller)
Return parameter memory |
(パッケージプライベート) int |
clcvnParamOffset(int location)
Return offset of parameter |
(パッケージプライベート) LirNode |
clcvnParamReg(int type,
int location,
boolean caller)
Return parameter register |
(パッケージプライベート) LirNode |
clcvnParamWord(int type,
int location,
boolean caller)
Return parameter word - either register or memory. |
(パッケージプライベート) LirNode |
clcvnPartialWord(LirNode exp,
int part)
Return partial word of object |
(パッケージプライベート) void |
clcvnPassFloatRegMem(int location,
LirNode arg,
BiLink memp,
BiLink regp,
BiList alist)
Pass floating point number to register/ register and memory. |
(パッケージプライベート) int |
clcvnRegLimit()
Return number of registers multiply word-size. |
(パッケージプライベート) LirNode |
clcvnReturnValue(int type)
Return return register |
(パッケージプライベート) LirNode |
clcvnSetPartialWord(LirNode lhs,
int part,
LirNode rhs)
Set partial word of object |
(パッケージプライベート) boolean |
clcvnStructReturnAsFirst()
Return true if struct return address |
(パッケージプライベート) LirNode |
clcvnStructReturnPtr(boolean caller)
Create code that sets address of struct to hidden parameter. |
void |
close()
Close output stream. |
ImList |
codeInfo(LirNode ins)
Return cost and misc. information about instruction tree. |
LocalTransformer |
convToAsm()
|
(パッケージプライベート) abstract java.lang.String |
defaultRegsetForType(int type)
Return default register set for type. |
(パッケージプライベート) LirNode |
dropRegToFrame(LirNode node)
Convert (REG t ...) node to (MEM t (FRAME I32 ...)). |
Transformer[] |
earlyRewritingSequence()
Return early time pre-rewriting sequence. |
(パッケージプライベート) void |
emitAlign(java.io.PrintWriter out,
int align)
Emit align (Bytesize) |
(パッケージプライベート) java.lang.String |
emitAsmCode(java.lang.String format,
ImList args)
Emit asm instruction. |
(パッケージプライベート) void |
emitBeginningOfModule(Module mod,
java.io.PrintWriter out)
Emit beginning of module |
(パッケージプライベート) void |
emitBeginningOfSegment(java.io.PrintWriter out,
java.lang.String segment)
Emit beginning of segment |
(パッケージプライベート) void |
emitCode(BiList asmList,
java.io.PrintWriter file)
Emit S-expression assembly code to file. |
(パッケージプライベート) void |
emitCodeLabel(java.io.PrintWriter out,
java.lang.String label)
Emit label for code |
(パッケージプライベート) void |
emitComment(java.io.PrintWriter out,
java.lang.String comment)
print comment in assembly language. |
(パッケージプライベート) void |
emitCommon(java.io.PrintWriter out,
SymStatic symbol,
int bytes)
Emit data common |
(パッケージプライベート) void |
emitData(java.io.PrintWriter out,
int type,
LirNode node)
Emit data for big endian machine. |
(パッケージプライベート) void |
emitDataLabel(java.io.PrintWriter out,
java.lang.String label)
Emit label for data |
(パッケージプライベート) void |
emitEndOfModule(Module mod,
java.io.PrintWriter out)
Emit ending of module |
(パッケージプライベート) void |
emitEndOfSegment(java.io.PrintWriter out,
java.lang.String segment)
Emit end of segment |
(パッケージプライベート) void |
emitIdent(java.io.PrintWriter out,
java.lang.String ident)
Print .ident in assembly language. |
(パッケージプライベート) void |
emitLinkage(java.io.PrintWriter out,
SymStatic symbol)
Emit linkage information of symbol |
(パッケージプライベート) abstract java.lang.String |
emitLir(LirNode node)
Expand emit-macro for LirNode. |
(パッケージプライベート) java.lang.String |
emitLirDefault(LirNode node)
Default expansion action for LirNode. |
(パッケージプライベート) abstract java.lang.String |
emitList(ImList form,
boolean topLevel)
Expand emit-macro for list form. |
(パッケージプライベート) java.lang.String |
emitListDefault(ImList form,
boolean topLevel)
Default expansion action for S-expression. |
void |
emitNamedConst(java.lang.String name,
LirNode value)
Emit named constant. |
(パッケージプライベート) java.lang.String |
emitObject(java.lang.Object x)
Convert S-expression assembly code to string. |
(パッケージプライベート) java.lang.String |
emitObjectX(java.lang.Object x,
boolean top)
Convert S-expression assembly code to string. |
(パッケージプライベート) void |
emitSegment(java.io.PrintWriter file,
java.lang.String segment)
Change default segment to segment . |
(パッケージプライベート) java.lang.String |
emitTop(java.lang.Object x)
Convert toplevel S-expression assembly code to string. |
(パッケージプライベート) void |
emitZeros(java.io.PrintWriter out,
int bytes)
Emit data zeros |
(パッケージプライベート) boolean |
equalArg(LirNode x,
LirNode y)
Return true if variable x and y are same. |
(パッケージプライベート) abstract java.lang.Object |
expandBuildMacro(ImList form)
Expand building macro for list form. |
(パッケージプライベート) boolean |
frameIsEmpty(Function f)
|
(パッケージプライベート) int |
frameSize(Function f)
Return frame size (in positive) of function. |
void |
genHeader(Module mod)
Generate header on assembly file. |
void |
genTrailer(Module mod)
Generate trailer on assembly file. |
(パッケージプライベート) abstract int |
getCost1(LirNode t,
int goal)
Return the cost for LIR node t and goal nonterminal goal. |
(パッケージプライベート) abstract int |
getCost2(LirNode t,
int goal)
|
(パッケージプライベート) CodeGenerator.FunctionAttr |
getFunctionAttr(Function func)
Return function attributes. |
MachineParams |
getMachineParams()
Return machineParams |
(パッケージプライベート) abstract Rule |
getRule(LirNode t,
int goal)
Return the chosen rule for LIR node t and goal nonterminal goal. |
void |
initialize(Root root,
Module module,
TargetMachine target,
java.lang.String machine,
java.lang.String convention)
Set root pointer etc. |
(パッケージプライベート) void |
initializeMachineDep()
Do Machine-dependent initialization (subclass may override this). |
(パッケージプライベート) abstract void |
initLabeling(LirFactory lir)
Initialize for labeling. |
(パッケージプライベート) abstract void |
initRewriteLabeling()
Initialization for rewriting. |
(パッケージプライベート) java.io.OutputStream |
insertPostProcessor(java.io.OutputStream stream)
Insert post-processor filter pass. |
void |
instructionSelection(Function f)
Rewrite a function so that each LIR tree corresponds to single machine instruction. |
(パッケージプライベート) boolean |
isComplex(LirNode node)
Return true if node is a complex one. |
(パッケージプライベート) boolean |
isSimple(LirNode node)
Return true if node is a simple variable. |
(パッケージプライベート) abstract void |
labelTree(LirNode t)
Label LIR tree t. |
Transformer[] |
lateRewritingSequence()
Return late time pre-rewriting sequence. |
(パッケージプライベート) java.lang.String |
makeAsmSymbol(java.lang.String symbol)
Make symbol in assembly language form. |
(パッケージプライベート) java.lang.String |
makeLabelDef(java.lang.String label)
Return label definition |
(パッケージプライベート) Symbol |
mapRegToFrame(Symbol reg)
Return FRAME variable symbol entry which corresponds to REG variable. |
(パッケージプライベート) int |
nActualOperands(LirNode node)
Return the number of operands excluding CLOBBER and USE. |
(パッケージプライベート) CodeGenerator.FunctionAttr |
newFunctionAttr(Function f)
Prepare new function attribute information. |
(パッケージプライベート) LirNode |
noRescan(LirNode node)
Disable rewriting of LIR node. |
(パッケージプライベート) void |
notifyEndToPostProcessor()
Notify end of assembly to post-processor. |
(パッケージプライベート) int |
paramOffset(LirNode arg)
Return offset of the formal parameter (used by va_start). |
(パッケージプライベート) int |
paramToBeSaved()
Return the location of parameter which should be reside on memory. |
(パッケージプライベート) void |
peepHoleOpt(BiList list)
Peep-hole optimizer. |
(パッケージプライベート) LirNode |
phyReg(java.lang.String name)
Return physical register node. |
void |
prepareCodeInfo(Function f)
|
void |
prerewrite(Function f,
java.lang.String phase)
Pre-rewrite of L-Function. |
(パッケージプライベート) void |
printLabel(LirNode t,
java.lang.String indent)
Print label of tree t . |
(パッケージプライベート) abstract java.lang.Object |
quiltLir(LirNode node)
Expand building macro for LirNode. |
(パッケージプライベート) java.lang.Object |
quiltLirDefault(LirNode node)
Expand LirNode |
(パッケージプライベート) CodeGenerator.Match |
reduce(LirNode t,
int goal)
Reduce labeled tree t
with goal nonterminal goal . |
(パッケージプライベート) SymAuto |
reserveFrame(java.lang.String name,
int type)
Reserve frame variable. |
(パッケージプライベート) LirNode |
rewriteAggregateCopy(LirNode node,
BiList pre)
Rewrite aggregate copy. |
(パッケージプライベート) LirNode |
rewriteAsm(LirNode node,
BiList pre,
BiList post)
Rewrite ASM |
(パッケージプライベート) LirNode |
rewriteCall(LirNode node,
BiList pre,
BiList post)
Rewrite CALL. |
(パッケージプライベート) LirNode |
rewriteCONVFU(LirNode node,
BiList pre)
Rewrite CONVFU(x) to: if (x < 2147483648) CONVFS(x) else CONVFS(x - 2147483648) + 214748648 |
(パッケージプライベート) LirNode |
rewriteCONVUF(LirNode node,
BiList pre)
Rewrite CONVUF |
(パッケージプライベート) LirNode |
rewriteEpilogue(LirNode node,
BiList pre)
Rewrite EPILOGUE |
(パッケージプライベート) LirNode |
rewriteFrame(LirNode node)
Rewrite FRAME node to target machine form. |
(パッケージプライベート) LirNode |
rewriteJumpn(LirNode node,
BiList pre)
Rewrite JUMPN. |
(パッケージプライベート) LirNode |
rewritePrologue(LirNode node,
BiList post)
Rewrite PROLOGUE |
(パッケージプライベート) abstract LirNode |
rewriteTree(LirNode tree,
java.lang.String phase,
BiList pre,
BiList post)
Rewrite L-expression. |
(パッケージプライベート) java.lang.String |
segmentForConst()
Return segment for read-only constant. |
void |
setAsmStream(java.io.OutputStream stream)
Set assembler output stream. |
(パッケージプライベート) abstract java.lang.String |
showLabel(LirNode t)
Return label state |
(パッケージプライベート) abstract int |
startNT()
Return start nonterminal symbol. |
クラス java.lang.Object から継承したメソッド |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
フィールドの詳細 |
static final int I64
static final int I32
static final int I16
static final int I8
static final int F128
static final int F64
static final int F32
Root root
Module module
java.io.PrintWriter debOut
MachineParams machineParams
int addrType
int typeParamWord
java.lang.String machineName
java.lang.String convention
java.util.Map funcAttrTbl
boolean optSpeed
Function func
LirFactory lir
java.io.PrintWriter asmWriter
NumberSet disableRewrite
final LocalTransformer localEarlyRewritingTrig
final LocalTransformer localLateRewritingTrig
final LocalTransformer ProcessFramesTrig
static final int INLINECOPYUNIT
CodeGenerator.LexpToString lexpConv
コンストラクタの詳細 |
public CodeGenerator()
メソッドの詳細 |
public void initialize(Root root, Module module, TargetMachine target, java.lang.String machine, java.lang.String convention)
public void setAsmStream(java.io.OutputStream stream)
java.io.OutputStream insertPostProcessor(java.io.OutputStream stream)
void notifyEndToPostProcessor()
void initializeMachineDep()
CodeGenerator.FunctionAttr getFunctionAttr(Function func)
LirNode noRescan(LirNode node)
public void prerewrite(Function f, java.lang.String phase)
abstract void initRewriteLabeling()
abstract LirNode rewriteTree(LirNode tree, java.lang.String phase, BiList pre, BiList post)
public Transformer[] earlyRewritingSequence()
public Transformer[] lateRewritingSequence()
int frameSize(Function f)
boolean frameIsEmpty(Function f)
LirNode dropRegToFrame(LirNode node)
Symbol mapRegToFrame(Symbol reg)
SymAuto reserveFrame(java.lang.String name, int type)
LirNode rewriteAggregateCopy(LirNode node, BiList pre)
int paramToBeSaved()
int paramOffset(LirNode arg)
boolean equalArg(LirNode x, LirNode y)
LirNode rewritePrologue(LirNode node, BiList post)
LirNode rewriteEpilogue(LirNode node, BiList pre)
boolean isComplex(LirNode node)
LirNode phyReg(java.lang.String name)
LirNode rewriteCall(LirNode node, BiList pre, BiList post)
int clcvnRegLimit()
LirNode clcvnParamWord(int type, int location, boolean caller)
LirNode clcvnParamReg(int type, int location, boolean caller)
LirNode clcvnParamMem(int type, int location, boolean caller)
void clcvnPassFloatRegMem(int location, LirNode arg, BiLink memp, BiLink regp, BiList alist)
int clcvnParamOffset(int location)
LirNode clcvnReturnValue(int type)
LirNode clcvnSetPartialWord(LirNode lhs, int part, LirNode rhs)
LirNode clcvnPartialWord(LirNode exp, int part)
ImList clcvnClobbers()
boolean clcvnStructReturnAsFirst()
LirNode clcvnStructReturnPtr(boolean caller)
LirNode rewriteJumpn(LirNode node, BiList pre)
LirNode rewriteAsm(LirNode node, BiList pre, BiList post)
int nActualOperands(LirNode node)
public void instructionSelection(Function f)
public void genHeader(Module mod)
public LocalTransformer convToAsm()
public void emitNamedConst(java.lang.String name, LirNode value)
BiList buildCode(Function f)
public void prepareCodeInfo(Function f)
public ImList codeInfo(LirNode ins)
ins
- instruction L-expression tree which are alpready reduced.
java.lang.Object quiltLirDefault(LirNode node)
void peepHoleOpt(BiList list)
void emitCode(BiList asmList, java.io.PrintWriter file)
java.lang.String emitTop(java.lang.Object x)
java.lang.String emitObject(java.lang.Object x)
java.lang.String emitObjectX(java.lang.Object x, boolean top)
top
- true if this is a top-level.java.lang.String emitListDefault(ImList form, boolean topLevel)
java.lang.String emitLirDefault(LirNode node)
public void genTrailer(Module mod)
public void close()
void emitSegment(java.io.PrintWriter file, java.lang.String segment)
segment
.
void printLabel(LirNode t, java.lang.String indent)
t
.
CodeGenerator.Match reduce(LirNode t, int goal) throws NoMatchException
t
with goal nonterminal goal
.
NoMatchException
boolean isSimple(LirNode node)
LirNode rewriteCONVUF(LirNode node, BiList pre)
LirNode rewriteCONVFU(LirNode node, BiList pre)
abstract void initLabeling(LirFactory lir)
abstract java.lang.String showLabel(LirNode t)
abstract void labelTree(LirNode t)
abstract Rule getRule(LirNode t, int goal)
abstract int getCost1(LirNode t, int goal)
abstract int getCost2(LirNode t, int goal)
abstract int startNT()
abstract java.lang.String defaultRegsetForType(int type)
abstract java.lang.String emitList(ImList form, boolean topLevel)
abstract java.lang.String emitLir(LirNode node)
abstract java.lang.Object expandBuildMacro(ImList form)
abstract java.lang.Object quiltLir(LirNode node)
LirNode rewriteFrame(LirNode node)
void emitIdent(java.io.PrintWriter out, java.lang.String ident)
void emitComment(java.io.PrintWriter out, java.lang.String comment)
void emitBeginningOfModule(Module mod, java.io.PrintWriter out)
void emitEndOfModule(Module mod, java.io.PrintWriter out)
void emitBeginningOfSegment(java.io.PrintWriter out, java.lang.String segment)
void emitEndOfSegment(java.io.PrintWriter out, java.lang.String segment)
void emitLinkage(java.io.PrintWriter out, SymStatic symbol)
void emitDataLabel(java.io.PrintWriter out, java.lang.String label)
void emitCodeLabel(java.io.PrintWriter out, java.lang.String label)
void emitAlign(java.io.PrintWriter out, int align)
void emitCommon(java.io.PrintWriter out, SymStatic symbol, int bytes)
void emitZeros(java.io.PrintWriter out, int bytes)
java.lang.String emitAsmCode(java.lang.String format, ImList args)
void emitData(java.io.PrintWriter out, int type, LirNode node)
CodeGenerator.FunctionAttr newFunctionAttr(Function f)
public int alignForType(int type)
java.lang.String segmentForConst()
java.lang.String makeAsmSymbol(java.lang.String symbol)
java.lang.String makeLabelDef(java.lang.String label)
public MachineParams getMachineParams()
|
||||||||||
前のクラス 次のクラス | フレームあり フレームなし | |||||||||
概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |