changeset 43956:3567eee750f2

8172434: CompareAndExchangeObject inserts two pre-barriers Reviewed-by: kvn
author rkennke
date Tue, 14 Feb 2017 12:31:11 -0800
parents ba1071ebd14b
children 9ae31c0b2148
files hotspot/src/share/vm/opto/library_call.cpp
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/hotspot/src/share/vm/opto/library_call.cpp	Tue Feb 14 01:32:38 2017 +0100
+++ b/hotspot/src/share/vm/opto/library_call.cpp	Tue Feb 14 12:31:11 2017 -0800
@@ -3017,7 +3017,7 @@
       load_store = _gvn.transform(new DecodeNNode(load_store, load_store->get_ptr_type()));
     }
 #endif
-    if (can_move_pre_barrier()) {
+    if (can_move_pre_barrier() && kind == LS_get_set) {
       // Don't need to load pre_val. The old value is returned by load_store.
       // The pre_barrier can execute after the xchg as long as no safepoint
       // gets inserted between them.