org.jikesrvm.compilers.opt.bc2ir
Class GenerationContext

java.lang.Object
  extended by org.jikesrvm.compilers.opt.bc2ir.GenerationContext
All Implemented Interfaces:
OptConstants, Operators

public final class GenerationContext
extends Object
implements OptConstants, Operators

Defines the context in which BC2IR will abstractly interpret a method's bytecodes and populate targetIR with instructions.


Field Summary
private  HashMap<Register,RegisterOperand> _ncGuards
           
private  Register[] addressLocals
           
 boolean allocFrame
          Did BC2IR encounter a magic that requires us to allocate a stack frame?
(package private)  Operand[] arguments
          The parameters which BC2IR should use to seed the local state for the entry basic block.
(package private)  BranchProfiles branchProfiles
          The BranchProfile data for method, if available
 ControlFlowGraph cfg
          The CFG object into which instructions should be generated.
(package private)  boolean doesCheckStore
          Do we do check stores?
private  Register[] doubleLocals
           
(package private)  ExceptionHandlerBasicBlockBag enclosingHandlers
          The enclosing exception handlers (null if there are none).
 BasicBlock epilogue
          The basic block into which BC2IR's caller will generate an epilogue.
 BasicBlock exit
          The exit node of the outermost CFG (used by BC2IR for not-definitely caught athrows and by OSR_Yieldpoints)
private  Register[] floatLocals
           
 boolean generatedExceptionHandlers
          Did BC2IR generate a reachable exception handler while generating the IR for this method
(package private)  InlineOracle inlinePlan
          The InlineOracle to be consulted for all inlining decisions during the generation of this IR.
 InlineSequence inlineSequence
          Inlining context of the method to be generated
private  Register[] intLocals
           
private  Register[] longLocals
           
 NormalMethod method
          The method to be generated
 OptOptions options
          The options to control the generation
(package private)  CompiledMethod original_cm
          The compiled method assigned for this compilation of original_method
(package private)  NormalMethod original_method
          The original method (root of the calling context tree)
 BasicBlock prologue
          The basic block into which BC2IR's caller will generate a "prologue."
 Operand result
          Used to communicate the meet of the return values back to the caller Mainly useful when BC2IR is doing inlining....allows the caller BC2IR object to exploit knowledge the callee BC2IR object had about the result.
(package private)  Register resultReg
          The Register to which BC2IR should assign the return value(s) of the method.
 ArchitectureSpecificOpt.RegisterPool temps
          The register pool to be used during generation
(package private)  BasicBlock unlockAndRethrow
          A catch, unlock, and rethrow exception handler used for synchronized methods.
 
Fields inherited from interface org.jikesrvm.compilers.opt.driver.OptConstants
EPILOGUE_BCI, EPILOGUE_BLOCK_BCI, EXTANT_ANALYSIS_BCI, INSTRUMENTATION_BCI, MAYBE, METHOD_COUNTER_BCI, NO, OSR_PROLOGUE, PROLOGUE_BCI, PROLOGUE_BLOCK_BCI, RECTIFY_BCI, RUNTIME_SERVICES_BCI, SSA_SYNTH_BCI, SYNCHRONIZED_MONITORENTER_BCI, SYNCHRONIZED_MONITOREXIT_BCI, SYNTH_CATCH_BCI, SYNTH_LOOP_VERSIONING_BCI, UNKNOWN_BCI, YES
 
