changeset 55130:9873d841ee27 lworld

[lworld] Refactored some comments around LW2 array support in C2
author thartmann
date Thu, 16 May 2019 11:33:42 +0200
parents 784781105f6b
children 5cf4da6cdb10
files src/hotspot/share/opto/compile.cpp src/hotspot/share/opto/memnode.cpp src/hotspot/share/opto/subnode.cpp
diffstat 3 files changed, 7 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/src/hotspot/share/opto/compile.cpp	Wed May 15 14:23:01 2019 +0200
+++ b/src/hotspot/share/opto/compile.cpp	Thu May 16 11:33:42 2019 +0200
@@ -4304,8 +4304,8 @@
   ciType* superelem = superk;
   if (superelem->is_array_klass()) {
     ciArrayKlass* ak = superelem->as_array_klass();
-    // Do not perform the subtype check on the element klasses for [V? arrays. The runtime type might
-    // be [V due to [V <: [V? and the klass for [V? and [V is the same but the component mirror is not.
+    // Do not fold the subtype check to an array klass pointer comparison for [V? arrays.
+    // [V is a subtype of [V? but the klass for [V is not equal to the klass for [V?. Perform a full test.
     if (ak->is_obj_array_klass() && !ak->storage_properties().is_null_free() && ak->element_klass()->is_valuetype()) {
       return SSC_full_test;
     }
--- a/src/hotspot/share/opto/memnode.cpp	Wed May 15 14:23:01 2019 +0200
+++ b/src/hotspot/share/opto/memnode.cpp	Thu May 16 11:33:42 2019 +0200
@@ -2258,7 +2258,8 @@
     if (tary_klass != NULL   // can be NULL when at BOTTOM or TOP
         && tary->offset() == oopDesc::klass_offset_in_bytes()) {
       ciArrayKlass* ak = tary_klass->as_array_klass();
-      // Do not fold klass loads from [V? because the runtime type might be [V due to [V <: [V?
+      // Do not fold klass loads from [V?. The runtime type might be [V due to [V <: [V?
+      // and the klass for [V is not equal to the klass for [V?.
       bool can_be_null_free = !tary->is_known_instance() && ak->is_obj_array_klass() && !ak->storage_properties().is_null_free() && ak->element_klass()->is_valuetype();
 
       if (tary->klass_is_exact() && !can_be_null_free) {
--- a/src/hotspot/share/opto/subnode.cpp	Wed May 15 14:23:01 2019 +0200
+++ b/src/hotspot/share/opto/subnode.cpp	Thu May 16 11:33:42 2019 +0200
@@ -1068,11 +1068,12 @@
   if (con2 != (intptr_t) superklass->super_check_offset())
     return NULL;                // Might be element-klass loading from array klass
 
-  // Do not normalize comparisons between Java mirror loads from [V? to klass comparisons. The runtime type
-  // might be [V due to [V <: [V? and the klass for [V? and [V is the same but the component mirror is not.
+  // Do not fold the subtype check to an array klass pointer comparison for [V? arrays.
+  // [V is a subtype of [V? but the klass for [V is not equal to the klass for [V?. Perform a full test.
   if (superklass->is_obj_array_klass()) {
     ciObjArrayKlass* ak = superklass->as_obj_array_klass();
     if (!ak->storage_properties().is_null_free() && ak->element_klass()->is_valuetype()) {
+      // Do not bypass the klass load from the primary supertype array
       return NULL;
     }
   }