--- old/src/hotspot/share/gc/g1/g1HotCardCache.cpp 2019-11-21 11:55:00.552789828 +0100 +++ new/src/hotspot/share/gc/g1/g1HotCardCache.cpp 2019-11-21 11:55:00.300785567 +0100 @@ -78,9 +78,9 @@ // card_ptr in favor of the other option, which would be starting over. This // should be OK since card_ptr will likely be the older card already when/if // this ever happens. - CardValue* previous_ptr = Atomic::cmpxchg(card_ptr, - &_hot_cache[masked_index], - current_ptr); + CardValue* previous_ptr = Atomic::cmpxchg(&_hot_cache[masked_index], + current_ptr, + card_ptr); return (previous_ptr == current_ptr) ? previous_ptr : card_ptr; }