< prev index next >

src/hotspot/share/ci/ciTypeFlow.cpp

Print this page

        

@@ -271,16 +271,10 @@
 //   kind is their least common ancestor.  The meet of two types of
 //   different kinds is always java.lang.Object.
 ciType* ciTypeFlow::StateVector::type_meet_internal(ciType* t1, ciType* t2, ciTypeFlow* analyzer) {
   assert(t1 != t2, "checked in caller");
 
-  // Unwrap the types after gathering nullness information
-  bool never_null1 = t1->is_never_null();
-  bool never_null2 = t2->is_never_null();
-  t1 = t1->unwrap();
-  t2 = t2->unwrap();
-
   if (t1->equals(top_type())) {
     return t2;
   } else if (t2->equals(top_type())) {
     return t1;
   } else if (t1->is_primitive_type() || t2->is_primitive_type()) {

@@ -297,11 +291,18 @@
     }
 
     // At least one of the two types is a non-top primitive type.
     // The other type is not equal to it.  Fall to bottom.
     return bottom_type();
-  } else {
+  }
+
+  // Unwrap the types after gathering nullness information
+  bool never_null1 = t1->is_never_null();
+  bool never_null2 = t2->is_never_null();
+  t1 = t1->unwrap();
+  t2 = t2->unwrap();
+
     // Both types are non-top non-primitive types.  That is,
     // both types are either instanceKlasses or arrayKlasses.
     ciKlass* object_klass = analyzer->env()->Object_klass();
     ciKlass* k1 = t1->as_klass();
     ciKlass* k2 = t2->as_klass();

@@ -351,11 +352,10 @@
         // Both value types are never null, mark the result as never null
         result = analyzer->mark_as_never_null(result);
       }
       return result;
     }
-  }
 }
 
 
 // ------------------------------------------------------------------
 // ciTypeFlow::StateVector::StateVector

@@ -628,10 +628,11 @@
     pop_object();
     do_null_assert(klass);
   } else {
     pop_object();
     if (str->get_never_null()) {
+      // Casting to a Q-Type contains a NULL check
       assert(klass->is_valuetype(), "must be a value type");
       push(outer()->mark_as_never_null(klass));
     } else {
       push_object(klass);
     }

@@ -771,11 +772,11 @@
     // OutOfMemoryError in the CI while loading constant
     push_null();
     outer()->record_failure("ldc did not link");
     return;
   }
-  if (basic_type == T_OBJECT || basic_type == T_OBJECT || basic_type == T_ARRAY) {
+  if (basic_type == T_OBJECT || basic_type == T_VALUETYPE || basic_type == T_ARRAY) {
     ciObject* obj = con.as_object();
     if (obj->is_null_object()) {
       push_null();
     } else {
       assert(obj->is_instance() || obj->is_array(), "must be java_mirror of klass");
< prev index next >