< prev index next >

src/hotspot/share/c1/c1_LIR.cpp

Print this page




  25 #include "precompiled.hpp"
  26 #include "c1/c1_InstructionPrinter.hpp"
  27 #include "c1/c1_LIR.hpp"
  28 #include "c1/c1_LIRAssembler.hpp"
  29 #include "c1/c1_ValueStack.hpp"
  30 #include "ci/ciInstance.hpp"
  31 #include "runtime/sharedRuntime.hpp"
  32 
  33 Register LIR_OprDesc::as_register() const {
  34   return FrameMap::cpu_rnr2reg(cpu_regnr());
  35 }
  36 
  37 Register LIR_OprDesc::as_register_lo() const {
  38   return FrameMap::cpu_rnr2reg(cpu_regnrLo());
  39 }
  40 
  41 Register LIR_OprDesc::as_register_hi() const {
  42   return FrameMap::cpu_rnr2reg(cpu_regnrHi());
  43 }
  44 

  45 LIR_Opr LIR_OprFact::illegalOpr = LIR_OprFact::illegal();
  46 
  47 LIR_Opr LIR_OprFact::value_type(ValueType* type) {
  48   ValueTag tag = type->tag();
  49   switch (tag) {
  50   case metaDataTag : {
  51     ClassConstant* c = type->as_ClassConstant();
  52     if (c != NULL && !c->value()->is_loaded()) {
  53       return LIR_OprFact::metadataConst(NULL);
  54     } else if (c != NULL) {
  55       return LIR_OprFact::metadataConst(c->value()->constant_encoding());
  56     } else {
  57       MethodConstant* m = type->as_MethodConstant();
  58       assert (m != NULL, "not a class or a method?");
  59       return LIR_OprFact::metadataConst(m->value()->constant_encoding());
  60     }
  61   }
  62   case objectTag : {
  63       return LIR_OprFact::oopConst(type->as_ObjectType()->encoding());
  64     }


 436     case lir_membar_storeload:         // result and info always invalid
 437     case lir_on_spin_wait:
 438     {
 439       assert(op->as_Op0() != NULL, "must be");
 440       assert(op->_info == NULL, "info not used by this instruction");
 441       assert(op->_result->is_illegal(), "not used");
 442       break;
 443     }
 444 
 445     case lir_nop:                      // may have info, result always invalid
 446     case lir_std_entry:                // may have result, info always invalid
 447     case lir_osr_entry:                // may have result, info always invalid
 448     case lir_get_thread:               // may have result, info always invalid
 449     {
 450       assert(op->as_Op0() != NULL, "must be");
 451       if (op->_info != NULL)           do_info(op->_info);
 452       if (op->_result->is_valid())     do_output(op->_result);
 453       break;
 454     }
 455 










 456 
 457 // LIR_OpLabel
 458     case lir_label:                    // result and info always invalid
 459     {
 460       assert(op->as_OpLabel() != NULL, "must be");
 461       assert(op->_info == NULL, "info not used by this instruction");
 462       assert(op->_result->is_illegal(), "not used");
 463       break;
 464     }
 465 
 466 
 467 // LIR_Op1
 468     case lir_fxch:           // input always valid, result and info always invalid
 469     case lir_fld:            // input always valid, result and info always invalid
 470     case lir_ffree:          // input always valid, result and info always invalid
 471     case lir_push:           // input always valid, result and info always invalid
 472     case lir_pop:            // input always valid, result and info always invalid
 473     case lir_return:         // input always valid, result and info always invalid
 474     case lir_leal:           // input and result always valid, info always invalid
 475     case lir_monaddr:        // input and result always valid, info always invalid


1658      case lir_fld:                   s = "fld";           break;
1659      case lir_ffree:                 s = "ffree";         break;
1660      case lir_push:                  s = "push";          break;
1661      case lir_pop:                   s = "pop";           break;
1662      case lir_null_check:            s = "null_check";    break;
1663      case lir_return:                s = "return";        break;
1664      case lir_safepoint:             s = "safepoint";     break;
1665      case lir_leal:                  s = "leal";          break;
1666      case lir_branch:                s = "branch";        break;
1667      case lir_cond_float_branch:     s = "flt_cond_br";   break;
1668      case lir_move:                  s = "move";          break;
1669      case lir_roundfp:               s = "roundfp";       break;
1670      case lir_rtcall:                s = "rtcall";        break;
1671      case lir_throw:                 s = "throw";         break;
1672      case lir_unwind:                s = "unwind";        break;
1673      case lir_convert:               s = "convert";       break;
1674      case lir_alloc_object:          s = "alloc_obj";     break;
1675      case lir_monaddr:               s = "mon_addr";      break;
1676      case lir_pack64:                s = "pack64";        break;
1677      case lir_unpack64:              s = "unpack64";      break;


1678      // LIR_Op2
1679      case lir_cmp:                   s = "cmp";           break;
1680      case lir_cmp_l2i:               s = "cmp_l2i";       break;
1681      case lir_ucmp_fd2i:             s = "ucomp_fd2i";    break;
1682      case lir_cmp_fd2i:              s = "comp_fd2i";     break;
1683      case lir_cmove:                 s = "cmove";         break;
1684      case lir_add:                   s = "add";           break;
1685      case lir_sub:                   s = "sub";           break;
1686      case lir_mul:                   s = "mul";           break;
1687      case lir_mul_strictfp:          s = "mul_strictfp";  break;
1688      case lir_div:                   s = "div";           break;
1689      case lir_div_strictfp:          s = "div_strictfp";  break;
1690      case lir_rem:                   s = "rem";           break;
1691      case lir_abs:                   s = "abs";           break;
1692      case lir_neg:                   s = "neg";           break;
1693      case lir_sqrt:                  s = "sqrt";          break;
1694      case lir_logic_and:             s = "logic_and";     break;
1695      case lir_logic_or:              s = "logic_or";      break;
1696      case lir_logic_xor:             s = "logic_xor";     break;
1697      case lir_shl:                   s = "shift_left";    break;




  25 #include "precompiled.hpp"
  26 #include "c1/c1_InstructionPrinter.hpp"
  27 #include "c1/c1_LIR.hpp"
  28 #include "c1/c1_LIRAssembler.hpp"
  29 #include "c1/c1_ValueStack.hpp"
  30 #include "ci/ciInstance.hpp"
  31 #include "runtime/sharedRuntime.hpp"
  32 
  33 Register LIR_OprDesc::as_register() const {
  34   return FrameMap::cpu_rnr2reg(cpu_regnr());
  35 }
  36 
  37 Register LIR_OprDesc::as_register_lo() const {
  38   return FrameMap::cpu_rnr2reg(cpu_regnrLo());
  39 }
  40 
  41 Register LIR_OprDesc::as_register_hi() const {
  42   return FrameMap::cpu_rnr2reg(cpu_regnrHi());
  43 }
  44 
  45 
  46 LIR_Opr LIR_OprFact::illegalOpr = LIR_OprFact::illegal();
  47 
  48 LIR_Opr LIR_OprFact::value_type(ValueType* type) {
  49   ValueTag tag = type->tag();
  50   switch (tag) {
  51   case metaDataTag : {
  52     ClassConstant* c = type->as_ClassConstant();
  53     if (c != NULL && !c->value()->is_loaded()) {
  54       return LIR_OprFact::metadataConst(NULL);
  55     } else if (c != NULL) {
  56       return LIR_OprFact::metadataConst(c->value()->constant_encoding());
  57     } else {
  58       MethodConstant* m = type->as_MethodConstant();
  59       assert (m != NULL, "not a class or a method?");
  60       return LIR_OprFact::metadataConst(m->value()->constant_encoding());
  61     }
  62   }
  63   case objectTag : {
  64       return LIR_OprFact::oopConst(type->as_ObjectType()->encoding());
  65     }


 437     case lir_membar_storeload:         // result and info always invalid
 438     case lir_on_spin_wait:
 439     {
 440       assert(op->as_Op0() != NULL, "must be");
 441       assert(op->_info == NULL, "info not used by this instruction");
 442       assert(op->_result->is_illegal(), "not used");
 443       break;
 444     }
 445 
 446     case lir_nop:                      // may have info, result always invalid
 447     case lir_std_entry:                // may have result, info always invalid
 448     case lir_osr_entry:                // may have result, info always invalid
 449     case lir_get_thread:               // may have result, info always invalid
 450     {
 451       assert(op->as_Op0() != NULL, "must be");
 452       if (op->_info != NULL)           do_info(op->_info);
 453       if (op->_result->is_valid())     do_output(op->_result);
 454       break;
 455     }
 456 
 457     case lir_getfp:          // result always valid
 458     case lir_getsp:          // result always valid
 459     {
 460       assert(op->as_Op0() != NULL, "must be");
 461       if (op->_info)                  do_info(op->_info);
 462       if (op->_result->is_valid())    do_output(op->_result);
 463       break;
 464     }
 465 
 466 
 467 
 468 // LIR_OpLabel
 469     case lir_label:                    // result and info always invalid
 470     {
 471       assert(op->as_OpLabel() != NULL, "must be");
 472       assert(op->_info == NULL, "info not used by this instruction");
 473       assert(op->_result->is_illegal(), "not used");
 474       break;
 475     }
 476 
 477 
 478 // LIR_Op1
 479     case lir_fxch:           // input always valid, result and info always invalid
 480     case lir_fld:            // input always valid, result and info always invalid
 481     case lir_ffree:          // input always valid, result and info always invalid
 482     case lir_push:           // input always valid, result and info always invalid
 483     case lir_pop:            // input always valid, result and info always invalid
 484     case lir_return:         // input always valid, result and info always invalid
 485     case lir_leal:           // input and result always valid, info always invalid
 486     case lir_monaddr:        // input and result always valid, info always invalid


1669      case lir_fld:                   s = "fld";           break;
1670      case lir_ffree:                 s = "ffree";         break;
1671      case lir_push:                  s = "push";          break;
1672      case lir_pop:                   s = "pop";           break;
1673      case lir_null_check:            s = "null_check";    break;
1674      case lir_return:                s = "return";        break;
1675      case lir_safepoint:             s = "safepoint";     break;
1676      case lir_leal:                  s = "leal";          break;
1677      case lir_branch:                s = "branch";        break;
1678      case lir_cond_float_branch:     s = "flt_cond_br";   break;
1679      case lir_move:                  s = "move";          break;
1680      case lir_roundfp:               s = "roundfp";       break;
1681      case lir_rtcall:                s = "rtcall";        break;
1682      case lir_throw:                 s = "throw";         break;
1683      case lir_unwind:                s = "unwind";        break;
1684      case lir_convert:               s = "convert";       break;
1685      case lir_alloc_object:          s = "alloc_obj";     break;
1686      case lir_monaddr:               s = "mon_addr";      break;
1687      case lir_pack64:                s = "pack64";        break;
1688      case lir_unpack64:              s = "unpack64";      break;
1689      case lir_getsp:                 s = "getsp";         break;
1690      case lir_getfp:                 s = "getfp";         break;
1691      // LIR_Op2
1692      case lir_cmp:                   s = "cmp";           break;
1693      case lir_cmp_l2i:               s = "cmp_l2i";       break;
1694      case lir_ucmp_fd2i:             s = "ucomp_fd2i";    break;
1695      case lir_cmp_fd2i:              s = "comp_fd2i";     break;
1696      case lir_cmove:                 s = "cmove";         break;
1697      case lir_add:                   s = "add";           break;
1698      case lir_sub:                   s = "sub";           break;
1699      case lir_mul:                   s = "mul";           break;
1700      case lir_mul_strictfp:          s = "mul_strictfp";  break;
1701      case lir_div:                   s = "div";           break;
1702      case lir_div_strictfp:          s = "div_strictfp";  break;
1703      case lir_rem:                   s = "rem";           break;
1704      case lir_abs:                   s = "abs";           break;
1705      case lir_neg:                   s = "neg";           break;
1706      case lir_sqrt:                  s = "sqrt";          break;
1707      case lir_logic_and:             s = "logic_and";     break;
1708      case lir_logic_or:              s = "logic_or";      break;
1709      case lir_logic_xor:             s = "logic_xor";     break;
1710      case lir_shl:                   s = "shift_left";    break;


< prev index next >