< prev index next >

src/cpu/x86/vm/c1_LIRGenerator_x86.cpp

Print this page
rev 9067 : 8139040: Fix initializations before ShouldNotReachHere()


 178 #endif // _LP64
 179     addr =  new LIR_Address(array_opr,
 180                             index_opr,
 181                             LIR_Address::scale(type),
 182                             offset_in_bytes, type);
 183   }
 184   if (needs_card_mark) {
 185     // This store will need a precise card mark, so go ahead and
 186     // compute the full adddres instead of computing once for the
 187     // store and again for the card mark.
 188     LIR_Opr tmp = new_pointer_register();
 189     __ leal(LIR_OprFact::address(addr), tmp);
 190     return new LIR_Address(tmp, type);
 191   } else {
 192     return addr;
 193   }
 194 }
 195 
 196 
 197 LIR_Opr LIRGenerator::load_immediate(int x, BasicType type) {
 198   LIR_Opr r;
 199   if (type == T_LONG) {
 200     r = LIR_OprFact::longConst(x);
 201   } else if (type == T_INT) {
 202     r = LIR_OprFact::intConst(x);
 203   } else {
 204     ShouldNotReachHere();
 205   }
 206   return r;
 207 }
 208 
 209 void LIRGenerator::increment_counter(address counter, BasicType type, int step) {
 210   LIR_Opr pointer = new_pointer_register();
 211   __ move(LIR_OprFact::intptrConst(counter), pointer);
 212   LIR_Address* addr = new LIR_Address(pointer, type);
 213   increment_counter(addr, step);
 214 }
 215 
 216 
 217 void LIRGenerator::increment_counter(LIR_Address* addr, int step) {
 218   __ add((LIR_Opr)addr, LIR_OprFact::intConst(step), (LIR_Opr)addr);


1007     default: {
1008       ShouldNotReachHere();
1009     }
1010   }
1011 }
1012 
1013 // _i2l, _i2f, _i2d, _l2i, _l2f, _l2d, _f2i, _f2l, _f2d, _d2i, _d2l, _d2f
1014 // _i2b, _i2c, _i2s
1015 LIR_Opr fixed_register_for(BasicType type) {
1016   switch (type) {
1017     case T_FLOAT:  return FrameMap::fpu0_float_opr;
1018     case T_DOUBLE: return FrameMap::fpu0_double_opr;
1019     case T_INT:    return FrameMap::rax_opr;
1020     case T_LONG:   return FrameMap::long0_opr;
1021     default:       ShouldNotReachHere(); return LIR_OprFact::illegalOpr;
1022   }
1023 }
1024 
1025 void LIRGenerator::do_Convert(Convert* x) {
1026   // flags that vary for the different operations and different SSE-settings
1027   bool fixed_input, fixed_result, round_result, needs_stub;
1028 
1029   switch (x->op()) {
1030     case Bytecodes::_i2l: // fall through
1031     case Bytecodes::_l2i: // fall through
1032     case Bytecodes::_i2b: // fall through
1033     case Bytecodes::_i2c: // fall through
1034     case Bytecodes::_i2s: fixed_input = false;       fixed_result = false;       round_result = false;      needs_stub = false; break;
1035 
1036     case Bytecodes::_f2d: fixed_input = UseSSE == 1; fixed_result = false;       round_result = false;      needs_stub = false; break;
1037     case Bytecodes::_d2f: fixed_input = false;       fixed_result = UseSSE == 1; round_result = UseSSE < 1; needs_stub = false; break;
1038     case Bytecodes::_i2f: fixed_input = false;       fixed_result = false;       round_result = UseSSE < 1; needs_stub = false; break;
1039     case Bytecodes::_i2d: fixed_input = false;       fixed_result = false;       round_result = false;      needs_stub = false; break;
1040     case Bytecodes::_f2i: fixed_input = false;       fixed_result = false;       round_result = false;      needs_stub = true;  break;
1041     case Bytecodes::_d2i: fixed_input = false;       fixed_result = false;       round_result = false;      needs_stub = true;  break;
1042     case Bytecodes::_l2f: fixed_input = false;       fixed_result = UseSSE >= 1; round_result = UseSSE < 1; needs_stub = false; break;
1043     case Bytecodes::_l2d: fixed_input = false;       fixed_result = UseSSE >= 2; round_result = UseSSE < 2; needs_stub = false; break;
1044     case Bytecodes::_f2l: fixed_input = true;        fixed_result = true;        round_result = false;      needs_stub = false; break;
1045     case Bytecodes::_d2l: fixed_input = true;        fixed_result = true;        round_result = false;      needs_stub = false; break;
1046     default: ShouldNotReachHere();
1047   }




 178 #endif // _LP64
 179     addr =  new LIR_Address(array_opr,
 180                             index_opr,
 181                             LIR_Address::scale(type),
 182                             offset_in_bytes, type);
 183   }
 184   if (needs_card_mark) {
 185     // This store will need a precise card mark, so go ahead and
 186     // compute the full adddres instead of computing once for the
 187     // store and again for the card mark.
 188     LIR_Opr tmp = new_pointer_register();
 189     __ leal(LIR_OprFact::address(addr), tmp);
 190     return new LIR_Address(tmp, type);
 191   } else {
 192     return addr;
 193   }
 194 }
 195 
 196 
 197 LIR_Opr LIRGenerator::load_immediate(int x, BasicType type) {
 198   LIR_Opr r = NULL;
 199   if (type == T_LONG) {
 200     r = LIR_OprFact::longConst(x);
 201   } else if (type == T_INT) {
 202     r = LIR_OprFact::intConst(x);
 203   } else {
 204     ShouldNotReachHere();
 205   }
 206   return r;
 207 }
 208 
 209 void LIRGenerator::increment_counter(address counter, BasicType type, int step) {
 210   LIR_Opr pointer = new_pointer_register();
 211   __ move(LIR_OprFact::intptrConst(counter), pointer);
 212   LIR_Address* addr = new LIR_Address(pointer, type);
 213   increment_counter(addr, step);
 214 }
 215 
 216 
 217 void LIRGenerator::increment_counter(LIR_Address* addr, int step) {
 218   __ add((LIR_Opr)addr, LIR_OprFact::intConst(step), (LIR_Opr)addr);


1007     default: {
1008       ShouldNotReachHere();
1009     }
1010   }
1011 }
1012 
1013 // _i2l, _i2f, _i2d, _l2i, _l2f, _l2d, _f2i, _f2l, _f2d, _d2i, _d2l, _d2f
1014 // _i2b, _i2c, _i2s
1015 LIR_Opr fixed_register_for(BasicType type) {
1016   switch (type) {
1017     case T_FLOAT:  return FrameMap::fpu0_float_opr;
1018     case T_DOUBLE: return FrameMap::fpu0_double_opr;
1019     case T_INT:    return FrameMap::rax_opr;
1020     case T_LONG:   return FrameMap::long0_opr;
1021     default:       ShouldNotReachHere(); return LIR_OprFact::illegalOpr;
1022   }
1023 }
1024 
1025 void LIRGenerator::do_Convert(Convert* x) {
1026   // flags that vary for the different operations and different SSE-settings
1027   bool fixed_input = false, fixed_result = false, round_result = false, needs_stub = false;
1028 
1029   switch (x->op()) {
1030     case Bytecodes::_i2l: // fall through
1031     case Bytecodes::_l2i: // fall through
1032     case Bytecodes::_i2b: // fall through
1033     case Bytecodes::_i2c: // fall through
1034     case Bytecodes::_i2s: fixed_input = false;       fixed_result = false;       round_result = false;      needs_stub = false; break;
1035 
1036     case Bytecodes::_f2d: fixed_input = UseSSE == 1; fixed_result = false;       round_result = false;      needs_stub = false; break;
1037     case Bytecodes::_d2f: fixed_input = false;       fixed_result = UseSSE == 1; round_result = UseSSE < 1; needs_stub = false; break;
1038     case Bytecodes::_i2f: fixed_input = false;       fixed_result = false;       round_result = UseSSE < 1; needs_stub = false; break;
1039     case Bytecodes::_i2d: fixed_input = false;       fixed_result = false;       round_result = false;      needs_stub = false; break;
1040     case Bytecodes::_f2i: fixed_input = false;       fixed_result = false;       round_result = false;      needs_stub = true;  break;
1041     case Bytecodes::_d2i: fixed_input = false;       fixed_result = false;       round_result = false;      needs_stub = true;  break;
1042     case Bytecodes::_l2f: fixed_input = false;       fixed_result = UseSSE >= 1; round_result = UseSSE < 1; needs_stub = false; break;
1043     case Bytecodes::_l2d: fixed_input = false;       fixed_result = UseSSE >= 2; round_result = UseSSE < 2; needs_stub = false; break;
1044     case Bytecodes::_f2l: fixed_input = true;        fixed_result = true;        round_result = false;      needs_stub = false; break;
1045     case Bytecodes::_d2l: fixed_input = true;        fixed_result = true;        round_result = false;      needs_stub = false; break;
1046     default: ShouldNotReachHere();
1047   }


< prev index next >