--- a/src/hotspot/share/code/compiledMethod.cpp Mon Nov 25 12:32:40 2019 +0100
+++ b/src/hotspot/share/code/compiledMethod.cpp Mon Nov 25 12:33:15 2019 +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;