< prev index next >

src/hotspot/cpu/x86/c1_FrameMap_x86.cpp

Print this page




  33 LIR_Opr FrameMap::map_to_opr(BasicType type, VMRegPair* reg, bool) {
  34   LIR_Opr opr = LIR_OprFact::illegalOpr;
  35   VMReg r_1 = reg->first();
  36   VMReg r_2 = reg->second();
  37   if (r_1->is_stack()) {
  38     // Convert stack slot to an SP offset
  39     // The calling convention does not count the SharedRuntime::out_preserve_stack_slots() value
  40     // so we must add it in here.
  41     int st_off = (r_1->reg2stack() + SharedRuntime::out_preserve_stack_slots()) * VMRegImpl::stack_slot_size;
  42     opr = LIR_OprFact::address(new LIR_Address(rsp_opr, st_off, type));
  43   } else if (r_1->is_Register()) {
  44     Register reg = r_1->as_Register();
  45     if (r_2->is_Register() && (type == T_LONG || type == T_DOUBLE)) {
  46       Register reg2 = r_2->as_Register();
  47 #ifdef _LP64
  48       assert(reg2 == reg, "must be same register");
  49       opr = as_long_opr(reg);
  50 #else
  51       opr = as_long_opr(reg2, reg);
  52 #endif // _LP64
  53     } else if (type == T_OBJECT || type == T_ARRAY) {
  54       opr = as_oop_opr(reg);
  55     } else if (type == T_METADATA) {
  56       opr = as_metadata_opr(reg);
  57     } else {
  58       opr = as_opr(reg);
  59     }
  60   } else if (r_1->is_FloatRegister()) {
  61     assert(type == T_DOUBLE || type == T_FLOAT, "wrong type");
  62     int num = r_1->as_FloatRegister()->encoding();
  63     if (type == T_FLOAT) {
  64       opr = LIR_OprFact::single_fpu(num);
  65     } else {
  66       opr = LIR_OprFact::double_fpu(num);
  67     }
  68   } else if (r_1->is_XMMRegister()) {
  69     assert(type == T_DOUBLE || type == T_FLOAT, "wrong type");
  70     int num = r_1->as_XMMRegister()->encoding();
  71     if (type == T_FLOAT) {
  72       opr = LIR_OprFact::single_xmm(num);
  73     } else {




  33 LIR_Opr FrameMap::map_to_opr(BasicType type, VMRegPair* reg, bool) {
  34   LIR_Opr opr = LIR_OprFact::illegalOpr;
  35   VMReg r_1 = reg->first();
  36   VMReg r_2 = reg->second();
  37   if (r_1->is_stack()) {
  38     // Convert stack slot to an SP offset
  39     // The calling convention does not count the SharedRuntime::out_preserve_stack_slots() value
  40     // so we must add it in here.
  41     int st_off = (r_1->reg2stack() + SharedRuntime::out_preserve_stack_slots()) * VMRegImpl::stack_slot_size;
  42     opr = LIR_OprFact::address(new LIR_Address(rsp_opr, st_off, type));
  43   } else if (r_1->is_Register()) {
  44     Register reg = r_1->as_Register();
  45     if (r_2->is_Register() && (type == T_LONG || type == T_DOUBLE)) {
  46       Register reg2 = r_2->as_Register();
  47 #ifdef _LP64
  48       assert(reg2 == reg, "must be same register");
  49       opr = as_long_opr(reg);
  50 #else
  51       opr = as_long_opr(reg2, reg);
  52 #endif // _LP64
  53     } else if (type == T_OBJECT || type == T_ARRAY || type == T_VALUETYPE) {
  54       opr = as_oop_opr(reg);
  55     } else if (type == T_METADATA) {
  56       opr = as_metadata_opr(reg);
  57     } else {
  58       opr = as_opr(reg);
  59     }
  60   } else if (r_1->is_FloatRegister()) {
  61     assert(type == T_DOUBLE || type == T_FLOAT, "wrong type");
  62     int num = r_1->as_FloatRegister()->encoding();
  63     if (type == T_FLOAT) {
  64       opr = LIR_OprFact::single_fpu(num);
  65     } else {
  66       opr = LIR_OprFact::double_fpu(num);
  67     }
  68   } else if (r_1->is_XMMRegister()) {
  69     assert(type == T_DOUBLE || type == T_FLOAT, "wrong type");
  70     int num = r_1->as_XMMRegister()->encoding();
  71     if (type == T_FLOAT) {
  72       opr = LIR_OprFact::single_xmm(num);
  73     } else {


< prev index next >