--- old/src/hotspot/share/gc/g1/g1CollectedHeap.cpp 2017-10-13 18:24:12.168751592 -0400 +++ new/src/hotspot/share/gc/g1/g1CollectedHeap.cpp 2017-10-13 18:24:11.792029539 -0400 @@ -3458,10 +3458,10 @@ // Variables used to claim nmethods. CompiledMethod* _first_nmethod; - volatile CompiledMethod* _claimed_nmethod; + CompiledMethod* volatile _claimed_nmethod; // The list of nmethods that need to be processed by the second pass. - volatile CompiledMethod* _postponed_list; + CompiledMethod* volatile _postponed_list; volatile uint _num_entered_barrier; public: @@ -3480,7 +3480,7 @@ if(iter.next_alive()) { _first_nmethod = iter.method(); } - _claimed_nmethod = (volatile CompiledMethod*)_first_nmethod; + _claimed_nmethod = _first_nmethod; } ~G1CodeCacheUnloadingTask() { @@ -3496,9 +3496,9 @@ void add_to_postponed_list(CompiledMethod* nm) { CompiledMethod* old; do { - old = (CompiledMethod*)_postponed_list; + old = _postponed_list; nm->set_unloading_next(old); - } while ((CompiledMethod*)Atomic::cmpxchg_ptr(nm, &_postponed_list, old) != old); + } while (Atomic::cmpxchg(nm, &_postponed_list, old) != old); } void clean_nmethod(CompiledMethod* nm) { @@ -3527,7 +3527,7 @@ do { *num_claimed_nmethods = 0; - first = (CompiledMethod*)_claimed_nmethod; + first = _claimed_nmethod; last = CompiledMethodIterator(first); if (first != NULL) { @@ -3541,7 +3541,7 @@ } } - } while ((CompiledMethod*)Atomic::cmpxchg_ptr(last.method(), &_claimed_nmethod, first) != first); + } while (Atomic::cmpxchg(last.method(), &_claimed_nmethod, first) != first); } CompiledMethod* claim_postponed_nmethod() { @@ -3549,14 +3549,14 @@ CompiledMethod* next; do { - claim = (CompiledMethod*)_postponed_list; + claim = _postponed_list; if (claim == NULL) { return NULL; } next = claim->unloading_next(); - } while ((CompiledMethod*)Atomic::cmpxchg_ptr(next, &_postponed_list, claim) != claim); + } while (Atomic::cmpxchg(next, &_postponed_list, claim) != claim); return claim; }