hotspot/src/share/vm/opto/subnode.cpp
changeset 206 d61cf247afd5
parent 1 489c9b5090e2
child 360 21d113ecbf6a
--- a/hotspot/src/share/vm/opto/subnode.cpp	Thu Feb 28 15:40:09 2008 -0800
+++ b/hotspot/src/share/vm/opto/subnode.cpp	Fri Feb 29 09:57:18 2008 -0800
@@ -614,6 +614,13 @@
   const TypeOopPtr* p0 = r0->isa_oopptr();
   const TypeOopPtr* p1 = r1->isa_oopptr();
   if (p0 && p1) {
+    Node* in1 = in(1)->uncast();
+    Node* in2 = in(2)->uncast();
+    AllocateNode* alloc1 = AllocateNode::Ideal_allocation(in1, NULL);
+    AllocateNode* alloc2 = AllocateNode::Ideal_allocation(in2, NULL);
+    if (MemNode::detect_ptr_independence(in1, alloc1, in2, alloc2, NULL)) {
+      return TypeInt::CC_GT;  // different pointers
+    }
     ciKlass* klass0 = p0->klass();
     bool    xklass0 = p0->klass_is_exact();
     ciKlass* klass1 = p1->klass();