public final class BaselineCompilerImpl extends BaselineCompiler
Modifier and Type | Class and Description |
---|---|
private static class |
BaselineCompilerImpl.UnreachableBytecodeException
Have we encountered a bytecode without valid stack heights?
|
TemplateCompilerFramework.BranchCondition, TemplateCompilerFramework.MachineCode
Modifier and Type | Field and Description |
---|---|
private Assembler |
asm |
private Offset |
firstLocalOffset |
(package private) static Offset |
FIVE_SLOTS |
(package private) static Offset |
FOUR_SLOTS |
private static Offset |
MINUS_ONE_SLOT |
(package private) static Offset |
NO_SLOT |
(package private) static Offset |
ONE_SLOT |
private int |
parameterWords |
(package private) static Offset |
THREE_SLOTS |
(package private) static Offset |
TWO_SLOTS |
edgeCounterIdx, localTypes, options
bcodes, biStart, bytecodeMap, compiledMethod, doesCheckStore, isInterruptible, isUninterruptible, isUnpreemptible, klass, lockOffset, method, shouldPrint, stackHeights
Constructor and Description |
---|
BaselineCompilerImpl(BaselineCompiledMethod cm,
short[] localFixedLocations,
short[] localFloatLocations)
Create a BaselineCompilerImpl object for the compilation of method.
|
Modifier and Type | Method and Description |
---|---|
private void |
adjustStack(int size,
boolean mayClobber)
Adjust the value of ESP/RSP
|
private void |
boundsCheckHelper(Offset index,
Offset arrayRef)
Private helper to perform an array bounds check
|
protected void |
emit_aaload()
Emit code to load from a reference array
|
protected void |
emit_aastore()
Emit code to store to a reference array
|
protected void |
emit_aconst_null()
Emit code to load the null constant.
|
protected void |
emit_aload_resolved_getfield(int index,
FieldReference fieldRef)
Emits code to load a reference local variable and then perform a field load
|
protected void |
emit_areturn()
Emit code to implement the areturn bytecode
|
protected void |
emit_arraylength()
Emit code to implement the arraylength bytecode
|
protected void |
emit_astore(int index)
Emit code to store a reference to a local variable
|
protected void |
emit_athrow()
Emit code to implement the athrow bytecode
|
protected void |
emit_baload()
Emit code to load from a byte/boolean array
|
protected void |
emit_bastore()
Emit code to store to a byte/boolean array
|
protected void |
emit_caload()
Emit code to load from a char array
|
protected void |
emit_castore()
Emit code to store to a char array
|
protected void |
emit_checkcast_final(RVMType type)
Emit code to implement the checkcast bytecode
|
protected void |
emit_checkcast_resolvedClass(RVMClass type)
Emit code to implement the checkcast bytecode
|
protected void |
emit_checkcast_resolvedInterface(RVMClass type)
Emit code to implement the checkcast bytecode
|
protected void |
emit_checkcast(TypeReference typeRef)
Emit code to implement the checkcast bytecode
|
protected void |
emit_d2f()
Emit code to implement the d2f bytecode
|
protected void |
emit_d2i()
Emit code to implement the d2i bytecode
|
protected void |
emit_d2l()
Emit code to implement the d2l bytecode
|
protected void |
emit_dadd()
Emit code to implement the dadd bytecode
|
protected void |
emit_daload()
Emit code to load from a double array
|
protected void |
emit_dastore()
Emit code to store to a double array
|
protected void |
emit_dconst_0()
Emit code to load 0.0d
|
protected void |
emit_dconst_1()
Emit code to load 1.0d
|
protected void |
emit_ddiv()
Emit code to implement the ddiv bytecode
|
protected void |
emit_deferred_prologue()
Emit deferred prologue
|
protected void |
emit_DFcmpGL_if(boolean single,
boolean unorderedGT,
int bTarget,
TemplateCompilerFramework.BranchCondition bc)
Emits code to perform an [df]cmp[gl] followed by ifeq
By default, this method emits code for [df]cmp[gl] and then for ifeq.
|
protected void |
emit_dload(int index)
Emit code to load a double local variable
|
protected void |
emit_dmul()
Emit code to implement the dmul bytecode
|
protected void |
emit_dneg()
Emit code to implement the dneg bytecode
|
protected void |
emit_drem()
Emit code to implement the drem bytecode
|
protected void |
emit_dreturn()
Emit code to implement the dreturn bytecode
|
protected void |
emit_dstore(int index)
Emit code to store an double to a local variable
|
protected void |
emit_dsub()
Emit code to implement the dsub bytecode
|
protected void |
emit_dup_x1()
Emit code to implement the dup_x1 bytecode
|
protected void |
emit_dup_x2()
Emit code to implement the dup_x2 bytecode
|
protected void |
emit_dup()
Emit code to implement the dup bytecode
|
protected void |
emit_dup2_x1()
Emit code to implement the dup2_x1 bytecode
|
protected void |
emit_dup2_x2()
Emit code to implement the dup2_x2 bytecode
|
protected void |
emit_dup2()
Emit code to implement the dup2 bytecode
|
protected void |
emit_f2d()
Emit code to implement the f2d bytecode
|
protected void |
emit_f2i()
Emit code to implement the f2i bytecode
|
protected void |
emit_f2l()
Emit code to implement the f2l bytecode
|
protected void |
emit_fadd()
Emit code to implement the fadd bytecode
|
protected void |
emit_faload()
Emit code to load from a float array
|
protected void |
emit_fastore()
Emit code to store to a float array
|
protected void |
emit_fconst_0()
Emit code to load 0.0f
|
protected void |
emit_fconst_1()
Emit code to load 1.0f
|
protected void |
emit_fconst_2()
Emit code to load 2.0f
|
protected void |
emit_fdiv()
Emit code to implement the fdiv bytecode
|
protected void |
emit_fload(int index)
Emit code to local a float local variable
|
protected void |
emit_fmul()
Emit code to implement the fmul bytecode
|
protected void |
emit_fneg()
Emit code to implement the fneg bytecode
|
protected void |
emit_frem()
Emit code to implement the frem bytecode
|
protected void |
emit_freturn()
Emit code to implement the freturn bytecode
|
protected void |
emit_fstore(int index)
Emit code to store a float to a local variable
|
protected void |
emit_fsub()
Emit code to implement the fsub bytecode
|
protected void |
emit_goto(int bTarget)
Emit code to implement the goto and gotow bytecodes
|
protected void |
emit_i2b()
Emit code to implement the i2b bytecode
|
protected void |
emit_i2c()
Emit code to implement the i2c bytecode
|
protected void |
emit_i2d()
Emit code to implement the i2d bytecode
|
protected void |
emit_i2f()
Emit code to implement the i2f bytecode
|
protected void |
emit_i2l()
Emit code to implement the i2l bytecode
|
protected void |
emit_i2s()
Emit code to implement the i2s bytecode
|
protected void |
emit_iadd()
Emit code to implement the iadd bytecode
|
protected void |
emit_iaload()
Emit code to load from an int array
|
protected void |
emit_iand()
Emit code to implement the iand bytecode
|
protected void |
emit_iastore()
Emit code to store to an int array
|
protected void |
emit_iconst(int val)
Emit code to load an int constant.
|
protected void |
emit_idiv()
Emit code to implement the idiv bytecode
|
protected void |
emit_if_acmpeq(int bTarget)
Emit code to implement the if_acmpeq bytecode
|
protected void |
emit_if_acmpne(int bTarget)
Emit code to implement the if_acmpne bytecode
|
protected void |
emit_if_icmp(int bTarget,
TemplateCompilerFramework.BranchCondition bc)
Emits code to implement the if_icmp.. bytecode
|
protected void |
emit_if(int bTarget,
TemplateCompilerFramework.BranchCondition bc)
Emits code to implement the if.. bytecode
|
protected void |
emit_ifnonnull(int bTarget)
Emit code to implement the ifnonnull bytecode
|
protected void |
emit_ifnull(int bTarget)
Emit code to implement the ifnull bytecode
|
protected void |
emit_iinc(int index,
int val)
Emit code to implement the iinc bytecode
|
protected void |
emit_iload_caload(int index)
Emits code to load an int local variable and then load from a character array
|
protected void |
emit_imul()
Emit code to implement the imul bytecode
|
protected void |
emit_ineg()
Emit code to implement the ineg bytecode
|
protected void |
emit_instanceof_final(RVMType type)
Emit code to implement the instanceof bytecode
|
protected void |
emit_instanceof_resolvedClass(RVMClass type)
Emit code to implement the instanceof bytecode
|
protected void |
emit_instanceof_resolvedInterface(RVMClass type)
Emit code to implement the instanceof bytecode
|
protected void |
emit_instanceof(TypeReference typeRef)
Emit code to implement the instanceof bytecode
|
protected void |
emit_invoke_compiledmethod(CompiledMethod cm)
OSR routine to emit code to invoke a compiled method (with known jtoc
offset).
|
protected void |
emit_invokeinterface(MethodReference methodRef)
Emit code to implement the invokeinterface bytecode
|
protected void |
emit_ior()
Emit code to implement the ior bytecode
|
protected void |
emit_irem()
Emit code to implement the irem bytecode
|
protected void |
emit_ireturn()
Emit code to implement the ireturn bytecode
|
protected void |
emit_ishl()
Emit code to implement the ishl bytecode
|
protected void |
emit_ishr()
Emit code to implement the ishr bytecode
|
protected void |
emit_istore(int index)
Emit code to store an int to a local variable
|
protected void |
emit_isub()
Emit code to implement the isub bytecode
|
protected void |
emit_iushr()
Emit code to implement the iushr bytecode
|
protected void |
emit_ixor()
Emit code to implement the ixor bytecode
|
protected void |
emit_jsr(int bTarget)
Emit code to implement the jsr and jsrw bytecode
|
protected void |
emit_l2d()
Emit code to implement the l2d bytecode
|
protected void |
emit_l2f()
Emit code to implement the l2f bytecode
|
protected void |
emit_l2i()
Emit code to implement the l2i bytecode
|
protected void |
emit_ladd()
Emit code to implement the ladd bytecode
|
protected void |
emit_laload()
Emit code to load from a long array
|
protected void |
emit_land()
Emit code to implement the land bytecode
|
protected void |
emit_lastore()
Emit code to store to a long array
|
protected void |
emit_lcmp_if(int bTarget,
TemplateCompilerFramework.BranchCondition bc)
Emits code to perform an lcmp followed by ifeq.
|
protected void |
emit_lconst(int val)
Emit code to load a long constant
|
protected void |
emit_ldc(Offset offset,
byte type)
Emit code to load a 32 bit constant
|
protected void |
emit_ldc2(Offset offset,
byte type)
Emit code to load a 64 bit constant
|
protected void |
emit_ldiv()
Emit code to implement the ldiv bytecode
|
protected void |
emit_lload(int index)
Emit code to load a long local variable
|
protected void |
emit_lmul()
Emit code to implement the lmul bytecode
|
protected void |
emit_lneg()
Emit code to implement the lneg bytecode
|
protected void |
emit_loadretaddrconst(int bcIndex)
Implementation for OSR load return address bytecode
|
protected void |
emit_lookupswitch(int defaultval,
int npairs)
Emit code to implement the lookupswitch bytecode.
|
protected void |
emit_lor()
Emit code to implement the lor bytecode
|
protected void |
emit_lrem()
Emit code to implement the lrem bytecode
|
protected void |
emit_lreturn()
Emit code to implement the lreturn bytecode
|
protected void |
emit_lshl()
Emit code to implement the lshsl bytecode
|
protected void |
emit_lshr()
Emit code to implement the lshr bytecode
|
protected void |
emit_lstore(int index)
Emit code to store a long to a local variable
|
protected void |
emit_lsub()
Emit code to implement the lsub bytecode
|
protected void |
emit_lushr()
Emit code to implement the lushr bytecode
|
protected void |
emit_lxor()
Emit code to implement the lxor bytecode
|
protected boolean |
emit_Magic(MethodReference magicMethod)
Emits the code to implement the spcified magic.
|
protected void |
emit_monitorenter()
Emit code to implement the monitorenter bytecode
|
protected void |
emit_monitorexit()
Emit code to implement the monitorexit bytecode
|
protected void |
emit_multianewarray(TypeReference typeRef,
int dimensions)
Emit code to allocate a multi-dimensional array
|
protected ForwardReference |
emit_pending_goto(int bTarget)
Generate branch for pending goto OSR mechanism
|
protected void |
emit_pop()
Emit code to implement the pop bytecode
|
protected void |
emit_pop2()
Emit code to implement the pop2 bytecode
|
protected void |
emit_prologue()
Emit the prologue for the method
|
protected void |
emit_regular_aload(int index)
Emits code to load a reference local variable
|
protected void |
emit_regular_DFcmpGL(boolean single,
boolean unorderedGT)
Emits code to implement the [df]cmp[gl] bytecodes
|
protected void |
emit_regular_iload(int index)
Emits code to load an int local variable
|
protected void |
emit_regular_lcmp()
Emits code to implement the lcmp bytecode
|
protected void |
emit_resolved_getfield(FieldReference fieldRef)
Emit code to implement a getfield
|
protected void |
emit_resolved_getstatic(FieldReference fieldRef)
Emit code to implement a getstatic
|
protected void |
emit_resolved_invokespecial(MethodReference methodRef,
RVMMethod target)
Emit code to implement a dynamically linked invokespecial
|
protected void |
emit_resolved_invokestatic(MethodReference methodRef)
Emit code to implement invokestatic
|
protected void |
emit_resolved_invokevirtual(MethodReference methodRef)
Emit code to implement invokevirtual
|
protected void |
emit_resolved_new(RVMClass typeRef)
Emit code to allocate a scalar object
|
protected void |
emit_resolved_newarray(RVMArray array)
Emit code to allocate an array
|
protected void |
emit_resolved_putfield(FieldReference fieldRef)
Emit code to implement a putfield
|
protected void |
emit_resolved_putstatic(FieldReference fieldRef)
Emit code to implement a putstatic
|
protected void |
emit_ret(int index)
Emit code to implement the ret bytecode
|
protected void |
emit_return()
Emit code to implement the return bytecode
|
protected void |
emit_saload()
Emit code to load from a short array
|
protected void |
emit_sastore()
Emit code to store to a short array
|
protected void |
emit_swap()
Emit code to implement the swap bytecode
|
protected void |
emit_tableswitch(int defaultval,
int low,
int high)
Emit code to implement the tableswitch bytecode
|
protected void |
emit_threadSwitchTest(int whereFrom)
Emit the code for a threadswitch tests (aka a yieldpoint).
|
protected void |
emit_unresolved_getfield(FieldReference fieldRef)
Emit code to implement a dynamically linked getfield
|
protected void |
emit_unresolved_getstatic(FieldReference fieldRef)
Emit code to implement a dynamically linked getstatic
|
protected void |
emit_unresolved_invokespecial(MethodReference methodRef)
Emit code to implement invokespecial
|
protected void |
emit_unresolved_invokestatic(MethodReference methodRef)
Emit code to implement a dynamically linked invokestatic
|
protected void |
emit_unresolved_invokevirtual(MethodReference methodRef)
Emit code to implement a dynamically linked invokevirtual
|
protected void |
emit_unresolved_new(TypeReference typeRef)
Emit code to dynamically link and allocate a scalar object
|
protected void |
emit_unresolved_newarray(TypeReference tRef)
Emit code to dynamically link the element class and allocate an array
|
protected void |
emit_unresolved_putfield(FieldReference fieldRef)
Emit code to implement a dynamically linked putfield
|
protected void |
emit_unresolved_putstatic(FieldReference fieldRef)
Emit code to implement a dynamically linked putstatic
|
(package private) static void |
emitDynamicLinkingSequence(Assembler asm,
RegisterConstants.GPR reg,
MemberReference ref,
boolean couldBeZero)
Emit dynamic linking sequence placing the offset of the given member in reg
|
private Offset |
fp2spOffset(Offset offset)
Translates a FP offset into an SP offset
assuming ESP is still positioned as it was at the
start of the current bytecode (biStart).
|
(package private) static void |
genBoundsCheck(Assembler asm,
RegisterConstants.GPR indexReg,
RegisterConstants.GPR arrayRefReg)
Generate an array bounds check trapping if the array bound check fails,
otherwise falling through.
|
private void |
genCondBranch(byte cond,
int bTarget)
Emits a conditional branch on the given condition and bytecode target.
|
private void |
genEpilogue(int returnSize,
int bytesPopped)
Generate method epilogue, releasing values from stack and returning
|
private boolean |
genMagic(MethodReference m)
Generate magic method
|
private void |
genMonitorEnter()
Generate instructions to acquire lock on entry to a method
|
private void |
genMonitorExit()
Generate instructions to release lock on exit from a method
|
private static void |
genNullCheck(Assembler asm,
RegisterConstants.GPR objRefReg)
Generate an explicit null check (compare to zero).
|
private void |
genParameterCopy(Offset srcOffset)
Stores parameters into local space of the callee's stackframe.
|
(package private) static void |
genParameterRegisterLoad(Assembler asm,
int params)
Copy parameters from operand stack into registers.
|
protected void |
genParameterRegisterLoad(MethodReference method,
boolean hasThisParam)
Copy parameters from operand stack into registers.
|
private void |
genPrologue() |
private void |
genResultRegisterUnload(MethodReference m)
Pushes return value of method from register to operand stack.
|
private void |
genThreadSwitchTest(int whereFrom) |
protected AbstractAssembler |
getAssembler() |
static short |
getEmptyStackOffset(NormalMethod m) |
private static Offset |
getFirstLocalOffset(NormalMethod method)
This is misnamed.
|
static short |
getFloatLocalLocation(int index,
short[] localloc,
NormalMethod m) |
static short |
getGeneralLocalLocation(int index,
short[] localloc,
NormalMethod m) |
byte |
getLastFixedStackRegister() |
byte |
getLastFloatStackRegister() |
private static Offset |
getStartLocalOffset(NormalMethod method) |
private void |
incEdgeCounter(RegisterConstants.GPR scratch,
RegisterConstants.GPR idx,
int counterIdx)
Generate code to increment edge counter
|
protected void |
initializeCompiler() |
private Offset |
localOffset(int local) |
static int |
locationToOffset(short location) |
private byte |
mapCondition(TemplateCompilerFramework.BranchCondition bc) |
static short |
offsetToLocation(int offset) |
static short |
offsetToLocation(Offset offset) |
private void |
primitiveArrayStoreHelper(int size)
Generates a primitive array store for the given size.
|
private static void |
stackMoveHelper(Assembler asm,
RegisterConstants.GPR dest,
Offset off)
Move a value from the stack into a register using the shortest encoding and
the appropriate width for 32/64
|
private void |
stackMoveHelper(RegisterConstants.GPR dest,
Offset off)
Move a value from the stack into a register using the shortest encoding and
the appropriate width for 32/64
|
protected void |
starting_bytecode()
Nothing to do on IA32.
|
checkForActualCall, compile, compile, emit_aload, emit_DFcmpGL, emit_iload, emit_lcmp, fullyBootedVM, generateBaselineCompilerSubsystemReport, getCompilerName, getEdgeCounterIndex, getEdgeCounterOffset, initOptions, processCommandLineArg
checkTarget, ending_bytecode, forbiddenBytecode, forbiddenBytecode, genCode, printEndHeader, printMethodMessage, printStartHeader, stackHeightForEmptyBasicBlock
private final int parameterWords
private Offset firstLocalOffset
static final Offset THREE_SLOTS
static final Offset FOUR_SLOTS
static final Offset FIVE_SLOTS
private static final Offset MINUS_ONE_SLOT
public BaselineCompilerImpl(BaselineCompiledMethod cm, short[] localFixedLocations, short[] localFloatLocations)
cm
- the method that will be associated with this compilationlocalFixedLocations
- unused on IA32localFloatLocations
- unused on IA32protected AbstractAssembler getAssembler()
getAssembler
in class TemplateCompilerFramework
protected void initializeCompiler()
initializeCompiler
in class BaselineCompiler
public byte getLastFixedStackRegister()
getLastFixedStackRegister
in class BaselineCompiler
public byte getLastFloatStackRegister()
getLastFloatStackRegister
in class BaselineCompiler
public static short getGeneralLocalLocation(int index, short[] localloc, NormalMethod m)
public static short getFloatLocalLocation(int index, short[] localloc, NormalMethod m)
public static int locationToOffset(short location)
public static short offsetToLocation(Offset offset)
public static short offsetToLocation(int offset)
public static short getEmptyStackOffset(NormalMethod m)
private static Offset getFirstLocalOffset(NormalMethod method)
method
- the method in questionprivate static Offset getStartLocalOffset(NormalMethod method)
private void adjustStack(int size, boolean mayClobber)
size
- amount to change ESP/RSP bymayClobber
- can the value in S0 or memory be destroyed?
(i.e. can we use a destructive short push/pop opcode)private void stackMoveHelper(RegisterConstants.GPR dest, Offset off)
dest
- register to load intooff
- offset on stackprivate static void stackMoveHelper(Assembler asm, RegisterConstants.GPR dest, Offset off)
asm
- the assembler instancedest
- register to load intooff
- offset on stackprotected void starting_bytecode()
starting_bytecode
in class TemplateCompilerFramework
protected void emit_prologue()
TemplateCompilerFramework
emit_prologue
in class TemplateCompilerFramework
protected void emit_threadSwitchTest(int whereFrom)
TemplateCompilerFramework
emit_threadSwitchTest
in class TemplateCompilerFramework
whereFrom
- is this thread switch from a PROLOGUE, BACKEDGE, or EPILOGUE?protected boolean emit_Magic(MethodReference magicMethod)
TemplateCompilerFramework
emit_Magic
in class TemplateCompilerFramework
magicMethod
- desired magictrue
if code was emittedprotected void emit_aconst_null()
TemplateCompilerFramework
emit_aconst_null
in class TemplateCompilerFramework
protected void emit_iconst(int val)
TemplateCompilerFramework
emit_iconst
in class TemplateCompilerFramework
val
- the int constant to loadprotected void emit_lconst(int val)
TemplateCompilerFramework
emit_lconst
in class TemplateCompilerFramework
val
- the lower 32 bits of long constant (upper32 are 0).protected void emit_fconst_0()
TemplateCompilerFramework
emit_fconst_0
in class TemplateCompilerFramework
protected void emit_fconst_1()
TemplateCompilerFramework
emit_fconst_1
in class TemplateCompilerFramework
protected void emit_fconst_2()
TemplateCompilerFramework
emit_fconst_2
in class TemplateCompilerFramework
protected void emit_dconst_0()
TemplateCompilerFramework
emit_dconst_0
in class TemplateCompilerFramework
protected void emit_dconst_1()
TemplateCompilerFramework
emit_dconst_1
in class TemplateCompilerFramework
protected void emit_ldc(Offset offset, byte type)
TemplateCompilerFramework
emit_ldc
in class TemplateCompilerFramework
offset
- JTOC offset of the constanttype
- the type of the constantprotected void emit_ldc2(Offset offset, byte type)
TemplateCompilerFramework
emit_ldc2
in class TemplateCompilerFramework
offset
- JTOC offset of the constanttype
- the type of the constantprotected void emit_regular_iload(int index)
BaselineCompiler
emit_regular_iload
in class BaselineCompiler
index
- the local index to loadprotected void emit_fload(int index)
TemplateCompilerFramework
emit_fload
in class TemplateCompilerFramework
index
- the local index to loadprotected void emit_regular_aload(int index)
BaselineCompiler
emit_regular_aload
in class BaselineCompiler
index
- the local index to loadprotected void emit_lload(int index)
TemplateCompilerFramework
emit_lload
in class TemplateCompilerFramework
index
- the local index to loadprotected void emit_dload(int index)
TemplateCompilerFramework
emit_dload
in class TemplateCompilerFramework
index
- the local index to loadprotected void emit_istore(int index)
TemplateCompilerFramework
emit_istore
in class TemplateCompilerFramework
index
- the local index to loadprotected void emit_fstore(int index)
TemplateCompilerFramework
emit_fstore
in class TemplateCompilerFramework
index
- the local index to loadprotected void emit_astore(int index)
TemplateCompilerFramework
emit_astore
in class TemplateCompilerFramework
index
- the local index to loadprotected void emit_lstore(int index)
TemplateCompilerFramework
emit_lstore
in class TemplateCompilerFramework
index
- the local index to loadprotected void emit_dstore(int index)
TemplateCompilerFramework
emit_dstore
in class TemplateCompilerFramework
index
- the local index to loadprotected void emit_iaload()
TemplateCompilerFramework
emit_iaload
in class TemplateCompilerFramework
protected void emit_faload()
TemplateCompilerFramework
emit_faload
in class TemplateCompilerFramework
protected void emit_aaload()
TemplateCompilerFramework
emit_aaload
in class TemplateCompilerFramework
protected void emit_caload()
TemplateCompilerFramework
emit_caload
in class TemplateCompilerFramework
protected void emit_iload_caload(int index)
emit_iload_caload
in class BaselineCompiler
index
- the local index to loadprotected void emit_saload()
TemplateCompilerFramework
emit_saload
in class TemplateCompilerFramework
protected void emit_baload()
TemplateCompilerFramework
emit_baload
in class TemplateCompilerFramework
protected void emit_laload()
TemplateCompilerFramework
emit_laload
in class TemplateCompilerFramework
protected void emit_daload()
TemplateCompilerFramework
emit_daload
in class TemplateCompilerFramework
private void primitiveArrayStoreHelper(int size)
size
- in bytes of the array store to generateprivate void boundsCheckHelper(Offset index, Offset arrayRef)
index
- offset from current SP to the array indexarrayRef
- offset from current SP to the array referenceprotected void emit_iastore()
TemplateCompilerFramework
emit_iastore
in class TemplateCompilerFramework
protected void emit_fastore()
TemplateCompilerFramework
emit_fastore
in class TemplateCompilerFramework
protected void emit_aastore()
TemplateCompilerFramework
emit_aastore
in class TemplateCompilerFramework
protected void emit_castore()
TemplateCompilerFramework
emit_castore
in class TemplateCompilerFramework
protected void emit_sastore()
TemplateCompilerFramework
emit_sastore
in class TemplateCompilerFramework
protected void emit_bastore()
TemplateCompilerFramework
emit_bastore
in class TemplateCompilerFramework
protected void emit_lastore()
TemplateCompilerFramework
emit_lastore
in class TemplateCompilerFramework
protected void emit_dastore()
TemplateCompilerFramework
emit_dastore
in class TemplateCompilerFramework
protected void emit_pop()
TemplateCompilerFramework
emit_pop
in class TemplateCompilerFramework
protected void emit_pop2()
TemplateCompilerFramework
emit_pop2
in class TemplateCompilerFramework
protected void emit_dup()
TemplateCompilerFramework
emit_dup
in class TemplateCompilerFramework
protected void emit_dup_x1()
TemplateCompilerFramework
emit_dup_x1
in class TemplateCompilerFramework
protected void emit_dup_x2()
TemplateCompilerFramework
emit_dup_x2
in class TemplateCompilerFramework
protected void emit_dup2()
TemplateCompilerFramework
emit_dup2
in class TemplateCompilerFramework
protected void emit_dup2_x1()
TemplateCompilerFramework
emit_dup2_x1
in class TemplateCompilerFramework
protected void emit_dup2_x2()
TemplateCompilerFramework
emit_dup2_x2
in class TemplateCompilerFramework
protected void emit_swap()
TemplateCompilerFramework
emit_swap
in class TemplateCompilerFramework
protected void emit_iadd()
TemplateCompilerFramework
emit_iadd
in class TemplateCompilerFramework
protected void emit_isub()
TemplateCompilerFramework
emit_isub
in class TemplateCompilerFramework
protected void emit_imul()
TemplateCompilerFramework
emit_imul
in class TemplateCompilerFramework
protected void emit_idiv()
TemplateCompilerFramework
emit_idiv
in class TemplateCompilerFramework
protected void emit_irem()
TemplateCompilerFramework
emit_irem
in class TemplateCompilerFramework
protected void emit_ineg()
TemplateCompilerFramework
emit_ineg
in class TemplateCompilerFramework
protected void emit_ishl()
TemplateCompilerFramework
emit_ishl
in class TemplateCompilerFramework
protected void emit_ishr()
TemplateCompilerFramework
emit_ishr
in class TemplateCompilerFramework
protected void emit_iushr()
TemplateCompilerFramework
emit_iushr
in class TemplateCompilerFramework
protected void emit_iand()
TemplateCompilerFramework
emit_iand
in class TemplateCompilerFramework
protected void emit_ior()
TemplateCompilerFramework
emit_ior
in class TemplateCompilerFramework
protected void emit_ixor()
TemplateCompilerFramework
emit_ixor
in class TemplateCompilerFramework
protected void emit_iinc(int index, int val)
TemplateCompilerFramework
emit_iinc
in class TemplateCompilerFramework
index
- index of localval
- value to increment it byprotected void emit_ladd()
TemplateCompilerFramework
emit_ladd
in class TemplateCompilerFramework
protected void emit_lsub()
TemplateCompilerFramework
emit_lsub
in class TemplateCompilerFramework
protected void emit_lmul()
TemplateCompilerFramework
emit_lmul
in class TemplateCompilerFramework
protected void emit_ldiv()
TemplateCompilerFramework
emit_ldiv
in class TemplateCompilerFramework
protected void emit_lrem()
TemplateCompilerFramework
emit_lrem
in class TemplateCompilerFramework
protected void emit_lneg()
TemplateCompilerFramework
emit_lneg
in class TemplateCompilerFramework
protected void emit_lshl()
TemplateCompilerFramework
emit_lshl
in class TemplateCompilerFramework
protected void emit_lshr()
TemplateCompilerFramework
emit_lshr
in class TemplateCompilerFramework
protected void emit_lushr()
TemplateCompilerFramework
emit_lushr
in class TemplateCompilerFramework
protected void emit_land()
TemplateCompilerFramework
emit_land
in class TemplateCompilerFramework
protected void emit_lor()
TemplateCompilerFramework
emit_lor
in class TemplateCompilerFramework
protected void emit_lxor()
emit_lxor
in class TemplateCompilerFramework
protected void emit_fadd()
TemplateCompilerFramework
emit_fadd
in class TemplateCompilerFramework
protected void emit_fsub()
TemplateCompilerFramework
emit_fsub
in class TemplateCompilerFramework
protected void emit_fmul()
TemplateCompilerFramework
emit_fmul
in class TemplateCompilerFramework
protected void emit_fdiv()
emit_fdiv
in class TemplateCompilerFramework
protected void emit_frem()
TemplateCompilerFramework
emit_frem
in class TemplateCompilerFramework
protected void emit_fneg()
TemplateCompilerFramework
emit_fneg
in class TemplateCompilerFramework
protected void emit_dadd()
TemplateCompilerFramework
emit_dadd
in class TemplateCompilerFramework
protected void emit_dsub()
TemplateCompilerFramework
emit_dsub
in class TemplateCompilerFramework
protected void emit_dmul()
TemplateCompilerFramework
emit_dmul
in class TemplateCompilerFramework
protected void emit_ddiv()
TemplateCompilerFramework
emit_ddiv
in class TemplateCompilerFramework
protected void emit_drem()
TemplateCompilerFramework
emit_drem
in class TemplateCompilerFramework
protected void emit_dneg()
TemplateCompilerFramework
emit_dneg
in class TemplateCompilerFramework
protected void emit_i2l()
TemplateCompilerFramework
emit_i2l
in class TemplateCompilerFramework
protected void emit_l2i()
TemplateCompilerFramework
emit_l2i
in class TemplateCompilerFramework
protected void emit_i2f()
TemplateCompilerFramework
emit_i2f
in class TemplateCompilerFramework
protected void emit_i2d()
TemplateCompilerFramework
emit_i2d
in class TemplateCompilerFramework
protected void emit_l2f()
TemplateCompilerFramework
emit_l2f
in class TemplateCompilerFramework
protected void emit_l2d()
TemplateCompilerFramework
emit_l2d
in class TemplateCompilerFramework
protected void emit_f2d()
TemplateCompilerFramework
emit_f2d
in class TemplateCompilerFramework
protected void emit_d2f()
TemplateCompilerFramework
emit_d2f
in class TemplateCompilerFramework
protected void emit_f2i()
TemplateCompilerFramework
emit_f2i
in class TemplateCompilerFramework
protected void emit_f2l()
TemplateCompilerFramework
emit_f2l
in class TemplateCompilerFramework
protected void emit_d2i()
TemplateCompilerFramework
emit_d2i
in class TemplateCompilerFramework
protected void emit_d2l()
TemplateCompilerFramework
emit_d2l
in class TemplateCompilerFramework
protected void emit_i2b()
TemplateCompilerFramework
emit_i2b
in class TemplateCompilerFramework
protected void emit_i2c()
TemplateCompilerFramework
emit_i2c
in class TemplateCompilerFramework
protected void emit_i2s()
TemplateCompilerFramework
emit_i2s
in class TemplateCompilerFramework
protected void emit_regular_lcmp()
BaselineCompiler
emit_regular_lcmp
in class BaselineCompiler
protected void emit_regular_DFcmpGL(boolean single, boolean unorderedGT)
BaselineCompiler
emit_regular_DFcmpGL
in class BaselineCompiler
single
- true
for float [f], false
for double [d]unorderedGT
- true
for [g], false
for [l]private byte mapCondition(TemplateCompilerFramework.BranchCondition bc)
bc
- the branch conditionprotected void emit_lcmp_if(int bTarget, TemplateCompilerFramework.BranchCondition bc)
BaselineCompiler
By default, this method emits code for lcmp and then for ifeq. Subclasses that want to implement bytecode merging for this pattern must override this method.
emit_lcmp_if
in class BaselineCompiler
bTarget
- target bytecode of the branchbc
- branch conditionprotected void emit_DFcmpGL_if(boolean single, boolean unorderedGT, int bTarget, TemplateCompilerFramework.BranchCondition bc)
BaselineCompiler
By default, this method emits code for [df]cmp[gl] and then for ifeq. Subclasses that want to implement bytecode merging for this pattern must override this method.
emit_DFcmpGL_if
in class BaselineCompiler
single
- true
for float [f], false
for double [d]unorderedGT
- true
for [g], false
for [l]bTarget
- target bytecode of the branchbc
- branch conditionprotected void emit_if(int bTarget, TemplateCompilerFramework.BranchCondition bc)
TemplateCompilerFramework
emit_if
in class TemplateCompilerFramework
bTarget
- target bytecode of the branchbc
- branch conditionprotected void emit_if_icmp(int bTarget, TemplateCompilerFramework.BranchCondition bc)
TemplateCompilerFramework
emit_if_icmp
in class TemplateCompilerFramework
bTarget
- target bytecode of the branchbc
- branch conditionprotected void emit_if_acmpeq(int bTarget)
TemplateCompilerFramework
emit_if_acmpeq
in class TemplateCompilerFramework
bTarget
- target bytecode of the branchprotected void emit_if_acmpne(int bTarget)
TemplateCompilerFramework
emit_if_acmpne
in class TemplateCompilerFramework
bTarget
- target bytecode of the branchprotected void emit_ifnull(int bTarget)
TemplateCompilerFramework
emit_ifnull
in class TemplateCompilerFramework
bTarget
- target bytecode of the branchprotected void emit_ifnonnull(int bTarget)
TemplateCompilerFramework
emit_ifnonnull
in class TemplateCompilerFramework
bTarget
- target bytecode of the branchprotected void emit_goto(int bTarget)
TemplateCompilerFramework
emit_goto
in class TemplateCompilerFramework
bTarget
- target bytecode of the branchprotected void emit_jsr(int bTarget)
TemplateCompilerFramework
emit_jsr
in class TemplateCompilerFramework
bTarget
- target bytecode of the jsrprotected void emit_ret(int index)
TemplateCompilerFramework
emit_ret
in class TemplateCompilerFramework
index
- local variable containing the return addressprotected void emit_tableswitch(int defaultval, int low, int high)
TemplateCompilerFramework
emit_tableswitch
in class TemplateCompilerFramework
defaultval
- bcIndex of the default targetlow
- low value of switchhigh
- high value of switchprotected void emit_lookupswitch(int defaultval, int npairs)
emit_lookupswitch
in class TemplateCompilerFramework
defaultval
- bcIndex of the default targetnpairs
- number of pairs in the lookup switchprotected void emit_ireturn()
TemplateCompilerFramework
emit_ireturn
in class TemplateCompilerFramework
protected void emit_lreturn()
TemplateCompilerFramework
emit_lreturn
in class TemplateCompilerFramework
protected void emit_freturn()
TemplateCompilerFramework
emit_freturn
in class TemplateCompilerFramework
protected void emit_dreturn()
TemplateCompilerFramework
emit_dreturn
in class TemplateCompilerFramework
protected void emit_areturn()
TemplateCompilerFramework
emit_areturn
in class TemplateCompilerFramework
protected void emit_return()
TemplateCompilerFramework
emit_return
in class TemplateCompilerFramework
protected void emit_unresolved_getstatic(FieldReference fieldRef)
TemplateCompilerFramework
emit_unresolved_getstatic
in class TemplateCompilerFramework
fieldRef
- the referenced fieldprotected void emit_resolved_getstatic(FieldReference fieldRef)
TemplateCompilerFramework
emit_resolved_getstatic
in class TemplateCompilerFramework
fieldRef
- the referenced fieldprotected void emit_unresolved_putstatic(FieldReference fieldRef)
TemplateCompilerFramework
emit_unresolved_putstatic
in class TemplateCompilerFramework
fieldRef
- the referenced fieldprotected void emit_resolved_putstatic(FieldReference fieldRef)
TemplateCompilerFramework
emit_resolved_putstatic
in class TemplateCompilerFramework
fieldRef
- the referenced fieldprotected void emit_unresolved_getfield(FieldReference fieldRef)
TemplateCompilerFramework
emit_unresolved_getfield
in class TemplateCompilerFramework
fieldRef
- the referenced fieldprotected void emit_resolved_getfield(FieldReference fieldRef)
TemplateCompilerFramework
emit_resolved_getfield
in class TemplateCompilerFramework
fieldRef
- the referenced fieldprotected void emit_aload_resolved_getfield(int index, FieldReference fieldRef)
emit_aload_resolved_getfield
in class BaselineCompiler
index
- the local index to loadfieldRef
- the referenced fieldprotected void emit_unresolved_putfield(FieldReference fieldRef)
TemplateCompilerFramework
emit_unresolved_putfield
in class TemplateCompilerFramework
fieldRef
- the referenced fieldprotected void emit_resolved_putfield(FieldReference fieldRef)
TemplateCompilerFramework
emit_resolved_putfield
in class TemplateCompilerFramework
fieldRef
- the referenced fieldprotected void emit_unresolved_invokevirtual(MethodReference methodRef)
TemplateCompilerFramework
emit_unresolved_invokevirtual
in class TemplateCompilerFramework
methodRef
- the referenced methodprotected void emit_resolved_invokevirtual(MethodReference methodRef)
TemplateCompilerFramework
emit_resolved_invokevirtual
in class TemplateCompilerFramework
methodRef
- the referenced methodprotected void emit_resolved_invokespecial(MethodReference methodRef, RVMMethod target)
TemplateCompilerFramework
emit_resolved_invokespecial
in class TemplateCompilerFramework
methodRef
- the referenced methodtarget
- the method to invokeprotected void emit_unresolved_invokespecial(MethodReference methodRef)
TemplateCompilerFramework
emit_unresolved_invokespecial
in class TemplateCompilerFramework
methodRef
- the referenced methodprotected void emit_unresolved_invokestatic(MethodReference methodRef)
TemplateCompilerFramework
emit_unresolved_invokestatic
in class TemplateCompilerFramework
methodRef
- the referenced methodprotected void emit_resolved_invokestatic(MethodReference methodRef)
TemplateCompilerFramework
emit_resolved_invokestatic
in class TemplateCompilerFramework
methodRef
- the referenced methodprotected void emit_invokeinterface(MethodReference methodRef)
TemplateCompilerFramework
emit_invokeinterface
in class TemplateCompilerFramework
methodRef
- the referenced methodprotected void emit_resolved_new(RVMClass typeRef)
TemplateCompilerFramework
emit_resolved_new
in class TemplateCompilerFramework
typeRef
- The RVMClass
to instantiateprotected void emit_unresolved_new(TypeReference typeRef)
TemplateCompilerFramework
emit_unresolved_new
in class TemplateCompilerFramework
typeRef
- TypeReference
to dynamically link & instantiateprotected void emit_resolved_newarray(RVMArray array)
TemplateCompilerFramework
emit_resolved_newarray
in class TemplateCompilerFramework
array
- the RVMArray
to instantiateprotected void emit_unresolved_newarray(TypeReference tRef)
TemplateCompilerFramework
emit_unresolved_newarray
in class TemplateCompilerFramework
tRef
- typeReference to dynamically link & instantiateprotected void emit_multianewarray(TypeReference typeRef, int dimensions)
TemplateCompilerFramework
emit_multianewarray
in class TemplateCompilerFramework
typeRef
- typeReference to dynamically link & instantiatedimensions
- the number of dimensionsprotected void emit_arraylength()
TemplateCompilerFramework
emit_arraylength
in class TemplateCompilerFramework
protected void emit_athrow()
TemplateCompilerFramework
emit_athrow
in class TemplateCompilerFramework
protected void emit_checkcast(TypeReference typeRef)
TemplateCompilerFramework
emit_checkcast
in class TemplateCompilerFramework
typeRef
- the LHS typeprotected void emit_checkcast_resolvedInterface(RVMClass type)
TemplateCompilerFramework
emit_checkcast_resolvedInterface
in class TemplateCompilerFramework
type
- the LHS typeprotected void emit_checkcast_resolvedClass(RVMClass type)
TemplateCompilerFramework
emit_checkcast_resolvedClass
in class TemplateCompilerFramework
type
- the LHS typeprotected void emit_checkcast_final(RVMType type)
TemplateCompilerFramework
emit_checkcast_final
in class TemplateCompilerFramework
type
- the LHS typeprotected void emit_instanceof(TypeReference typeRef)
TemplateCompilerFramework
emit_instanceof
in class TemplateCompilerFramework
typeRef
- the LHS typeprotected void emit_instanceof_resolvedInterface(RVMClass type)
TemplateCompilerFramework
emit_instanceof_resolvedInterface
in class TemplateCompilerFramework
type
- the LHS typeprotected void emit_instanceof_resolvedClass(RVMClass type)
TemplateCompilerFramework
emit_instanceof_resolvedClass
in class TemplateCompilerFramework
type
- the LHS typeprotected void emit_instanceof_final(RVMType type)
TemplateCompilerFramework
emit_instanceof_final
in class TemplateCompilerFramework
type
- the LHS typeprotected void emit_monitorenter()
TemplateCompilerFramework
emit_monitorenter
in class TemplateCompilerFramework
protected void emit_monitorexit()
TemplateCompilerFramework
emit_monitorexit
in class TemplateCompilerFramework
private void genPrologue()
protected void emit_deferred_prologue()
emit_deferred_prologue
in class TemplateCompilerFramework
private void genEpilogue(int returnSize, int bytesPopped)
returnSize
- the size in bytes of the returned valuebytesPopped
- number of paramter bytes already releasedprivate void genMonitorEnter()
private void genMonitorExit()
private static void genNullCheck(Assembler asm, RegisterConstants.GPR objRefReg)
asm
- the assembler to generate intoobjRefReg
- the register containing the referencestatic void genBoundsCheck(Assembler asm, RegisterConstants.GPR indexReg, RegisterConstants.GPR arrayRefReg)
asm
- the assembler to generate intoindexReg
- the register containing the indexarrayRefReg
- the register containing the array referenceprivate void genCondBranch(byte cond, int bTarget)
cond
- condition bytebTarget
- target bytecode indexprivate void incEdgeCounter(RegisterConstants.GPR scratch, RegisterConstants.GPR idx, int counterIdx)
scratch
- register to use as scratchidx
- optional register holding index value or nullcounterIdx
- index in to counters arraystatic void genParameterRegisterLoad(Assembler asm, int params)
asm
- assembler to use for generationparams
- number of parameter words (including "this" if any).protected void genParameterRegisterLoad(MethodReference method, boolean hasThisParam)
method
- is the method to be called.hasThisParam
- is the method virtual?private void genParameterCopy(Offset srcOffset)
Assumption: although some parameters may be passed in registers, space for all parameters is laid out in order on the caller's stackframe.
srcOffset
- offset from frame pointer of first parameter in caller's stackframe.private void genResultRegisterUnload(MethodReference m)
m
- the method whose return value is to be pushedprivate void genThreadSwitchTest(int whereFrom)
whereFrom
- is this thread switch from a PROLOGUE, BACKEDGE, or EPILOGUE?private boolean genMagic(MethodReference m)
m
- method to generateprivate Offset localOffset(int local) throws BaselineCompilerImpl.UnreachableBytecodeException
local
- index of localBaselineCompilerImpl.UnreachableBytecodeException
- when the stack heights information for
the current bytecode is invalid. This can only happen when the bytecode is
unreachable.private Offset fp2spOffset(Offset offset)
offset
- the FP offsetstatic void emitDynamicLinkingSequence(Assembler asm, RegisterConstants.GPR reg, MemberReference ref, boolean couldBeZero)
asm
- assembler to generate code intoreg
- register to hold offset to methodref
- method reference to be resolvedcouldBeZero
- could the value in the offsets table require resolvingprotected void emit_invoke_compiledmethod(CompiledMethod cm)
I have not thought about GCMaps for invoke_compiledmethod.
TODO: Figure out what the above GCMaps comment means and fix it!
emit_invoke_compiledmethod
in class TemplateCompilerFramework
protected void emit_loadretaddrconst(int bcIndex)
emit_loadretaddrconst
in class TemplateCompilerFramework
protected ForwardReference emit_pending_goto(int bTarget)
emit_pending_goto
in class TemplateCompilerFramework
bTarget
- is optional, it emits a JUMP instruction, but the caller
is responsible for patching the target address by calling the resolve method
of the returned forward reference.