src/hotspot/share/gc/g1/g1ConcurrentMark.cpp
changeset 59252 623722a6aeb9
parent 59249 29b0d0b61615
child 59290 97d13893ec3c
--- a/src/hotspot/share/gc/g1/g1ConcurrentMark.cpp	Mon Nov 25 12:32:40 2019 +0100
+++ b/src/hotspot/share/gc/g1/g1ConcurrentMark.cpp	Mon Nov 25 12:33:15 2019 +0100
@@ -1906,7 +1906,7 @@
     HeapWord* end = curr_region != NULL ? curr_region->end() : finger + HeapRegion::GrainWords;
 
     // Is the gap between reading the finger and doing the CAS too long?
-    HeapWord* res = Atomic::cmpxchg(end, &_finger, finger);
+    HeapWord* res = Atomic::cmpxchg(&_finger, finger, end);
     if (res == finger && curr_region != NULL) {
       // we succeeded
       HeapWord*   bottom        = curr_region->bottom();