< prev index next >

src/hotspot/share/ci/ciConstant.cpp

Print this page

 43     // treat double bits as long, to avoid comparison with -0 and NaN
 44     return (_value._long == 0);
 45   } else {
 46     return false;
 47   }
 48 }
 49 
 50 // ------------------------------------------------------------------
 51 // ciConstant::is_loaded
 52 bool ciConstant::is_loaded() const {
 53   if (is_valid()) {
 54     if (is_reference_type(basic_type())) {
 55       return as_object()->is_loaded();
 56     } else {
 57       return true;
 58     }
 59   }
 60   return false;
 61 }
 62 













 63 // ------------------------------------------------------------------
 64 // ciConstant::print
 65 void ciConstant::print() {
 66   tty->print("<ciConstant type=%s value=",
 67              basictype_to_str(basic_type()));
 68   switch (basic_type()) {
 69   case T_BOOLEAN:
 70     tty->print("%s", bool_to_str(_value._int != 0));
 71     break;
 72   case T_CHAR:
 73   case T_BYTE:
 74   case T_SHORT:
 75   case T_INT:
 76     tty->print("%d", _value._int);
 77     break;
 78   case T_LONG:
 79     tty->print(INT64_FORMAT, (int64_t)(_value._long));
 80     break;
 81   case T_FLOAT:
 82     tty->print("%f", _value._float);

 43     // treat double bits as long, to avoid comparison with -0 and NaN
 44     return (_value._long == 0);
 45   } else {
 46     return false;
 47   }
 48 }
 49 
 50 // ------------------------------------------------------------------
 51 // ciConstant::is_loaded
 52 bool ciConstant::is_loaded() const {
 53   if (is_valid()) {
 54     if (is_reference_type(basic_type())) {
 55       return as_object()->is_loaded();
 56     } else {
 57       return true;
 58     }
 59   }
 60   return false;
 61 }
 62 
 63 // ------------------------------------------------------------------
 64 // ciConstant::should_be_constant
 65 bool ciConstant::should_be_constant() const {
 66   if (is_valid()) {
 67     if (is_reference_type(basic_type())) {
 68       return as_object()->should_be_constant();
 69     } else {
 70       return true;
 71     }
 72   }
 73   return false;
 74 }
 75 
 76 // ------------------------------------------------------------------
 77 // ciConstant::print
 78 void ciConstant::print() {
 79   tty->print("<ciConstant type=%s value=",
 80              basictype_to_str(basic_type()));
 81   switch (basic_type()) {
 82   case T_BOOLEAN:
 83     tty->print("%s", bool_to_str(_value._int != 0));
 84     break;
 85   case T_CHAR:
 86   case T_BYTE:
 87   case T_SHORT:
 88   case T_INT:
 89     tty->print("%d", _value._int);
 90     break;
 91   case T_LONG:
 92     tty->print(INT64_FORMAT, (int64_t)(_value._long));
 93     break;
 94   case T_FLOAT:
 95     tty->print("%f", _value._float);
< prev index next >