--- old/src/hotspot/share/oops/method.cpp 2018-01-04 02:53:29.445600005 -0500 +++ new/src/hotspot/share/oops/method.cpp 2018-01-04 02:53:29.057580142 -0500 @@ -446,7 +446,7 @@ bool Method::init_method_counters(MethodCounters* counters) { // Try to install a pointer to MethodCounters, return true on success. - return Atomic::cmpxchg(counters, &_method_counters, (MethodCounters*)NULL) == NULL; + return Atomic::replace_if_null(counters, &_method_counters); } void Method::cleanup_inline_caches() {