< prev index next >

src/hotspot/share/opto/escape.cpp

Print this page

        

@@ -670,15 +670,15 @@
       Node* adr = n->in(MemNode::Address);
       if (opcode == Op_GetAndSetP || opcode == Op_GetAndSetN ||
           opcode == Op_CompareAndExchangeN || opcode == Op_CompareAndExchangeP) {
         add_local_var_and_edge(n, PointsToNode::NoEscape, adr, NULL);
       }
-      if (!add_final_edges_unsafe_access(n, opcode)) {
-        ELSE_FAIL("Op_StoreP");
-      }
+      if (add_final_edges_unsafe_access(n, opcode)) {
       break;
     }
+      ELSE_FAIL("Op_StoreP");
+    }
     case Op_AryEq:
     case Op_HasNegatives:
     case Op_StrComp:
     case Op_StrEquals:
     case Op_StrIndexOf:

@@ -755,20 +755,25 @@
   }
 }
 
 bool ConnectionGraph::add_final_edges_unsafe_access(Node* n, uint opcode) {
   Node* adr = n->in(MemNode::Address);
-  const Type* adr_type = _igvn->type(adr);
+  const Type *adr_type = _igvn->type(adr);
   adr_type = adr_type->make_ptr();
 #ifdef ASSERT
   if (adr_type == NULL) {
     n->dump(1);
     assert(adr_type != NULL, "dead node should not be on list");
     return true;
   }
 #endif
 
+  if (opcode == Op_GetAndSetP || opcode == Op_GetAndSetN ||
+      opcode == Op_CompareAndExchangeN || opcode == Op_CompareAndExchangeP) {
+    add_local_var_and_edge(n, PointsToNode::NoEscape, adr, NULL);
+  }
+
   if (adr_type->isa_oopptr()
       || ((opcode == Op_StoreP || opcode == Op_StoreN || opcode == Op_StoreNKlass)
            && adr_type == TypeRawPtr::NOTNULL
            && adr->in(AddPNode::Address)->is_Proj()
            && adr->in(AddPNode::Address)->in(0)->is_Allocate())) {
< prev index next >