changeset 3605:ca11db66f9de

7184649: NPG: Implement another MetdataPtr case Summary: xmeet when both inputs are MetadataPtr. Reviewed-by: kvn
author roland
date Tue, 04 Sep 2012 23:27:55 +0200
parents 46c017102631
children d17383603741
files src/share/vm/opto/type.cpp
diffstat 1 files changed, 18 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/vm/opto/type.cpp	Tue Sep 04 13:01:03 2012 +0200
+++ b/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
 }