< prev index next >

src/hotspot/share/ci/ciConstant.cpp

Print this page

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













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

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