changeset 53973:1049b319f14c lworld

allow substituability test when EnableValhalla is false
author roland
date Mon, 28 Jan 2019 15:15:45 +0100
parents 4bd0c15e9a63
children 86d31e02427e
files src/hotspot/share/opto/mulnode.cpp src/hotspot/share/opto/parse2.cpp src/hotspot/share/opto/type.hpp src/hotspot/share/runtime/arguments.cpp
diffstat 4 files changed, 10 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/src/hotspot/share/opto/mulnode.cpp	Tue Jan 29 16:00:40 2019 +0530
+++ b/src/hotspot/share/opto/mulnode.cpp	Mon Jan 28 15:15:45 2019 +0100
@@ -598,7 +598,7 @@
     }
 
     if (con == markOopDesc::always_locked_pattern) {
-      assert(EnableValhalla, "should only be used for value types");
+      assert(EnableValhalla || ACmpOnValues == 3, "should only be used for value types");
       if (in(1)->is_Load() && phase->type(in(1)->in(MemNode::Address))->is_valuetypeptr()) {
         return in(2); // Obj is known to be a value type
       }
--- a/src/hotspot/share/opto/parse2.cpp	Tue Jan 29 16:00:40 2019 +0530
+++ b/src/hotspot/share/opto/parse2.cpp	Mon Jan 28 15:15:45 2019 +0100
@@ -1820,7 +1820,7 @@
   // If current method is ValueBootstrapMethods::isSubstitutable(),
   // compile the acmp as a regular pointer comparison otherwise we
   // could call ValueBootstrapMethods::isSubstitutable() back
-  if (ACmpOnValues == 0 || !EnableValhalla || method() == subst_method) {
+  if (ACmpOnValues == 0 || method() == subst_method) {
     Node* cmp = CmpP(a, b);
     cmp = optimize_cmp_with_klass(cmp);
     do_if(btest, cmp);
@@ -1843,8 +1843,8 @@
     const TypeOopPtr* ta = _gvn.type(a)->isa_oopptr();
     const TypeOopPtr* tb = _gvn.type(b)->isa_oopptr();
 
-    if (ta == NULL || !ta->can_be_value_type() ||
-        tb == NULL || !tb->can_be_value_type()) {
+    if (ta == NULL || !ta->can_be_value_type_raw() ||
+        tb == NULL || !tb->can_be_value_type_raw()) {
       Node* cmp = CmpP(a, b);
       cmp = optimize_cmp_with_klass(cmp);
       do_if(btest, cmp);
--- a/src/hotspot/share/opto/type.hpp	Tue Jan 29 16:00:40 2019 +0530
+++ b/src/hotspot/share/opto/type.hpp	Mon Jan 28 15:15:45 2019 +0100
@@ -1094,7 +1094,8 @@
   int  instance_id()             const { return _instance_id; }
   bool is_known_instance_field() const { return is_known_instance() && _offset.get() >= 0; }
 
-  virtual bool can_be_value_type() const { return EnableValhalla && (_klass == NULL || _klass->is_valuetype() || ((_klass->is_java_lang_Object() || _klass->is_interface()) && !klass_is_exact())); }
+  virtual bool can_be_value_type() const { return EnableValhalla && can_be_value_type_raw(); }
+  virtual bool can_be_value_type_raw() const { return _klass == NULL || _klass->is_valuetype() || ((_klass->is_java_lang_Object() || _klass->is_interface()) && !klass_is_exact()); }
 
   virtual intptr_t get_con() const;
 
--- a/src/hotspot/share/runtime/arguments.cpp	Tue Jan 29 16:00:40 2019 +0530
+++ b/src/hotspot/share/runtime/arguments.cpp	Mon Jan 28 15:15:45 2019 +0100
@@ -2076,7 +2076,10 @@
   } else {
     FLAG_SET_CMDLINE(bool, ValueArrayFlatten, false);
   }
-
+  if (!EnableValhalla && ACmpOnValues != 3) {
+    FLAG_SET_CMDLINE(uint, ACmpOnValues, 0);
+  }
+  
   return status;
 }