8194406: Use Atomic::replace_if_null

Reviewed-by: coleenp, dholmes
This commit is contained in:
Kim Barrett 2018-01-04 18:18:18 -05:00
parent c7e601e911
commit 9e5bf18428
9 changed files with 17 additions and 18 deletions

View file

@ -446,7 +446,7 @@ MethodCounters* Method::build_method_counters(Method* m, TRAPS) {
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() {