--- old/src/hotspot/share/utilities/singleWriterSynchronizer.cpp 2019-11-21 11:58:41.596524575 +0100 +++ new/src/hotspot/share/utilities/singleWriterSynchronizer.cpp 2019-11-21 11:58:41.164517281 +0100 @@ -44,7 +44,7 @@ // synchronization have exited that critical section. void SingleWriterSynchronizer::synchronize() { // Side-effect in assert balanced by debug-only dec at end. - assert(Atomic::add(1u, &_writers) == 1u, "multiple writers"); + assert(Atomic::add(&_writers, 1u) == 1u, "multiple writers"); // We don't know anything about the muxing between this invocation // and invocations in other threads. We must start with the latest // _enter polarity, else we could clobber the wrong _exit value on @@ -64,7 +64,7 @@ do { old = value; *new_ptr = ++value; - value = Atomic::cmpxchg(value, &_enter, old); + value = Atomic::cmpxchg(&_enter, old, value); } while (old != value); // Critical sections entered before we changed the polarity will use // the old exit counter. Critical sections entered after the change