Fields inherited from interface org.jikesrvm.compilers.opt.ir.Operators
ADDR_2INT, ADDR_2INT_opcode, ADDR_2LONG, ADDR_2LONG_opcode, ADDRESS_CONSTANT, ADDRESS_CONSTANT_opcode, ADVISE_ESP, ADVISE_ESP_opcode, ARCH_INDEPENDENT_END_opcode, ARRAYLENGTH, ARRAYLENGTH_opcode, ATHROW, ATHROW_opcode, ATTEMPT_ADDR, ATTEMPT_ADDR_opcode, ATTEMPT_INT, ATTEMPT_INT_opcode, ATTEMPT_LONG, ATTEMPT_LONG_opcode, BBEND, BBEND_opcode, BOOLEAN_CMP_ADDR, BOOLEAN_CMP_ADDR_opcode, BOOLEAN_CMP_DOUBLE, BOOLEAN_CMP_DOUBLE_opcode, BOOLEAN_CMP_FLOAT, BOOLEAN_CMP_FLOAT_opcode, BOOLEAN_CMP_INT, BOOLEAN_CMP_INT_opcode, BOOLEAN_CMP_LONG, BOOLEAN_CMP_LONG_opcode, BOOLEAN_NOT, BOOLEAN_NOT_opcode, BOUNDS_CHECK, BOUNDS_CHECK_opcode, BRANCH_TARGET, BRANCH_TARGET_opcode, BYTE_ALOAD, BYTE_ALOAD_opcode, BYTE_ASTORE, BYTE_ASTORE_opcode, BYTE_LOAD, BYTE_LOAD_opcode, BYTE_STORE, BYTE_STORE_opcode, CALL, CALL_opcode, CALL_SAVE_VOLATILE, CALL_SAVE_VOLATILE_opcode, CHECKCAST, CHECKCAST_NOTNULL, CHECKCAST_NOTNULL_opcode, CHECKCAST_opcode, CHECKCAST_UNRESOLVED, CHECKCAST_UNRESOLVED_opcode, CLEAR_FLOATING_POINT_STATE, CLEAR_FLOATING_POINT_STATE_opcode, CMP_CMOV, CMP_CMOV_opcode, CMP_FCMOV, CMP_FCMOV_opcode, DOUBLE_2FLOAT, DOUBLE_2FLOAT_opcode, DOUBLE_2INT, DOUBLE_2INT_opcode, DOUBLE_2LONG, DOUBLE_2LONG_opcode, DOUBLE_ADD, DOUBLE_ADD_opcode, DOUBLE_ALOAD, DOUBLE_ALOAD_opcode, DOUBLE_AS_LONG_BITS, DOUBLE_AS_LONG_BITS_opcode, DOUBLE_ASTORE, DOUBLE_ASTORE_opcode, DOUBLE_CMPG, DOUBLE_CMPG_opcode, DOUBLE_CMPL, DOUBLE_CMPL_opcode, DOUBLE_COND_MOVE, DOUBLE_COND_MOVE_opcode, DOUBLE_DIV, DOUBLE_DIV_opcode, DOUBLE_IFCMP, DOUBLE_IFCMP_opcode, DOUBLE_LOAD, DOUBLE_LOAD_opcode, DOUBLE_MOVE, DOUBLE_MOVE_opcode, DOUBLE_MUL, DOUBLE_MUL_opcode, DOUBLE_NEG, DOUBLE_NEG_opcode, DOUBLE_REM, DOUBLE_REM_opcode, DOUBLE_SQRT, DOUBLE_SQRT_opcode, DOUBLE_STORE, DOUBLE_STORE_opcode, DOUBLE_SUB, DOUBLE_SUB_opcode, DUMMY_DEF, DUMMY_DEF_opcode, DUMMY_USE, DUMMY_USE_opcode, FCMP_CMOV, FCMP_CMOV_opcode, FCMP_FCMOV, FCMP_FCMOV_opcode, FENCE, FENCE_opcode, FLOAT_2DOUBLE, FLOAT_2DOUBLE_opcode, FLOAT_2INT, FLOAT_2INT_opcode, FLOAT_2LONG, FLOAT_2LONG_opcode, FLOAT_ADD, FLOAT_ADD_opcode, FLOAT_ALOAD, FLOAT_ALOAD_opcode, FLOAT_AS_INT_BITS, FLOAT_AS_INT_BITS_opcode, FLOAT_ASTORE, FLOAT_ASTORE_opcode, FLOAT_CMPG, FLOAT_CMPG_opcode, FLOAT_CMPL, FLOAT_CMPL_opcode, FLOAT_COND_MOVE, FLOAT_COND_MOVE_opcode, FLOAT_DIV, FLOAT_DIV_opcode, FLOAT_IFCMP, FLOAT_IFCMP_opcode, FLOAT_LOAD, FLOAT_LOAD_opcode, FLOAT_MOVE, FLOAT_MOVE_opcode, FLOAT_MUL, FLOAT_MUL_opcode, FLOAT_NEG, FLOAT_NEG_opcode, FLOAT_REM, FLOAT_REM_opcode, FLOAT_SQRT, FLOAT_SQRT_opcode, FLOAT_STORE, FLOAT_STORE_opcode, FLOAT_SUB, FLOAT_SUB_opcode, FP_ADD, FP_ADD_opcode, FP_DIV, FP_DIV_opcode, FP_MUL, FP_MUL_opcode, FP_NEG, FP_NEG_opcode, FP_REM, FP_REM_opcode, FP_SUB, FP_SUB_opcode, GET_ARRAY_ELEMENT_TIB_FROM_TIB, GET_ARRAY_ELEMENT_TIB_FROM_TIB_opcode, GET_CAUGHT_EXCEPTION, GET_CAUGHT_EXCEPTION_opcode, GET_CLASS_TIB, GET_CLASS_TIB_opcode, GET_CURRENT_PROCESSOR, GET_CURRENT_PROCESSOR_opcode, GET_DOES_IMPLEMENT_FROM_TIB, GET_DOES_IMPLEMENT_FROM_TIB_opcode, GET_OBJ_TIB, GET_OBJ_TIB_opcode, GET_SUPERCLASS_IDS_FROM_TIB, GET_SUPERCLASS_IDS_FROM_TIB_opcode, GET_TIME_BASE, GET_TIME_BASE_opcode, GET_TYPE_FROM_TIB, GET_TYPE_FROM_TIB_opcode, GETFIELD, GETFIELD_opcode, GETSTATIC, GETSTATIC_opcode, GOTO, GOTO_opcode, GUARD_COMBINE, GUARD_COMBINE_opcode, GUARD_COND_MOVE, GUARD_COND_MOVE_opcode, GUARD_MOVE, GUARD_MOVE_opcode, helper, IA32_ADC, IA32_ADC_opcode, IA32_ADD, IA32_ADD_opcode, IA32_ADDSD, IA32_ADDSD_opcode, IA32_ADDSS, IA32_ADDSS_opcode, IA32_AND, IA32_AND_opcode, IA32_ANDNPD, IA32_ANDNPD_opcode, IA32_ANDNPS, IA32_ANDNPS_opcode, IA32_ANDPD, IA32_ANDPD_opcode, IA32_ANDPS, IA32_ANDPS_opcode, IA32_BSWAP, IA32_BSWAP_opcode, IA32_BT, IA32_BT_opcode, IA32_BTC, IA32_BTC_opcode, IA32_BTR, IA32_BTR_opcode, IA32_BTS, IA32_BTS_opcode, IA32_CALL, IA32_CALL_opcode, IA32_CDO, IA32_CDO_opcode, IA32_CDQ, IA32_CDQ_opcode, IA32_CDQE, IA32_CDQE_opcode, IA32_CMOV, IA32_CMOV_opcode, IA32_CMP, IA32_CMP_opcode, IA32_CMPEQSD, IA32_CMPEQSD_opcode, IA32_CMPEQSS, IA32_CMPEQSS_opcode, IA32_CMPLESD, IA32_CMPLESD_opcode, IA32_CMPLESS, IA32_CMPLESS_opcode, IA32_CMPLTSD, IA32_CMPLTSD_opcode, IA32_CMPLTSS, IA32_CMPLTSS_opcode, IA32_CMPNESD, IA32_CMPNESD_opcode, IA32_CMPNESS, IA32_CMPNESS_opcode, IA32_CMPNLESD, IA32_CMPNLESD_opcode, IA32_CMPNLESS, IA32_CMPNLESS_opcode, IA32_CMPNLTSD, IA32_CMPNLTSD_opcode, IA32_CMPNLTSS, IA32_CMPNLTSS_opcode, IA32_CMPORDSD, IA32_CMPORDSD_opcode, IA32_CMPORDSS, IA32_CMPORDSS_opcode, IA32_CMPUNORDSD, IA32_CMPUNORDSD_opcode, IA32_CMPUNORDSS, IA32_CMPUNORDSS_opcode, IA32_CMPXCHG, IA32_CMPXCHG_opcode, IA32_CMPXCHG8B, IA32_CMPXCHG8B_opcode, IA32_CVTSD2SI, IA32_CVTSD2SI_opcode, IA32_CVTSD2SIQ, IA32_CVTSD2SIQ_opcode, IA32_CVTSD2SS, IA32_CVTSD2SS_opcode, IA32_CVTSI2SD, IA32_CVTSI2SD_opcode, IA32_CVTSI2SDQ, IA32_CVTSI2SDQ_opcode, IA32_CVTSI2SS, IA32_CVTSI2SS_opcode, IA32_CVTSS2SD, IA32_CVTSS2SD_opcode, IA32_CVTSS2SI, IA32_CVTSS2SI_opcode, IA32_CVTTSD2SI, IA32_CVTTSD2SI_opcode, IA32_CVTTSD2SIQ, IA32_CVTTSD2SIQ_opcode, IA32_CVTTSS2SI, IA32_CVTTSS2SI_opcode, IA32_DEC, IA32_DEC_opcode, IA32_DIV, IA32_DIV_opcode, IA32_DIVSD, IA32_DIVSD_opcode, IA32_DIVSS, IA32_DIVSS_opcode, IA32_FADD, IA32_FADD_opcode, IA32_FADDP, IA32_FADDP_opcode, IA32_FCHS, IA32_FCHS_opcode, IA32_FCLEAR, IA32_FCLEAR_opcode, IA32_FCMOV, IA32_FCMOV_opcode, IA32_FCOMI, IA32_FCOMI_opcode, IA32_FCOMIP, IA32_FCOMIP_opcode, IA32_FDIV, IA32_FDIV_opcode, IA32_FDIVP, IA32_FDIVP_opcode, IA32_FDIVR, IA32_FDIVR_opcode, IA32_FDIVRP, IA32_FDIVRP_opcode, IA32_FEXAM, IA32_FEXAM_opcode, IA32_FFREE, IA32_FFREE_opcode, IA32_FIADD, IA32_FIADD_opcode, IA32_FIDIV, IA32_FIDIV_opcode, IA32_FIDIVR, IA32_FIDIVR_opcode, IA32_FILD, IA32_FILD_opcode, IA32_FIMUL, IA32_FIMUL_opcode, IA32_FINIT, IA32_FINIT_opcode, IA32_FIST, IA32_FIST_opcode, IA32_FISTP, IA32_FISTP_opcode, IA32_FISUB, IA32_FISUB_opcode, IA32_FISUBR, IA32_FISUBR_opcode, IA32_FLD, IA32_FLD_opcode, IA32_FLD1, IA32_FLD1_opcode, IA32_FLDCW, IA32_FLDCW_opcode, IA32_FLDL2E, IA32_FLDL2E_opcode, IA32_FLDL2T, IA32_FLDL2T_opcode, IA32_FLDLG2, IA32_FLDLG2_opcode, IA32_FLDLN2, IA32_FLDLN2_opcode, IA32_FLDPI, IA32_FLDPI_opcode, IA32_FLDZ, IA32_FLDZ_opcode, IA32_FMOV, IA32_FMOV_ENDING_LIVE_RANGE, IA32_FMOV_ENDING_LIVE_RANGE_opcode, IA32_FMOV_opcode, IA32_FMUL, IA32_FMUL_opcode, IA32_FMULP, IA32_FMULP_opcode, IA32_FNINIT, IA32_FNINIT_opcode, IA32_FNSAVE, IA32_FNSAVE_opcode, IA32_FNSTCW, IA32_FNSTCW_opcode, IA32_FPREM, IA32_FPREM_opcode, IA32_FRSTOR, IA32_FRSTOR_opcode, IA32_FST, IA32_FST_opcode, IA32_FSTCW, IA32_FSTCW_opcode, IA32_FSTP, IA32_FSTP_opcode, IA32_FSUB, IA32_FSUB_opcode, IA32_FSUBP, IA32_FSUBP_opcode, IA32_FSUBR, IA32_FSUBR_opcode, IA32_FSUBRP, IA32_FSUBRP_opcode, IA32_FUCOMI, IA32_FUCOMI_opcode, IA32_FUCOMIP, IA32_FUCOMIP_opcode, IA32_FXCH, IA32_FXCH_opcode, IA32_IDIV, IA32_IDIV_opcode, IA32_IMUL1, IA32_IMUL1_opcode, IA32_IMUL2, IA32_IMUL2_opcode, IA32_INC, IA32_INC_opcode, IA32_INT, IA32_INT_opcode, IA32_JCC, IA32_JCC_opcode, IA32_JCC2, IA32_JCC2_opcode, IA32_JMP, IA32_JMP_opcode, IA32_LEA, IA32_LEA_opcode, IA32_LOCK, IA32_LOCK_CMPXCHG, IA32_LOCK_CMPXCHG_opcode, IA32_LOCK_CMPXCHG8B, IA32_LOCK_CMPXCHG8B_opcode, IA32_LOCK_opcode, IA32_METHODSTART, IA32_METHODSTART_opcode, IA32_MFENCE, IA32_MFENCE_opcode, IA32_MOV, IA32_MOV_opcode, IA32_MOVD, IA32_MOVD_opcode, IA32_MOVLPD, IA32_MOVLPD_opcode, IA32_MOVLPS, IA32_MOVLPS_opcode, IA32_MOVQ, IA32_MOVQ_opcode, IA32_MOVSD, IA32_MOVSD_opcode, IA32_MOVSS, IA32_MOVSS_opcode, IA32_MOVSX__B, IA32_MOVSX__B_opcode, IA32_MOVSX__W, IA32_MOVSX__W_opcode, IA32_MOVSXQ__B, IA32_MOVSXQ__B_opcode, IA32_MOVSXQ__W, IA32_MOVSXQ__W_opcode, IA32_MOVZX__B, IA32_MOVZX__B_opcode, IA32_MOVZX__W, IA32_MOVZX__W_opcode, IA32_MOVZXQ__B, IA32_MOVZXQ__B_opcode, IA32_MOVZXQ__W, IA32_MOVZXQ__W_opcode, IA32_MUL, IA32_MUL_opcode, IA32_MULSD, IA32_MULSD_opcode, IA32_MULSS, IA32_MULSS_opcode, IA32_NEG, IA32_NEG_opcode, IA32_NOT, IA32_NOT_opcode, IA32_OFFSET, IA32_OFFSET_opcode, IA32_OR, IA32_OR_opcode, IA32_ORPD, IA32_ORPD_opcode, IA32_ORPS, IA32_ORPS_opcode, IA32_PAUSE, IA32_PAUSE_opcode, IA32_POP, IA32_POP_opcode, IA32_PREFETCHNTA, IA32_PREFETCHNTA_opcode, IA32_PSLLQ, IA32_PSLLQ_opcode, IA32_PSRLQ, IA32_PSRLQ_opcode, IA32_PUSH, IA32_PUSH_opcode, IA32_RCL, IA32_RCL_opcode, IA32_RCR, IA32_RCR_opcode, IA32_RDTSC, IA32_RDTSC_opcode, IA32_RET, IA32_RET_opcode, IA32_ROL, IA32_ROL_opcode, IA32_ROR, IA32_ROR_opcode, IA32_SAL, IA32_SAL_opcode, IA32_SAR, IA32_SAR_opcode, IA32_SBB, IA32_SBB_opcode, IA32_SET__B, IA32_SET__B_opcode, IA32_SHL, IA32_SHL_opcode, IA32_SHLD, IA32_SHLD_opcode, IA32_SHR, IA32_SHR_opcode, IA32_SHRD, IA32_SHRD_opcode, IA32_SQRTSD, IA32_SQRTSD_opcode, IA32_SQRTSS, IA32_SQRTSS_opcode, IA32_SUB, IA32_SUB_opcode, IA32_SUBSD, IA32_SUBSD_opcode, IA32_SUBSS, IA32_SUBSS_opcode, IA32_SYSCALL, IA32_SYSCALL_opcode, IA32_TEST, IA32_TEST_opcode, IA32_TRAPIF, IA32_TRAPIF_opcode, IA32_UCOMISD, IA32_UCOMISD_opcode, IA32_UCOMISS, IA32_UCOMISS_opcode, IA32_XOR, IA32_XOR_opcode, IA32_XORPD, IA32_XORPD_opcode, IA32_XORPS, IA32_XORPS_opcode, IG_CLASS_TEST, IG_CLASS_TEST_opcode, IG_METHOD_TEST, IG_METHOD_TEST_opcode, IG_PATCH_POINT, IG_PATCH_POINT_opcode, INSTANCEOF, INSTANCEOF_NOTNULL, INSTANCEOF_NOTNULL_opcode, INSTANCEOF_opcode, INSTANCEOF_UNRESOLVED, INSTANCEOF_UNRESOLVED_opcode, INSTRUMENTED_EVENT_COUNTER, INSTRUMENTED_EVENT_COUNTER_opcode, INT_2ADDRSigExt, INT_2ADDRSigExt_opcode, INT_2ADDRZerExt, INT_2ADDRZerExt_opcode, INT_2BYTE, INT_2BYTE_opcode, INT_2DOUBLE, INT_2DOUBLE_opcode, INT_2FLOAT, INT_2FLOAT_opcode, INT_2FP, INT_2FP_opcode, INT_2LONG, INT_2LONG_opcode, INT_2SHORT, INT_2SHORT_opcode, INT_2USHORT, INT_2USHORT_opcode, INT_ADD, INT_ADD_opcode, INT_ALOAD, INT_ALOAD_opcode, INT_AND, INT_AND_opcode, INT_ASTORE, INT_ASTORE_opcode, INT_BITS_AS_FLOAT, INT_BITS_AS_FLOAT_opcode, INT_COND_MOVE, INT_COND_MOVE_opcode, INT_CONSTANT, INT_CONSTANT_opcode, INT_DIV, INT_DIV_opcode, INT_IFCMP, INT_IFCMP_opcode, INT_IFCMP2, INT_IFCMP2_opcode, INT_LOAD, INT_LOAD_opcode, INT_MOVE, INT_MOVE_opcode, INT_MUL, INT_MUL_opcode, INT_NEG, INT_NEG_opcode, INT_NOT, INT_NOT_opcode, INT_OR, INT_OR_opcode, INT_REM, INT_REM_opcode, INT_SHL, INT_SHL_opcode, INT_SHR, INT_SHR_opcode, INT_STORE, INT_STORE_opcode, INT_SUB, INT_SUB_opcode, INT_USHR, INT_USHR_opcode, INT_XOR, INT_XOR_opcode, INT_ZERO_CHECK, INT_ZERO_CHECK_opcode, IR_PROLOGUE, IR_PROLOGUE_opcode, LABEL, LABEL_opcode, LCMP_CMOV, LCMP_CMOV_opcode, LONG_2ADDR, LONG_2ADDR_opcode, LONG_2DOUBLE, LONG_2DOUBLE_opcode, LONG_2FLOAT, LONG_2FLOAT_opcode, LONG_2FP, LONG_2FP_opcode, LONG_2INT, LONG_2INT_opcode, LONG_ADD, LONG_ADD_opcode, LONG_ALOAD, LONG_ALOAD_opcode, LONG_AND, LONG_AND_opcode, LONG_ASTORE, LONG_ASTORE_opcode, LONG_BITS_AS_DOUBLE, LONG_BITS_AS_DOUBLE_opcode, LONG_CMP, LONG_CMP_opcode, LONG_COND_MOVE, LONG_COND_MOVE_opcode, LONG_CONSTANT, LONG_CONSTANT_opcode, LONG_DIV, LONG_DIV_opcode, LONG_IFCMP, LONG_IFCMP_opcode, LONG_LOAD, LONG_LOAD_opcode, LONG_MOVE, LONG_MOVE_opcode, LONG_MUL, LONG_MUL_opcode, LONG_NEG, LONG_NEG_opcode, LONG_NOT, LONG_NOT_opcode, LONG_OR, LONG_OR_opcode, LONG_REM, LONG_REM_opcode, LONG_SHL, LONG_SHL_opcode, LONG_SHR, LONG_SHR_opcode, LONG_STORE, LONG_STORE_opcode, LONG_SUB, LONG_SUB_opcode, LONG_USHR, LONG_USHR_opcode, LONG_XOR, LONG_XOR_opcode, LONG_ZERO_CHECK, LONG_ZERO_CHECK_opcode, LOOKUPSWITCH, LOOKUPSWITCH_opcode, LOWTABLESWITCH, LOWTABLESWITCH_opcode, MATERIALIZE_FP_CONSTANT, MATERIALIZE_FP_CONSTANT_opcode, MIR_END, MIR_END_opcode, MIR_LOWTABLESWITCH, MIR_LOWTABLESWITCH_opcode, MIR_START, MIR_START_opcode, MONITORENTER, MONITORENTER_opcode, MONITOREXIT, MONITOREXIT_opcode, MUST_IMPLEMENT_INTERFACE, MUST_IMPLEMENT_INTERFACE_opcode, NEW, NEW_opcode, NEW_UNRESOLVED, NEW_UNRESOLVED_opcode, NEWARRAY, NEWARRAY_opcode, NEWARRAY_UNRESOLVED, NEWARRAY_UNRESOLVED_opcode, NEWOBJMULTIARRAY, NEWOBJMULTIARRAY_opcode, NOP, NOP_opcode, NULL, NULL_CHECK, NULL_CHECK_opcode, NULL_opcode, OBJARRAY_STORE_CHECK, OBJARRAY_STORE_CHECK_NOTNULL, OBJARRAY_STORE_CHECK_NOTNULL_opcode, OBJARRAY_STORE_CHECK_opcode, OSR_BARRIER, OSR_BARRIER_opcode, OTHER_OPERAND, OTHER_OPERAND_opcode, PAUSE, PAUSE_opcode, PHI, PHI_opcode, PI, PI_opcode, PREFETCH, PREFETCH_opcode, PREPARE_ADDR, PREPARE_ADDR_opcode, PREPARE_INT, PREPARE_INT_opcode, PREPARE_LONG, PREPARE_LONG_opcode, PUTFIELD, PUTFIELD_opcode, PUTSTATIC, PUTSTATIC_opcode, READ_CEILING, READ_CEILING_opcode, REF_ADD, REF_ADD_opcode, REF_ALOAD, REF_ALOAD_opcode, REF_AND, REF_AND_opcode, REF_ASTORE, REF_ASTORE_opcode, REF_COND_MOVE, REF_COND_MOVE_opcode, REF_IFCMP, REF_IFCMP_opcode, REF_LOAD, REF_LOAD_opcode, REF_MOVE, REF_MOVE_opcode, REF_NEG, REF_NEG_opcode, REF_NOT, REF_NOT_opcode, REF_OR, REF_OR_opcode, REF_SHL, REF_SHL_opcode, REF_SHR, REF_SHR_opcode, REF_STORE, REF_STORE_opcode, REF_SUB, REF_SUB_opcode, REF_USHR, REF_USHR_opcode, REF_XOR, REF_XOR_opcode, REGISTER, REGISTER_opcode, REQUIRE_ESP, REQUIRE_ESP_opcode, RESOLVE, RESOLVE_MEMBER, RESOLVE_MEMBER_opcode, RESOLVE_opcode, RETURN, RETURN_opcode, ROUND_TO_ZERO, ROUND_TO_ZERO_opcode, SET_CAUGHT_EXCEPTION, SET_CAUGHT_EXCEPTION_opcode, SHORT_ALOAD, SHORT_ALOAD_opcode, SHORT_ASTORE, SHORT_ASTORE_opcode, SHORT_LOAD, SHORT_LOAD_opcode, SHORT_STORE, SHORT_STORE_opcode, SPLIT, SPLIT_opcode, SYSCALL, SYSCALL_opcode, TABLESWITCH, TABLESWITCH_opcode, TRAP, TRAP_IF, TRAP_IF_opcode, TRAP_opcode, UBYTE_ALOAD, UBYTE_ALOAD_opcode, UBYTE_LOAD, UBYTE_LOAD_opcode, UNINT_BEGIN, UNINT_BEGIN_opcode, UNINT_END, UNINT_END_opcode, USHORT_ALOAD, USHORT_ALOAD_opcode, USHORT_LOAD, USHORT_LOAD_opcode, WRITE_FLOOR, WRITE_FLOOR_opcode, YIELDPOINT_BACKEDGE, YIELDPOINT_BACKEDGE_opcode, YIELDPOINT_EPILOGUE, YIELDPOINT_EPILOGUE_opcode, YIELDPOINT_OSR, YIELDPOINT_OSR_opcode, YIELDPOINT_PROLOGUE, YIELDPOINT_PROLOGUE_opcode
 
