--- a/src/hotspot/share/classfile/classLoaderData.cpp Wed Feb 21 23:30:01 2018 -0500
+++ b/src/hotspot/share/classfile/classLoaderData.cpp Thu Feb 22 10:39:42 2018 +0100
@@ -1001,9 +1001,8 @@
if (!is_anonymous) {
- ClassLoaderData** cld_addr = java_lang_ClassLoader::loader_data_addr(loader());
// First, Atomically set it
- ClassLoaderData* old = Atomic::cmpxchg(cld, cld_addr, (ClassLoaderData*)NULL);
+ ClassLoaderData* old = java_lang_ClassLoader::cmpxchg_loader_data(cld, loader(), NULL);
if (old != NULL) {
delete cld;
// Returns the data.