--- old/src/hotspot/share/services/mallocSiteTable.cpp 2019-11-21 11:55:41.009473798 +0100 +++ new/src/hotspot/share/services/mallocSiteTable.cpp 2019-11-21 11:55:40.797470215 +0100 @@ -128,7 +128,7 @@ if (entry == NULL) return NULL; // swap in the head - if (Atomic::replace_if_null(entry, &_table[index])) { + if (Atomic::replace_if_null(&_table[index], entry)) { return entry->data(); } @@ -229,7 +229,7 @@ do { val = *_lock; target = _MAGIC_ + *_lock; - } while (Atomic::cmpxchg(target, _lock, val) != val); + } while (Atomic::cmpxchg(_lock, val, target) != val); // wait for all readers to exit while (*_lock != _MAGIC_) { @@ -243,5 +243,5 @@ } bool MallocSiteHashtableEntry::atomic_insert(MallocSiteHashtableEntry* entry) { - return Atomic::replace_if_null(entry, &_next); + return Atomic::replace_if_null(&_next, entry); }