Constructor Summary
private GenerationContext()
          for internal use only (in createInlinedContext)
(package private) GenerationContext(NormalMethod meth, TypeReference[] params, CompiledMethod cm, OptOptions opts, InlineOracle ip)
          Use this constructor to create an outermost (non-inlined) GenerationContext.
 
Method Summary
private  void appendInstruction(BasicBlock b, Instruction s, int bcIndex)
           
 void close()
          Kill ncGuards, so we do not use outdated mappings unintendedly later on
private  void completeEpilogue(boolean isOutermost)
          Fill in the rest of the method epilogue.
private  void completeExceptionHandlers(boolean isOutermost)
          If the method is synchronized then we wrap it in a synthetic exception handler that unlocks & rethrows PRECONDITION: cfg, arguments & temps have been setup/initialized.
private  void completePrologue(boolean isOutermost)
          Fill in the rest of the method prologue.
static GenerationContext createChildContext(GenerationContext parent, ExceptionHandlerBasicBlockBag ebag, NormalMethod callee, Instruction callSite)
          Create a child generation context from parent & callerBB to generate IR for callsite.
static GenerationContext createSynthetic(GenerationContext parent, ExceptionHandlerBasicBlockBag ebag)
          Only for internal use by Inliner (when inlining multiple targets) This is probably not the prettiest way to handle this, but it requires no changes to BC2IR's & Inliner's high level control logic.
 BranchProfileOperand getConditionalBranchProfileOperand(int bcIndex, boolean backwards)
           
 int getLocalNumberFor(Register reg, TypeReference type)
          Get the local number for a given register
