< prev index next >

src/hotspot/share/opto/macro.cpp

Print this page
rev 53300 : 8246153: TestEliminateArrayCopy fails with -XX:+StressReflectiveCode
Summary: Use the memory input instead of the control input to find the membar.
Reviewed-by: kvn, neliasso

@@ -944,12 +944,12 @@
             // Disconnect ArrayCopy node
             ArrayCopyNode* ac = n->as_ArrayCopy();
             assert(ac->is_clonebasic(), "unexpected array copy kind");
             Node* membar_after = ac->proj_out(TypeFunc::Control)->unique_ctrl_out();
             disconnect_projections(ac, _igvn);
-            assert(alloc->in(0)->is_Proj() && alloc->in(0)->in(0)->Opcode() == Op_MemBarCPUOrder, "mem barrier expected before allocation");
-            Node* membar_before = alloc->in(0)->in(0);
+            assert(alloc->in(TypeFunc::Memory)->is_Proj() && alloc->in(TypeFunc::Memory)->in(0)->Opcode() == Op_MemBarCPUOrder, "mem barrier expected before allocation");
+            Node* membar_before = alloc->in(TypeFunc::Memory)->in(0);
             disconnect_projections(membar_before->as_MemBar(), _igvn);
             if (membar_after->is_MemBar()) {
               disconnect_projections(membar_after->as_MemBar(), _igvn);
             }
           } else {
< prev index next >