8172434: CompareAndExchangeObject inserts two pre-barriers
authorrkennke
Tue, 14 Feb 2017 12:31:11 -0800
changeset 43956 3567eee750f2
parent 43955 ba1071ebd14b
child 43957 9ae31c0b2148
8172434: CompareAndExchangeObject inserts two pre-barriers Reviewed-by: kvn
hotspot/src/share/vm/opto/library_call.cpp
--- 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.