109 ciObject* as_object() const { |
108 ciObject* as_object() const { |
110 assert(basic_type() == T_OBJECT || basic_type() == T_ARRAY, "wrong type"); |
109 assert(basic_type() == T_OBJECT || basic_type() == T_ARRAY, "wrong type"); |
111 return _value._object; |
110 return _value._object; |
112 } |
111 } |
113 |
112 |
|
113 bool is_null_or_zero() const { |
|
114 if (!is_java_primitive(basic_type())) { |
|
115 return as_object()->is_null_object(); |
|
116 } else if (type2size[basic_type()] == 1) { |
|
117 // treat float bits as int, to avoid comparison with -0 and NaN |
|
118 return (_value._int == 0); |
|
119 } else if (type2size[basic_type()] == 2) { |
|
120 // treat double bits as long, to avoid comparison with -0 and NaN |
|
121 return (_value._long == 0); |
|
122 } else { |
|
123 return false; |
|
124 } |
|
125 } |
|
126 |
114 // Debugging output |
127 // Debugging output |
115 void print(); |
128 void print(); |
116 }; |
129 }; |
117 |
130 |
118 #endif // SHARE_VM_CI_CICONSTANT_HPP |
131 #endif // SHARE_VM_CI_CICONSTANT_HPP |