--- old/src/hotspot/share/code/nmethod.cpp 2017-10-12 12:05:06.788118220 -0400 +++ new/src/hotspot/share/code/nmethod.cpp 2017-10-12 12:05:06.213317825 -0400 @@ -1664,7 +1664,7 @@ nmethod* observed_mark_link = _oops_do_mark_link; if (observed_mark_link == NULL) { // Claim this nmethod for this thread to mark. - if (Atomic::cmpxchg_if_null(NMETHOD_SENTINEL, &_oops_do_mark_link)) { + if (Atomic::cmpxchg(NMETHOD_SENTINEL, &_oops_do_mark_link, (nmethod*)NULL) == NULL) { // Atomically append this nmethod (now claimed) to the head of the list: nmethod* observed_mark_nmethods = _oops_do_mark_nmethods; for (;;) { @@ -1689,8 +1689,8 @@ assert(_oops_do_mark_nmethods == NULL, "must not call oops_do_marking_prologue twice in a row"); // We use cmpxchg instead of regular assignment here because the user // may fork a bunch of threads, and we need them all to see the same state. - bool observed = Atomic::cmpxchg_if_null(NMETHOD_SENTINEL, &_oops_do_mark_nmethods); - guarantee(observed, "no races in this sequential code"); + nmethod* observed = Atomic::cmpxchg(NMETHOD_SENTINEL, &_oops_do_mark_nmethods, (nmethod*)NULL); + guarantee(observed == NULL, "no races in this sequential code"); } void nmethod::oops_do_marking_epilogue() {