8176513: Poor code quality for ByteBuffers
authorroland
Wed, 15 Mar 2017 18:18:04 -0700
changeset 44324 603ea5dbf961
parent 44323 1566bea4793a
child 44325 adbcb44aa685
child 44403 1b4e73257070
8176513: Poor code quality for ByteBuffers Summary: Relaxes the condition under which MemBarCPUOrder nodes are added around unsafe accesses. Reviewed-by: vlivanov, kvn, jrose
hotspot/src/share/vm/opto/library_call.cpp
--- a/hotspot/src/share/vm/opto/library_call.cpp	Wed Mar 15 13:03:13 2017 +0100
+++ b/hotspot/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.