8176513: Poor code quality for ByteBuffers

Relaxes the condition under which MemBarCPUOrder nodes are added around unsafe accesses.

Reviewed-by: vlivanov, kvn, jrose
This commit is contained in:
Roland Westrelin 2017-03-15 18:18:04 -07:00
parent c40d2d5af7
commit 23ef045ab2

View File

@ -2375,7 +2375,7 @@ bool LibraryCallKit::inline_unsafe_access(bool is_store, const BasicType type, c
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.