--- old/src/hotspot/share/gc/shenandoah/shenandoahCollectionSet.cpp 2019-11-21 11:55:12.168986233 +0100 +++ new/src/hotspot/share/gc/shenandoah/shenandoahCollectionSet.cpp 2019-11-21 11:55:11.912981905 +0100 @@ -146,7 +146,7 @@ while(index < num_regions) { if (is_in(index)) { - jint cur = Atomic::cmpxchg((jint)(index + 1), &_current_index, saved_current); + jint cur = Atomic::cmpxchg(&_current_index, saved_current, (jint)(index + 1)); assert(cur >= (jint)saved_current, "Must move forward"); if (cur == saved_current) { assert(is_in(index), "Invariant");