src/hotspot/share/gc/shenandoah/shenandoahHeap.inline.hpp
changeset 59252 623722a6aeb9
parent 59249 29b0d0b61615
child 59296 9186be5c78ba
--- a/src/hotspot/share/gc/shenandoah/shenandoahHeap.inline.hpp	Mon Nov 25 12:32:40 2019 +0100
+++ b/src/hotspot/share/gc/shenandoah/shenandoahHeap.inline.hpp	Mon Nov 25 12:33:15 2019 +0100
@@ -131,20 +131,20 @@
 
 inline oop ShenandoahHeap::cas_oop(oop n, oop* addr, oop c) {
   assert(is_aligned(addr, HeapWordSize), "Address should be aligned: " PTR_FORMAT, p2i(addr));
-  return (oop) Atomic::cmpxchg(n, addr, c);
+  return (oop) Atomic::cmpxchg(addr, c, n);
 }
 
 inline oop ShenandoahHeap::cas_oop(oop n, narrowOop* addr, narrowOop c) {
   assert(is_aligned(addr, sizeof(narrowOop)), "Address should be aligned: " PTR_FORMAT, p2i(addr));
   narrowOop val = CompressedOops::encode(n);
-  return CompressedOops::decode((narrowOop) Atomic::cmpxchg(val, addr, c));
+  return CompressedOops::decode((narrowOop) Atomic::cmpxchg(addr, c, val));
 }
 
 inline oop ShenandoahHeap::cas_oop(oop n, narrowOop* addr, oop c) {
   assert(is_aligned(addr, sizeof(narrowOop)), "Address should be aligned: " PTR_FORMAT, p2i(addr));
   narrowOop cmp = CompressedOops::encode(c);
   narrowOop val = CompressedOops::encode(n);
-  return CompressedOops::decode((narrowOop) Atomic::cmpxchg(val, addr, cmp));
+  return CompressedOops::decode((narrowOop) Atomic::cmpxchg(addr, cmp, val));
 }
 
 template <class T>