7184649: NPG: Implement another MetdataPtr case
authorroland
Tue, 04 Sep 2012 23:27:55 +0200
changeset 13731 6c79c797ca4c
parent 13730 df5705977fc5
child 13732 a9865f5514fc
7184649: NPG: Implement another MetdataPtr case Summary: xmeet when both inputs are MetadataPtr. Reviewed-by: kvn
hotspot/src/share/vm/opto/type.cpp
--- a/hotspot/src/share/vm/opto/type.cpp	Tue Sep 04 13:01:03 2012 +0200
+++ b/hotspot/src/share/vm/opto/type.cpp	Tue Sep 04 23:27:55 2012 +0200
@@ -3913,10 +3913,25 @@
   case AryPtr:
     return TypePtr::BOTTOM;     // Oop meet raw is not well defined
 
-  case MetadataPtr:
-    ShouldNotReachHere();
+  case MetadataPtr: {
+    const TypeMetadataPtr *tp = t->is_metadataptr();
+    int offset = meet_offset(tp->offset());
+    PTR tptr = tp->ptr();
+    PTR ptr = meet_ptr(tptr);
+    ciMetadata* md = (tptr == TopPTR) ? metadata() : tp->metadata();
+    if (tptr == TopPTR || _ptr == TopPTR ||
+        metadata()->equals(tp->metadata())) {
+      return make(ptr, md, offset);
+    }
+    // metadata is different
+    if( ptr == Constant ) {  // Cannot be equal constants, so...
+      if( tptr == Constant && _ptr != Constant)  return t;
+      if( _ptr == Constant && tptr != Constant)  return this;
+      ptr = NotNull;            // Fall down in lattice
+    }
+    return make(ptr, NULL, offset);
     break;
-
+  }
   } // End of switch
   return this;                  // Return the double constant
 }