private  Operand getLockObject()
          Get the object for locking for synchronized methods.
private  Register[] getPool(TypeReference type)
           
 SwitchBranchProfile getSwitchProfile(int bcIndex)
           
private  void initLocalPool()
           
 boolean isLocal(Operand op, int i, TypeReference type)
          Is the operand a particular bytecode local?
 Register localReg(int i, TypeReference type)
          Return the Register used to for local i of TypeReference type
(package private)  RegisterOperand makeLocal(int i, RegisterOperand props)
          Make a register operand that refers to the given local variable number, and inherits its properties (type, flags) from props
 RegisterOperand makeLocal(int i, TypeReference type)
          Make a register operand that refers to the given local variable number and has the given type.
(package private)  RegisterOperand makeNullCheckGuard(Register ref)
          Make a register operand to use as a null check guard for the given register.
(package private)  boolean noBoundsChecks()
          Should bounds checks be generated?
(package private)  boolean noNullChecks()
          Should null checks be generated?
private  boolean requiresUnintMarker()
           
private  void resync_ncGuards()
          This method makes sure that _ncGuard only maps to registers that are actually in the IRs register pool.
 void resync()
          Make sure, the generation context is still in sync with the IR, even if we applied some optimizations.
static void transferState(GenerationContext parent, GenerationContext child)
          Use this to transfer state back from a child context back to its parent.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

