|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectCgenSupport
This class aggregates all kinds of support routines and constants for the code generator; all routines are statics, so no instance of this class is even created.
Field Summary | |
(package private) static java.lang.String |
A1
|
(package private) static java.lang.String |
ACC
|
(package private) static java.lang.String |
ADD
|
(package private) static java.lang.String |
ADDI
|
(package private) static java.lang.String |
ADDIU
|
(package private) static java.lang.String |
ADDU
|
(package private) static java.lang.String |
ALIGN
|
private static boolean |
ascii
|
(package private) static java.lang.String |
BEQ
|
(package private) static java.lang.String |
BEQZ
|
(package private) static java.lang.String |
BGT
|
(package private) static java.lang.String |
BLEQ
|
(package private) static java.lang.String |
BLT
|
(package private) static java.lang.String |
BNE
|
(package private) static int |
BOOL_SLOTS
|
(package private) static java.lang.String |
BOOLCONST_PREFIX
|
(package private) static java.lang.String |
BOOLTAG
|
(package private) static java.lang.String |
BRANCH
|
(package private) static java.lang.String |
CLASSINIT_SUFFIX
|
(package private) static java.lang.String |
CLASSNAMETAB
|
(package private) static java.lang.String |
CLASSOBJTAB
|
(package private) static int |
DEFAULT_OBJFIELDS
|
(package private) static java.lang.String |
DISPTAB_SUFFIX
|
(package private) static int |
DISPTABLE_OFFSET
|
(package private) static java.lang.String |
DIV
|
(package private) static int |
EMPTYSLOT
|
(package private) static java.lang.String |
FP
|
(package private) static java.lang.String[] |
gcCollectNames
Runtime constants for controlling the garbage collector. |
(package private) static java.lang.String[] |
gcInitNames
Runtime constants for controlling the garbage collector. |
(package private) static java.lang.String |
GLOBAL
|
(package private) static java.lang.String |
HEAP_START
|
(package private) static int |
INT_SLOTS
|
(package private) static java.lang.String |
INTCONST_PREFIX
|
(package private) static java.lang.String |
INTTAG
|
(package private) static java.lang.String |
JAL
|
(package private) static java.lang.String |
JALR
|
(package private) static java.lang.String |
LA
|
(package private) static java.lang.String |
LABEL
|
(package private) static java.lang.String |
LI
|
(package private) static int |
LOG_WORD_SIZE
|
(package private) static java.lang.String |
LW
|
(package private) static int |
MAXINT
|
(package private) static java.lang.String |
METHOD_SEP
|
(package private) static java.lang.String |
MOVE
|
(package private) static java.lang.String |
MUL
|
(package private) static java.lang.String |
NEG
|
(package private) static java.lang.String |
OBJECTPROTOBJ
|
(package private) static java.lang.String |
PROTOBJ_SUFFIX
|
(package private) static java.lang.String |
RA
|
(package private) static java.lang.String |
RET
|
(package private) static java.lang.String |
SELF
|
(package private) static int |
SIZE_OFFSET
|
(package private) static java.lang.String |
SLL
|
(package private) static java.lang.String |
SP
|
(package private) static java.lang.String |
STRCONST_PREFIX
|
(package private) static int |
STRING_SLOTS
|
(package private) static java.lang.String |
STRINGTAG
|
(package private) static java.lang.String |
SUB
|
(package private) static java.lang.String |
SW
|
(package private) static java.lang.String |
T1
|
(package private) static java.lang.String |
T2
|
(package private) static java.lang.String |
T3
|
(package private) static int |
TAG_OFFSET
|
(package private) static java.lang.String |
WORD
|
(package private) static int |
WORD_SIZE
|
(package private) static java.lang.String |
ZERO
|
Constructor Summary | |
(package private) |
CgenSupport()
|
Method Summary | |
(package private) static void |
asciiMode(java.io.PrintStream s)
Switch output mode to ASCII. |
(package private) static void |
byteMode(java.io.PrintStream s)
Switch output mode to BYTE |
(package private) static void |
emitAdd(java.lang.String dest_reg,
java.lang.String src1,
java.lang.String src2,
java.io.PrintStream s)
Emits an ADD instruction. |
(package private) static void |
emitAddiu(java.lang.String dest_reg,
java.lang.String src,
int imm,
java.io.PrintStream s)
Emits an ADDIU instruction. |
(package private) static void |
emitAddu(java.lang.String dest_reg,
java.lang.String src1,
java.lang.String src2,
java.io.PrintStream s)
Emits an ADDU instruction. |
(package private) static void |
emitBeq(java.lang.String src1,
java.lang.String src2,
int label,
java.io.PrintStream s)
Emits a BEQ instruction. |
(package private) static void |
emitBeqz(java.lang.String src,
int label,
java.io.PrintStream s)
Emits a BEQZ instruction. |
(package private) static void |
emitBgti(java.lang.String src,
int imm,
int label,
java.io.PrintStream s)
Emits a BGTI instruction. |
(package private) static void |
emitBleq(java.lang.String src1,
java.lang.String src2,
int label,
java.io.PrintStream s)
Emits a BLEQ instruction. |
(package private) static void |
emitBlt(java.lang.String src1,
java.lang.String src2,
int label,
java.io.PrintStream s)
Emits a BLT instruction. |
(package private) static void |
emitBlti(java.lang.String src,
int imm,
int label,
java.io.PrintStream s)
Emits a BLTI instruction. |
(package private) static void |
emitBne(java.lang.String src1,
java.lang.String src2,
int label,
java.io.PrintStream s)
Emits a BNE instruction. |
(package private) static void |
emitBranch(int label,
java.io.PrintStream s)
Emits a BRANCH instruction. |
(package private) static void |
emitDispTableRef(AbstractSymbol sym,
java.io.PrintStream s)
Emits a reference to dispatch table. |
(package private) static void |
emitDiv(java.lang.String dest_reg,
java.lang.String src1,
java.lang.String src2,
java.io.PrintStream s)
Emits a DIV instruction. |
(package private) static void |
emitFetchInt(java.lang.String dest,
java.lang.String source,
java.io.PrintStream s)
Emits code to fetch the integer value of the Integer object. |
(package private) static void |
emitGCAssign(java.io.PrintStream s)
Emits a call to gc_assign. |
(package private) static void |
emitGCCheck(java.lang.String source,
java.io.PrintStream s)
Emits code to check the garbage collector |
(package private) static void |
emitInitRef(AbstractSymbol sym,
java.io.PrintStream s)
Emits a reference to class' init() method. |
(package private) static void |
emitJal(java.lang.String dest,
java.io.PrintStream s)
Emits a JAL instruction. |
(package private) static void |
emitJalr(java.lang.String dest_reg,
java.io.PrintStream s)
Emits a JALR instruction. |
(package private) static void |
emitLabelDef(int label,
java.io.PrintStream s)
Emits a definition of a label |
(package private) static void |
emitLabelRef(int label,
java.io.PrintStream s)
Emits a reference to a label |
(package private) static void |
emitLoad(java.lang.String dest_reg,
int offset,
java.lang.String source_reg,
java.io.PrintStream s)
Emits an LW instruction. |
(package private) static void |
emitLoadAddress(java.lang.String dest_reg,
java.lang.String address,
java.io.PrintStream s)
Emits an LA instruction. |
(package private) static void |
emitLoadBool(java.lang.String dest_reg,
BoolConst b,
java.io.PrintStream s)
Emits an instruction to load a boolean constant into a register. |
(package private) static void |
emitLoadImm(java.lang.String dest_reg,
int val,
java.io.PrintStream s)
Emits the LI instruction. |
(package private) static void |
emitLoadInt(java.lang.String dest_reg,
IntSymbol i,
java.io.PrintStream s)
Emits an instruction to load an integer constant into a register. |
(package private) static void |
emitLoadString(java.lang.String dest_reg,
StringSymbol str,
java.io.PrintStream s)
Emits an instruction to load a string constant into a register. |
(package private) static void |
emitMethodRef(AbstractSymbol classname,
AbstractSymbol methodname,
java.io.PrintStream s)
Emits a reference to a method in a class |
(package private) static void |
emitMove(java.lang.String dest_reg,
java.lang.String source_reg,
java.io.PrintStream s)
Emits a MOVE instruction. |
(package private) static void |
emitMul(java.lang.String dest_reg,
java.lang.String src1,
java.lang.String src2,
java.io.PrintStream s)
Emits a MUL instruction. |
(package private) static void |
emitNeg(java.lang.String dest_reg,
java.lang.String source_reg,
java.io.PrintStream s)
Emits a NEG instruction. |
(package private) static void |
emitPartialLoadAddress(java.lang.String dest_reg,
java.io.PrintStream s)
Emits an LA instruction without the address part. |
(package private) static void |
emitProtObjRef(AbstractSymbol sym,
java.io.PrintStream s)
Emits a reference to class' prototype object. |
(package private) static void |
emitPush(java.lang.String reg,
java.io.PrintStream s)
Emit a sequence of instructions to push a register onto stack. |
(package private) static void |
emitReturn(java.io.PrintStream s)
Emits a RET instruction. |
(package private) static void |
emitSll(java.lang.String dest_reg,
java.lang.String src1,
int num,
java.io.PrintStream s)
Emits an SLL instruction. |
(package private) static void |
emitStore(java.lang.String source_reg,
int offset,
java.lang.String dest_reg,
java.io.PrintStream s)
Emits an SW instruction. |
(package private) static void |
emitStoreInt(java.lang.String source,
java.lang.String dest,
java.io.PrintStream s)
Emits code to store the integer value of the Integer object. |
(package private) static void |
emitStringConstant(java.lang.String str,
java.io.PrintStream s)
Emits a string constant. |
(package private) static void |
emitSub(java.lang.String dest_reg,
java.lang.String src1,
java.lang.String src2,
java.io.PrintStream s)
Emits a SUB instruction. |
(package private) static void |
emitTestCollector(java.io.PrintStream s)
Emits code to manipulate garbage collector |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
static final java.lang.String[] gcInitNames
static final java.lang.String[] gcCollectNames
static final int MAXINT
static final int WORD_SIZE
static final int LOG_WORD_SIZE
static final java.lang.String CLASSNAMETAB
static final java.lang.String CLASSOBJTAB
static final java.lang.String INTTAG
static final java.lang.String BOOLTAG
static final java.lang.String STRINGTAG
static final java.lang.String HEAP_START
static final java.lang.String DISPTAB_SUFFIX
static final java.lang.String METHOD_SEP
static final java.lang.String CLASSINIT_SUFFIX
static final java.lang.String PROTOBJ_SUFFIX
static final java.lang.String OBJECTPROTOBJ
static final java.lang.String INTCONST_PREFIX
static final java.lang.String STRCONST_PREFIX
static final java.lang.String BOOLCONST_PREFIX
static final int EMPTYSLOT
static final java.lang.String LABEL
static final int DEFAULT_OBJFIELDS
static final int TAG_OFFSET
static final int SIZE_OFFSET
static final int DISPTABLE_OFFSET
static final int STRING_SLOTS
static final int INT_SLOTS
static final int BOOL_SLOTS
static final java.lang.String GLOBAL
static final java.lang.String ALIGN
static final java.lang.String WORD
static final java.lang.String ZERO
static final java.lang.String ACC
static final java.lang.String A1
static final java.lang.String SELF
static final java.lang.String T1
static final java.lang.String T2
static final java.lang.String T3
static final java.lang.String SP
static final java.lang.String FP
static final java.lang.String RA
static final java.lang.String JALR
static final java.lang.String JAL
static final java.lang.String RET
static final java.lang.String SW
static final java.lang.String LW
static final java.lang.String LI
static final java.lang.String LA
static final java.lang.String MOVE
static final java.lang.String NEG
static final java.lang.String ADD
static final java.lang.String ADDI
static final java.lang.String ADDU
static final java.lang.String ADDIU
static final java.lang.String DIV
static final java.lang.String MUL
static final java.lang.String SUB
static final java.lang.String SLL
static final java.lang.String BEQZ
static final java.lang.String BRANCH
static final java.lang.String BEQ
static final java.lang.String BNE
static final java.lang.String BLEQ
static final java.lang.String BLT
static final java.lang.String BGT
private static boolean ascii
Constructor Detail |
CgenSupport()
Method Detail |
static void emitLoad(java.lang.String dest_reg, int offset, java.lang.String source_reg, java.io.PrintStream s)
dest_reg
- the destination registeroffset
- the word offset from source registersource_reg
- the source registers
- the output streamstatic void emitStore(java.lang.String source_reg, int offset, java.lang.String dest_reg, java.io.PrintStream s)
dest_reg
- the destination registeroffset
- the word offset from source registersource_reg
- the source registers
- the output streamstatic void emitLoadImm(java.lang.String dest_reg, int val, java.io.PrintStream s)
dest_reg
- the destination registerval
- the integer values
- the output streamstatic void emitLoadAddress(java.lang.String dest_reg, java.lang.String address, java.io.PrintStream s)
dest_reg
- the destination registeraddress
- the address from which a word is loadeds
- the output streamstatic void emitPartialLoadAddress(java.lang.String dest_reg, java.io.PrintStream s)
dest_reg
- the destination registers
- the output streamstatic void emitLoadBool(java.lang.String dest_reg, BoolConst b, java.io.PrintStream s)
dest_reg
- the destination registerb
- the boolean constants
- the output streamstatic void emitLoadString(java.lang.String dest_reg, StringSymbol str, java.io.PrintStream s)
dest_reg
- the destination registerstr
- the string constants
- the output streamstatic void emitLoadInt(java.lang.String dest_reg, IntSymbol i, java.io.PrintStream s)
dest_reg
- the destination registeri
- the integer constants
- the output streamstatic void emitMove(java.lang.String dest_reg, java.lang.String source_reg, java.io.PrintStream s)
dest_reg
- the destination registersource_reg
- the source registers
- the output streamstatic void emitNeg(java.lang.String dest_reg, java.lang.String source_reg, java.io.PrintStream s)
dest_reg
- the destination registersource_reg
- the source registers
- the output streamstatic void emitAdd(java.lang.String dest_reg, java.lang.String src1, java.lang.String src2, java.io.PrintStream s)
dest_reg
- the destination registersrc1
- the source register 1src2
- the source register 2s
- the output streamstatic void emitAddu(java.lang.String dest_reg, java.lang.String src1, java.lang.String src2, java.io.PrintStream s)
dest_reg
- the destination registersrc1
- the source register 1src2
- the source register 2s
- the output streamstatic void emitAddiu(java.lang.String dest_reg, java.lang.String src, int imm, java.io.PrintStream s)
dest_reg
- the destination registersrc
- the source registerimm
- the immediates
- the output streamstatic void emitDiv(java.lang.String dest_reg, java.lang.String src1, java.lang.String src2, java.io.PrintStream s)
dest_reg
- the destination registersrc1
- the source register 1src2
- the source register 2s
- the output streamstatic void emitMul(java.lang.String dest_reg, java.lang.String src1, java.lang.String src2, java.io.PrintStream s)
dest_reg
- the destination registersrc1
- the source register 1src2
- the source register 2s
- the output streamstatic void emitSub(java.lang.String dest_reg, java.lang.String src1, java.lang.String src2, java.io.PrintStream s)
dest_reg
- the destination registersrc1
- the source register 1src2
- the source register 2s
- the output streamstatic void emitSll(java.lang.String dest_reg, java.lang.String src1, int num, java.io.PrintStream s)
dest_reg
- the destination registersrc1
- the source register 1num
- the number of bits to shifts
- the output streamstatic void emitJalr(java.lang.String dest_reg, java.io.PrintStream s)
dest_reg
- the register with target addresss
- the output streamstatic void emitJal(java.lang.String dest, java.io.PrintStream s)
dest
- the target address or labels
- the output streamstatic void emitReturn(java.io.PrintStream s)
s
- the output streamstatic void emitGCAssign(java.io.PrintStream s)
s
- the output streamstatic void emitDispTableRef(AbstractSymbol sym, java.io.PrintStream s)
sym
- the name of the classs
- the output streamstatic void emitInitRef(AbstractSymbol sym, java.io.PrintStream s)
sym
- the name of the classs
- the output streamstatic void emitProtObjRef(AbstractSymbol sym, java.io.PrintStream s)
sym
- the name of the classs
- the output streamstatic void emitMethodRef(AbstractSymbol classname, AbstractSymbol methodname, java.io.PrintStream s)
classname
- the name of the classmethodname
- the name of the methods
- the output streamstatic void emitLabelRef(int label, java.io.PrintStream s)
label
- the label numbers
- the output streamstatic void emitLabelDef(int label, java.io.PrintStream s)
label
- the label numbers
- the output streamstatic void emitBeqz(java.lang.String src, int label, java.io.PrintStream s)
src
- the source registerlabel
- the label numbers
- the output streamstatic void emitBeq(java.lang.String src1, java.lang.String src2, int label, java.io.PrintStream s)
src1
- the source register 1src2
- the source register 2label
- the label numbers
- the output streamstatic void emitBne(java.lang.String src1, java.lang.String src2, int label, java.io.PrintStream s)
src1
- the source register 1src2
- the source register 2label
- the label numbers
- the output streamstatic void emitBleq(java.lang.String src1, java.lang.String src2, int label, java.io.PrintStream s)
src1
- the source register 1src2
- the source register 2label
- the label numbers
- the output streamstatic void emitBlt(java.lang.String src1, java.lang.String src2, int label, java.io.PrintStream s)
src1
- the source register 1src2
- the source register 2label
- the label numbers
- the output streamstatic void emitBlti(java.lang.String src, int imm, int label, java.io.PrintStream s)
src
- the source registerimm
- the immediatelabel
- the label numbers
- the output streamstatic void emitBgti(java.lang.String src, int imm, int label, java.io.PrintStream s)
src
- the source registerimm
- the immediatelabel
- the label numbers
- the output streamstatic void emitBranch(int label, java.io.PrintStream s)
label
- the label numbers
- the output streamstatic void emitPush(java.lang.String reg, java.io.PrintStream s)
reg
- the registers
- the output streamstatic void emitFetchInt(java.lang.String dest, java.lang.String source, java.io.PrintStream s)
source
- a pointer to the Integer objectdest
- the destination register for the values
- the output streamstatic void emitStoreInt(java.lang.String source, java.lang.String dest, java.io.PrintStream s)
source
- an integer valuedest
- the pointer to an Integer objects
- the output streamstatic void emitTestCollector(java.io.PrintStream s)
s
- the output streamstatic void emitGCCheck(java.lang.String source, java.io.PrintStream s)
s
- the output streamstatic void asciiMode(java.io.PrintStream s)
s
- the output streamstatic void byteMode(java.io.PrintStream s)
s
- the output streamstatic void emitStringConstant(java.lang.String str, java.io.PrintStream s)
str
- the string constants
- the output stream
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |