public abstract class ConvertToLowLevelIR extends IRTools
Modifier and Type | Field and Description |
---|---|
private static BranchOptimizations |
branchOpts |
static boolean |
LOWER_ARRAY_ACCESS
We have slightly different ideas of what the LIR should look like
for IA32 and PowerPC.
|
Constructor and Description |
---|
ConvertToLowLevelIR() |
Modifier and Type | Method and Description |
---|---|
private static BasicBlock |
_lookupswitchHelper(Instruction switchInstr,
RegisterOperand reg,
BasicBlock defaultBB,
IR ir,
BasicBlock curBlock,
int low,
int high,
int min,
int max)
Helper function to generate the binary search tree for
a lookupswitch bytecode
|
(package private) static Instruction |
callHelper(Instruction v,
IR ir)
Helper method for call expansion.
|
(package private) static void |
convert(IR ir,
OptOptions options)
Converts the given HIR to LIR.
|
static void |
doArrayLoad(Instruction s,
IR ir,
Operator op,
int logwidth)
Expand an array load.
|
static void |
doArrayStore(Instruction s,
IR ir,
Operator op,
int logwidth)
Expand an array store.
|
static void |
expandSysCallTarget(Instruction s,
IR ir)
Expand symbolic SysCall target into a chain of loads from the bootrecord to
the desired target address.
|
static RegisterOperand |
getField(Instruction s,
IR ir,
RegisterOperand obj,
RVMField field) |
(package private) static RegisterOperand |
getField(Instruction s,
IR ir,
RegisterOperand obj,
RVMField field,
Operand guard) |
(package private) static RegisterOperand |
getInstanceMethod(Instruction s,
IR ir,
Operand tib,
RVMMethod method) |
(package private) static RegisterOperand |
getSpecialMethod(Instruction s,
IR ir,
int smid) |
static RegisterOperand |
getStatic(Instruction s,
IR ir,
RVMField field) |
(package private) static Operand |
getTIB(Instruction s,
IR ir,
Operand obj,
Operand guard) |
(package private) static Operand |
getTIB(Instruction s,
IR ir,
RVMType type) |
(package private) static Operand |
getTIB(Instruction s,
IR ir,
TypeOperand type) |
static RegisterOperand |
insertBinary(Instruction s,
IR ir,
Operator operator,
TypeReference type,
Operand o1,
Operand o2)
Insert a binary instruction before s in the instruction stream.
|
(package private) static RegisterOperand |
InsertGuardedUnary(Instruction s,
IR ir,
Operator operator,
TypeReference type,
Operand o1,
Operand guard)
Insert a guarded unary instruction before s in the instruction stream.
|
(package private) static RegisterOperand |
InsertLoadOffset(Instruction s,
IR ir,
Operator operator,
TypeReference type,
Operand reg2,
Offset offset)
Insert a load off before s in the instruction stream.
|
(package private) static RegisterOperand |
InsertLoadOffset(Instruction s,
IR ir,
Operator operator,
TypeReference type,
Operand reg2,
Offset offset,
LocationOperand loc,
Operand guard)
Insert a load off before s in the instruction stream.
|
(package private) static RegisterOperand |
InsertLoadOffset(Instruction s,
IR ir,
Operator operator,
TypeReference type,
Operand reg2,
Offset offset,
Operand guard)
Insert a load off before s in the instruction stream.
|
(package private) static RegisterOperand |
InsertLoadOffset(Instruction s,
IR ir,
Operator operator,
TypeReference type,
Operand reg2,
Operand offset,
LocationOperand loc,
Operand guard)
Insert a load off before s in the instruction stream.
|
(package private) static RegisterOperand |
InsertLoadOffsetJTOC(Instruction s,
IR ir,
Operator operator,
TypeReference type,
Offset offset)
Insert a load off the JTOC before s in the instruction stream.
|
(package private) static RegisterOperand |
InsertLoadOffsetJTOC(Instruction s,
IR ir,
Operator operator,
TypeReference type,
Operand offset)
Insert a load off the JTOC before s in the instruction stream.
|
(package private) static RegisterOperand |
InsertUnary(Instruction s,
IR ir,
Operator operator,
TypeReference type,
Operand o1)
Insert a unary instruction before s in the instruction stream.
|
(package private) static Instruction |
lookup(Instruction switchInstr,
IR ir)
Expand a lookupswitch.
|
private static Instruction |
resolveMember(Instruction s,
IR ir)
Generate the code to resolve a member (field/method) reference.
|
(package private) static Instruction |
tableswitch(Instruction s,
IR ir)
Expand a tableswitch.
|
A, AC, AC, CPOS, CR, D, DC, defDoublesAsUse, definedIn, F, FC, getCondMoveOp, getDefaultOperand, getLoadOp, getLoadOp, getMoveOp, getStoreOp, getStoreOp, I, IC, insertInstructionsAfter, L, LC, makeBlockOnEdge, mayBeVolatileFieldLoad, moveInstruction, moveIntoRegister, moveIntoRegister, nonPEIGC, offsetOperand, TG, usedIn, useDoublesAsDef
public static final boolean LOWER_ARRAY_ACCESS
private static BranchOptimizations branchOpts
public ConvertToLowLevelIR()
static void convert(IR ir, OptOptions options)
ir
- IR to convertoptions
- the options for the conversionstatic Instruction tableswitch(Instruction s, IR ir)
s
- the instruction to expandir
- the containing IRstatic Instruction lookup(Instruction switchInstr, IR ir)
switchInstr
- The instruction to expandir
- The containing IRInstruction
after the generated LIR sequence.private static BasicBlock _lookupswitchHelper(Instruction switchInstr, RegisterOperand reg, BasicBlock defaultBB, IR ir, BasicBlock curBlock, int low, int high, int min, int max)
switchInstr
- the lookupswitch instructiondefaultBB
- the basic block of the default caseir
- the ir objectcurBlock
- the basic block to insert instructions intoreg
- the RegisterOperand that contains the valued being switched onlow
- the low index of cases (operands of switchInstr)high
- the high index of cases (operands of switchInstr)min
- minimum for the current casemax
- maximum for the current casepublic static void doArrayLoad(Instruction s, IR ir, Operator op, int logwidth)
s
- the instruction to expandir
- the containing IRop
- the load operator to uselogwidth
- the log base 2 of the element type's sizepublic static void doArrayStore(Instruction s, IR ir, Operator op, int logwidth)
s
- the instruction to expandir
- the containing IRop
- the store operator to uselogwidth
- the log base 2 of the element type's sizestatic Instruction callHelper(Instruction v, IR ir)
v
- the call instructionir
- the containing IRprivate static Instruction resolveMember(Instruction s, IR ir)
s
- the RESOLVE_MEMBER instruction to expandir
- the containing ir objectpublic static RegisterOperand insertBinary(Instruction s, IR ir, Operator operator, TypeReference type, Operand o1, Operand o2)
s
- the instruction to insert beforeir
- the containing IRoperator
- the operator to inserttype
- the type of the resulto1
- the first operando2
- the second operandstatic RegisterOperand InsertUnary(Instruction s, IR ir, Operator operator, TypeReference type, Operand o1)
s
- the instruction to insert beforeir
- the containing IRoperator
- the operator to inserttype
- the type of the resulto1
- the operandstatic RegisterOperand InsertGuardedUnary(Instruction s, IR ir, Operator operator, TypeReference type, Operand o1, Operand guard)
s
- the instruction to insert beforeir
- the containing IRoperator
- the operator to inserttype
- the type of the resulto1
- the operandguard
- the guard operandstatic RegisterOperand InsertLoadOffsetJTOC(Instruction s, IR ir, Operator operator, TypeReference type, Offset offset)
s
- the instruction to insert beforeir
- the containing IRoperator
- the operator to inserttype
- the type of the resultoffset
- the offset to load atstatic RegisterOperand InsertLoadOffsetJTOC(Instruction s, IR ir, Operator operator, TypeReference type, Operand offset)
s
- the instruction to insert beforeir
- the containing IRoperator
- the operator to inserttype
- the type of the resultoffset
- the offset to load atstatic RegisterOperand InsertLoadOffset(Instruction s, IR ir, Operator operator, TypeReference type, Operand reg2, Offset offset)
s
- the instruction to insert beforeir
- the containing IRoperator
- the operator to inserttype
- the type of the resultreg2
- the base to load fromoffset
- the offset to load atstatic RegisterOperand InsertLoadOffset(Instruction s, IR ir, Operator operator, TypeReference type, Operand reg2, Offset offset, Operand guard)
s
- the instruction to insert beforeir
- the containing IRoperator
- the operator to inserttype
- the type of the resultreg2
- the base to load fromoffset
- the offset to load atguard
- the guard operandstatic RegisterOperand InsertLoadOffset(Instruction s, IR ir, Operator operator, TypeReference type, Operand reg2, Offset offset, LocationOperand loc, Operand guard)
s
- the instruction to insert beforeir
- the containing IRoperator
- the operator to inserttype
- the type of the resultreg2
- the base to load fromoffset
- the offset to load atloc
- the location operandguard
- the guard operandstatic RegisterOperand InsertLoadOffset(Instruction s, IR ir, Operator operator, TypeReference type, Operand reg2, Operand offset, LocationOperand loc, Operand guard)
s
- the instruction to insert beforeir
- the containing IRoperator
- the operator to inserttype
- the type of the resultreg2
- the base to load fromoffset
- the offset to load atloc
- the location operandguard
- the guard operandstatic Operand getTIB(Instruction s, IR ir, RVMType type)
static Operand getTIB(Instruction s, IR ir, TypeOperand type)
static RegisterOperand getInstanceMethod(Instruction s, IR ir, Operand tib, RVMMethod method)
public static RegisterOperand getField(Instruction s, IR ir, RegisterOperand obj, RVMField field)
static RegisterOperand getField(Instruction s, IR ir, RegisterOperand obj, RVMField field, Operand guard)
static RegisterOperand getSpecialMethod(Instruction s, IR ir, int smid)
public static void expandSysCallTarget(Instruction s, IR ir)
s
- the call instructionir
- the governing IRpublic static RegisterOperand getStatic(Instruction s, IR ir, RVMField field)