original_method

NormalMethod original_method
The original method (root of the calling context tree)


original_cm

CompiledMethod original_cm
The compiled method assigned for this compilation of original_method


method

public NormalMethod method
The method to be generated


branchProfiles

BranchProfiles branchProfiles
The BranchProfile data for method, if available


options

public OptOptions options
The options to control the generation


cfg

public ControlFlowGraph cfg
The CFG object into which instructions should be generated.


temps

public ArchitectureSpecificOpt.RegisterPool temps
The register pool to be used during generation


arguments

Operand[] arguments
The parameters which BC2IR should use to seed the local state for the entry basic block.


prologue

public BasicBlock prologue
The basic block into which BC2IR's caller will generate a "prologue." BC2IR will add a CFG edge from prologue to the block containing the instructions generated for bytecode 0, but it is its caller's responsibility to populate the prologue with instructions. All blocks generated by BC2IR will be injected by BC2IR.doFinalPass immediately after prologue in the code ordering (ie prologue can assume it will fallthrough to the first basic block in the ir generated for method.


epilogue

public BasicBlock epilogue
The basic block into which BC2IR's caller will generate an epilogue. BC2IR will add CFG edges to this node, but it is its caller's responsibility to populate it with instructions. NOTE: After IR is generated one of two conditions will hold: NOTE: BC2IR assumes that epilogue is a single basic block (i.e. it has no out edges)


exit

public BasicBlock exit
The exit node of the outermost CFG (used by BC2IR for not-definitely caught athrows and by OSR_Yieldpoints)


unlockAndRethrow

BasicBlock unlockAndRethrow
A catch, unlock, and rethrow exception handler used for synchronized methods.


resultReg

Register resultReg
The Register to which BC2IR should assign the return value(s) of the method. It will be null when the method has a void return.


enclosingHandlers

ExceptionHandlerBasicBlockBag enclosingHandlers
The enclosing exception handlers (null if there are none).


inlineSequence

public InlineSequence inlineSequence
Inlining context of the method to be generated


inlinePlan

InlineOracle inlinePlan
The InlineOracle to be consulted for all inlining decisions during the generation of this IR.


generatedExceptionHandlers

public boolean generatedExceptionHandlers
Did BC2IR generate a reachable exception handler while generating the IR for this method


allocFrame

public boolean allocFrame
Did BC2IR encounter a magic that requires us to allocate a stack frame?


result

public Operand result
Used to communicate the meet of the return values back to the caller Mainly useful when BC2IR is doing inlining....allows the caller BC2IR object to exploit knowledge the callee BC2IR object had about the result.


doesCheckStore

boolean doesCheckStore
Do we do check stores?


intLocals

private Register[] intLocals

addressLocals

private Register[] addressLocals

floatLocals

private Register[] floatLocals

longLocals

private Register[] longLocals

doubleLocals

private Register[] doubleLocals

_ncGuards

private HashMap<Register,RegisterOperand> _ncGuards
Constructor Detail

GenerationContext

GenerationContext(NormalMethod meth,
                  TypeReference[] params,
                  CompiledMethod cm,
                  OptOptions opts,
                  InlineOracle ip)
Use this constructor to create an outermost (non-inlined) GenerationContext.

Parameters:
meth - The NormalMethod whose IR will be generated
params - The known types of the parameters to the method. For method specialization.
cm - The compiled method id to be used for this compilation
opts - The Options to be used for the generation
ip - The InlineOracle to be used for the generation

GenerationContext

private GenerationContext()
for internal use only (in createInlinedContext)

Method Detail

createChildContext

public static GenerationContext createChildContext(GenerationContext parent,
                                                   ExceptionHandlerBasicBlockBag ebag,
                                                   NormalMethod callee,
                                                   Instruction callSite)
Create a child generation context from parent & callerBB to generate IR for callsite. Make this 'static' to avoid confusing parent/child fields.

Parameters:
parent - the parent gc
ebag - the enclosing exception handlers (null if none)
callee - the callee method to be inlined (may _not_ be equal to Call.getMethod(callSite).method)
callSite - the Call instruction to be inlined.
Returns:
the child context

createSynthetic

public static GenerationContext createSynthetic(GenerationContext parent,
                                                ExceptionHandlerBasicBlockBag ebag)
Only for internal use by Inliner (when inlining multiple targets) This is probably not the prettiest way to handle this, but it requires no changes to BC2IR's & Inliner's high level control logic.

Parameters:
parent - the parent GC
ebag - the enclosing exception handlers (null if none)
Returns:
the synthetic context

transferState

public static void transferState(GenerationContext parent,
                                 GenerationContext child)
Use this to transfer state back from a child context back to its parent.

Parameters:
parent - the parent context that will receive the state
child - the child context from which the state will be taken

initLocalPool

private void initLocalPool()

getPool

private Register[] getPool(TypeReference type)

localReg

public Register localReg(int i,
                         TypeReference type)
Return the Register used to for local i of TypeReference type


noNullChecks

boolean noNullChecks()
Should null checks be generated?


noBoundsChecks

boolean noBoundsChecks()
Should bounds checks be generated?


makeLocal

public RegisterOperand makeLocal(int i,
                                 TypeReference type)
Make a register operand that refers to the given local variable number and has the given type.

Parameters:
i - local variable number
type - desired data type

makeLocal

RegisterOperand makeLocal(int i,
                          RegisterOperand props)
Make a register operand that refers to the given local variable number, and inherits its properties (type, flags) from props

Parameters:
i - local variable number
props - RegisterOperand to inherit flags from

getLocalNumberFor

public int getLocalNumberFor(Register reg,
                             TypeReference type)
Get the local number for a given register


isLocal

public boolean isLocal(Operand op,
                       int i,
                       TypeReference type)
Is the operand a particular bytecode local?


makeNullCheckGuard

RegisterOperand makeNullCheckGuard(Register ref)
Make a register operand to use as a null check guard for the given register.


getConditionalBranchProfileOperand

public BranchProfileOperand getConditionalBranchProfileOperand(int bcIndex,
                                                               boolean backwards)

getSwitchProfile

public SwitchBranchProfile getSwitchProfile(int bcIndex)

completePrologue

private void completePrologue(boolean isOutermost)
Fill in the rest of the method prologue. PRECONDITION: arguments & temps have been setup/initialized.


completeEpilogue

private void completeEpilogue(boolean isOutermost)
Fill in the rest of the method epilogue. PRECONDITION: arguments & temps have been setup/initialized.


completeExceptionHandlers

private void completeExceptionHandlers(boolean isOutermost)
If the method is synchronized then we wrap it in a synthetic exception handler that unlocks & rethrows PRECONDITION: cfg, arguments & temps have been setup/initialized.


getLockObject

private Operand getLockObject()
Get the object for locking for synchronized methods. either the class object or the this ptr.


appendInstruction

private void appendInstruction(BasicBlock b,
                               Instruction s,
                               int bcIndex)

requiresUnintMarker

private boolean requiresUnintMarker()

resync

public void resync()
Make sure, the generation context is still in sync with the IR, even if we applied some optimizations. This method should be called before hir2lir conversions which might trigger inlining.


resync_ncGuards

private void resync_ncGuards()
This method makes sure that _ncGuard only maps to registers that are actually in the IRs register pool.


close

public void close()
Kill ncGuards, so we do not use outdated mappings unintendedly later on