< prev index next >
src/hotspot/share/gc/g1/g1CollectedHeap.cpp
Print this page
@@ -3456,14 +3456,14 @@
const bool _unloading_occurred;
const uint _num_workers;
// 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:
G1CodeCacheUnloadingTask(uint num_workers, BoolObjectClosure* is_alive, bool unloading_occurred) :
_is_alive(is_alive),
@@ -3478,11 +3478,11 @@
// Get first alive nmethod
CompiledMethodIterator iter = CompiledMethodIterator();
if(iter.next_alive()) {
_first_nmethod = iter.method();
}
- _claimed_nmethod = (volatile CompiledMethod*)_first_nmethod;
+ _claimed_nmethod = _first_nmethod;
}
~G1CodeCacheUnloadingTask() {
CodeCache::verify_clean_inline_caches();
@@ -3494,13 +3494,13 @@
private:
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) {
bool postponed = nm->do_unloading_parallel(_is_alive, _unloading_occurred);
@@ -3525,11 +3525,11 @@
CompiledMethodIterator last;
do {
*num_claimed_nmethods = 0;
- first = (CompiledMethod*)_claimed_nmethod;
+ first = _claimed_nmethod;
last = CompiledMethodIterator(first);
if (first != NULL) {
for (int i = 0; i < MaxClaimNmethods; i++) {
@@ -3539,26 +3539,26 @@
claimed_nmethods[i] = last.method();
(*num_claimed_nmethods)++;
}
}
- } while ((CompiledMethod*)Atomic::cmpxchg_ptr(last.method(), &_claimed_nmethod, first) != first);
+ } while (Atomic::cmpxchg(last.method(), &_claimed_nmethod, first) != first);
}
CompiledMethod* claim_postponed_nmethod() {
CompiledMethod* claim;
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;
}
public:
< prev index next >