--- old/src/hotspot/share/code/compiledMethod.cpp 2019-11-21 11:57:02.274847124 +0100 +++ new/src/hotspot/share/code/compiledMethod.cpp 2019-11-21 11:57:01.826839555 +0100 @@ -133,7 +133,7 @@ // next pointers always point at live ExceptionCaches, that are not removed due // to concurrent ExceptionCache cleanup. ExceptionCache* next = ec->next(); - if (Atomic::cmpxchg(next, &_exception_cache, ec) == ec) { + if (Atomic::cmpxchg(&_exception_cache, ec, next) == ec) { CodeCache::release_exception_cache(ec); } continue; @@ -143,7 +143,7 @@ new_entry->set_next(ec); } } - if (Atomic::cmpxchg(new_entry, &_exception_cache, ec) == ec) { + if (Atomic::cmpxchg(&_exception_cache, ec, new_entry) == ec) { return; } } @@ -176,7 +176,7 @@ // Try to clean head; this is contended by concurrent inserts, that // both lazily clean the head, and insert entries at the head. If // the CAS fails, the operation is restarted. - if (Atomic::cmpxchg(next, &_exception_cache, curr) != curr) { + if (Atomic::cmpxchg(&_exception_cache, curr, next) != curr) { prev = NULL; curr = exception_cache_acquire(); continue; @@ -615,7 +615,7 @@ if (md != NULL && md->is_method()) { Method* method = static_cast(md); if (!method->method_holder()->is_loader_alive()) { - Atomic::store((Method*)NULL, r->metadata_addr()); + Atomic::store(r->metadata_addr(), (Method*)NULL); if (!r->metadata_is_immediate()) { r->fix_metadata_relocation();