diff src/share/vm/ci/ciConstant.hpp @ 12190:edb5ab0f3fe5

8001107: @Stable annotation for constant folding of lazily evaluated variables Reviewed-by: rbackman, twisti, kvn Contributed-by: john.r.rose@oracle.com, vladimir.x.ivanov@oracle.com
author vlivanov
date Tue, 10 Sep 2013 14:51:48 -0700
parents f6f3bb0ee072
children de6a9e811145
line wrap: on
line diff
--- a/src/share/vm/ci/ciConstant.hpp	Mon Sep 09 19:53:28 2013 +0200
+++ b/src/share/vm/ci/ciConstant.hpp	Tue Sep 10 14:51:48 2013 -0700
@@ -41,7 +41,6 @@
   union {
     jint      _int;
     jlong     _long;
-    jint      _long_half[2];
     jfloat    _float;
     jdouble   _double;
     ciObject* _object;
@@ -111,6 +110,20 @@
     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();
 };