< prev index next >

src/share/vm/opto/macro.cpp

Print this page
rev 9640 : 8144993: Elide redundant memory barrier after AllocationNode
Summary: Elide memory barrier for AllocationNode when it doesn't escape in initializer and has an MemBarRelease node at exit of initializer method.
Reviewed-by: duke

@@ -1525,10 +1525,11 @@
     // escape no need for a MemBarStoreStore. Otherwise we need a
     // MemBarStoreStore so that stores that initialize this object
     // can't be reordered with a subsequent store that makes this
     // object accessible by other threads.
     if (!alloc->does_not_escape_thread() &&
+        !alloc->is_allocation_MemBar_redundant() &&
         (init == NULL || !init->is_complete_with_arraycopy())) {
       if (init == NULL || init->req() < InitializeNode::RawStores) {
         // No InitializeNode or no stores captured by zeroing
         // elimination. Simply add the MemBarStoreStore after object
         // initialization.
< prev index next >