--- old/src/hotspot/share/services/mallocSiteTable.cpp 2017-10-10 17:36:49.777841014 -0400 +++ new/src/hotspot/share/services/mallocSiteTable.cpp 2017-10-10 17:36:49.147868811 -0400 @@ -147,7 +147,7 @@ if (entry == NULL) return NULL; // swap in the head - if (Atomic::cmpxchg_ptr((void*)entry, (volatile void *)&_table[index], NULL) == NULL) { + if (Atomic::cmpxchg_if_null(entry, &_table[index])) { return entry->data(); } @@ -257,3 +257,7 @@ } _lock_state = ExclusiveLock; } + +bool MallocSiteHashtableEntry::atomic_insert(const MallocSiteHashtableEntry* entry) { + return Atomic::cmpxchg_if_null(entry, (const MallocSiteHashtableEntry**)&_next); +}