< prev index next >

src/hotspot/share/c1/c1_Instruction.cpp

Print this page

@@ -145,11 +145,11 @@
   }
 
   return false;
 }
 
-bool Instruction::maybe_flattened_array() const {
+bool Instruction::maybe_flattened_array() {
   if (ValueArrayFlatten) {
     ciType* type = declared_type();
     if (type != NULL) {
       if (type->is_value_array_klass()) {
         ciValueKlass* element_klass = type->as_value_array_klass()->element_klass()->as_value_klass();

@@ -165,10 +165,14 @@
           //    (ValueType[] <: <any interface>[])
           // We will add a runtime check for flat-ness.
           return true;
         }
       }
+    } else if (as_Phi() != NULL) {
+      // Type info gets lost during Phi merging, but we might be storing into a
+      // flattened array, so we should do a runtime check.
+      return true;
     }
   }
 
   return false;
 }
< prev index next >