--- old/src/hotspot/share/runtime/os.cpp 2019-11-21 11:58:29.092313451 +0100 +++ new/src/hotspot/share/runtime/os.cpp 2019-11-21 11:58:28.656306088 +0100 @@ -668,7 +668,7 @@ if ((cur_malloc_words + words) > MallocMaxTestWords) { return true; } - Atomic::add(words, &cur_malloc_words); + Atomic::add(&cur_malloc_words, words); } return false; } @@ -855,7 +855,7 @@ while (true) { unsigned int seed = _rand_seed; unsigned int rand = random_helper(seed); - if (Atomic::cmpxchg(rand, &_rand_seed, seed) == seed) { + if (Atomic::cmpxchg(&_rand_seed, seed, rand) == seed) { return static_cast(rand); } } @@ -1804,7 +1804,7 @@ os::SuspendResume::State os::SuspendResume::switch_state(os::SuspendResume::State from, os::SuspendResume::State to) { - os::SuspendResume::State result = Atomic::cmpxchg(to, &_state, from); + os::SuspendResume::State result = Atomic::cmpxchg(&_state, from, to); if (result == from) { // success return to;