changeset 12695:03f4b62f3562

8176513: Poor code quality for ByteBuffers Summary: Relaxes the condition under which MemBarCPUOrder nodes are added around unsafe accesses. Reviewed-by: vlivanov, kvn, jrose
author roland
date Wed, 15 Mar 2017 18:18:04 -0700
parents 03ca64e4447c
children fa10bec35262 d2724225519c
files src/share/vm/opto/library_call.cpp
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/vm/opto/library_call.cpp	Wed Mar 15 13:03:13 2017 +0100
+++ b/src/share/vm/opto/library_call.cpp	Wed Mar 15 18:18:04 2017 -0700
@@ -2375,7 +2375,7 @@
   bool need_mem_bar;
   switch (kind) {
       case Relaxed:
-          need_mem_bar = mismatched || can_access_non_heap;
+          need_mem_bar = mismatched && !adr_type->isa_aryptr();
           break;
       case Opaque:
           // Opaque uses CPUOrder membars for protection against code movement.