< prev index next >

src/hotspot/share/c1/c1_LIR.cpp

Print this page

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

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

 414     case lir_membar_storeload:         // result and info always invalid
 415     case lir_on_spin_wait:
 416     {
 417       assert(op->as_Op0() != NULL, "must be");
 418       assert(op->_info == NULL, "info not used by this instruction");
 419       assert(op->_result->is_illegal(), "not used");
 420       break;
 421     }
 422 
 423     case lir_nop:                      // may have info, result always invalid
 424     case lir_std_entry:                // may have result, info always invalid
 425     case lir_osr_entry:                // may have result, info always invalid
 426     case lir_get_thread:               // may have result, info always invalid
 427     {
 428       assert(op->as_Op0() != NULL, "must be");
 429       if (op->_info != NULL)           do_info(op->_info);
 430       if (op->_result->is_valid())     do_output(op->_result);
 431       break;
 432     }
 433 
 434 
 435 // LIR_OpLabel
 436     case lir_label:                    // result and info always invalid
 437     {
 438       assert(op->as_OpLabel() != NULL, "must be");
 439       assert(op->_info == NULL, "info not used by this instruction");
 440       assert(op->_result->is_illegal(), "not used");
 441       break;
 442     }
 443 
 444 
 445 // LIR_Op1
 446     case lir_fxch:           // input always valid, result and info always invalid
 447     case lir_fld:            // input always valid, result and info always invalid
 448     case lir_push:           // input always valid, result and info always invalid
 449     case lir_pop:            // input always valid, result and info always invalid
 450     case lir_leal:           // input and result always valid, info always invalid
 451     case lir_monaddr:        // input and result always valid, info always invalid
 452     case lir_null_check:     // input and info always valid, result always invalid
 453     case lir_move:           // input and result always valid, may have info
 454     {

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

 415     case lir_membar_storeload:         // result and info always invalid
 416     case lir_on_spin_wait:
 417     {
 418       assert(op->as_Op0() != NULL, "must be");
 419       assert(op->_info == NULL, "info not used by this instruction");
 420       assert(op->_result->is_illegal(), "not used");
 421       break;
 422     }
 423 
 424     case lir_nop:                      // may have info, result always invalid
 425     case lir_std_entry:                // may have result, info always invalid
 426     case lir_osr_entry:                // may have result, info always invalid
 427     case lir_get_thread:               // may have result, info always invalid
 428     {
 429       assert(op->as_Op0() != NULL, "must be");
 430       if (op->_info != NULL)           do_info(op->_info);
 431       if (op->_result->is_valid())     do_output(op->_result);
 432       break;
 433     }
 434 

 435 // LIR_OpLabel
 436     case lir_label:                    // result and info always invalid
 437     {
 438       assert(op->as_OpLabel() != NULL, "must be");
 439       assert(op->_info == NULL, "info not used by this instruction");
 440       assert(op->_result->is_illegal(), "not used");
 441       break;
 442     }
 443 
 444 
 445 // LIR_Op1
 446     case lir_fxch:           // input always valid, result and info always invalid
 447     case lir_fld:            // input always valid, result and info always invalid
 448     case lir_push:           // input always valid, result and info always invalid
 449     case lir_pop:            // input always valid, result and info always invalid
 450     case lir_leal:           // input and result always valid, info always invalid
 451     case lir_monaddr:        // input and result always valid, info always invalid
 452     case lir_null_check:     // input and info always valid, result always invalid
 453     case lir_move:           // input and result always valid, may have info
 454     {
< prev index next >