hotspot/src/share/vm/ci/ciConstant.hpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File
*** old/hotspot/src/share/vm/ci/ciConstant.hpp	Wed Sep  4 13:51:26 2013
--- new/hotspot/src/share/vm/ci/ciConstant.hpp	Wed Sep  4 13:51:26 2013

*** 39,49 **** --- 39,48 ---- BasicType _type; union { jint _int; jlong _long; jint _long_half[2]; jfloat _float; jdouble _double; ciObject* _object; } _value;
*** 109,118 **** --- 108,131 ---- ciObject* as_object() const { assert(basic_type() == T_OBJECT || basic_type() == T_ARRAY, "wrong type"); return _value._object; } + bool is_null_or_zero() const { + if (!is_java_primitive(basic_type())) { + return as_object()->is_null_object(); + } else if (type2size[basic_type()] == 1) { + // treat float bits as int, to avoid comparison with -0 and NaN + return (_value._int == 0); + } else if (type2size[basic_type()] == 2) { + // treat double bits as long, to avoid comparison with -0 and NaN + return (_value._long == 0); + } else { + return false; + } + } + // Debugging output void print(); }; #endif // SHARE_VM_CI_CICONSTANT_HPP

hotspot/src/share/vm/ci/ciConstant.hpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File