< prev index next >

src/hotspot/share/gc/g1/g1CollectedHeap.cpp

Print this page

        

*** 3456,3469 **** const bool _unloading_occurred; const uint _num_workers; // Variables used to claim nmethods. CompiledMethod* _first_nmethod; ! volatile CompiledMethod* _claimed_nmethod; // The list of nmethods that need to be processed by the second pass. ! volatile CompiledMethod* _postponed_list; volatile uint _num_entered_barrier; public: G1CodeCacheUnloadingTask(uint num_workers, BoolObjectClosure* is_alive, bool unloading_occurred) : _is_alive(is_alive), --- 3456,3469 ---- const bool _unloading_occurred; const uint _num_workers; // Variables used to claim nmethods. CompiledMethod* _first_nmethod; ! CompiledMethod* volatile _claimed_nmethod; // The list of nmethods that need to be processed by the second pass. ! 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,3488 **** // Get first alive nmethod CompiledMethodIterator iter = CompiledMethodIterator(); if(iter.next_alive()) { _first_nmethod = iter.method(); } ! _claimed_nmethod = (volatile CompiledMethod*)_first_nmethod; } ~G1CodeCacheUnloadingTask() { CodeCache::verify_clean_inline_caches(); --- 3478,3488 ---- // Get first alive nmethod CompiledMethodIterator iter = CompiledMethodIterator(); if(iter.next_alive()) { _first_nmethod = iter.method(); } ! _claimed_nmethod = _first_nmethod; } ~G1CodeCacheUnloadingTask() { CodeCache::verify_clean_inline_caches();
*** 3494,3506 **** private: void add_to_postponed_list(CompiledMethod* nm) { CompiledMethod* old; do { ! old = (CompiledMethod*)_postponed_list; nm->set_unloading_next(old); ! } while ((CompiledMethod*)Atomic::cmpxchg_ptr(nm, &_postponed_list, old) != old); } void clean_nmethod(CompiledMethod* nm) { bool postponed = nm->do_unloading_parallel(_is_alive, _unloading_occurred); --- 3494,3506 ---- private: void add_to_postponed_list(CompiledMethod* nm) { CompiledMethod* old; do { ! old = _postponed_list; nm->set_unloading_next(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,3535 **** CompiledMethodIterator last; do { *num_claimed_nmethods = 0; ! first = (CompiledMethod*)_claimed_nmethod; last = CompiledMethodIterator(first); if (first != NULL) { for (int i = 0; i < MaxClaimNmethods; i++) { --- 3525,3535 ---- CompiledMethodIterator last; do { *num_claimed_nmethods = 0; ! first = _claimed_nmethod; last = CompiledMethodIterator(first); if (first != NULL) { for (int i = 0; i < MaxClaimNmethods; i++) {
*** 3539,3564 **** claimed_nmethods[i] = last.method(); (*num_claimed_nmethods)++; } } ! } while ((CompiledMethod*)Atomic::cmpxchg_ptr(last.method(), &_claimed_nmethod, first) != first); } CompiledMethod* claim_postponed_nmethod() { CompiledMethod* claim; CompiledMethod* next; do { ! claim = (CompiledMethod*)_postponed_list; if (claim == NULL) { return NULL; } next = claim->unloading_next(); ! } while ((CompiledMethod*)Atomic::cmpxchg_ptr(next, &_postponed_list, claim) != claim); return claim; } public: --- 3539,3564 ---- claimed_nmethods[i] = last.method(); (*num_claimed_nmethods)++; } } ! } while (Atomic::cmpxchg(last.method(), &_claimed_nmethod, first) != first); } CompiledMethod* claim_postponed_nmethod() { CompiledMethod* claim; CompiledMethod* next; do { ! claim = _postponed_list; if (claim == NULL) { return NULL; } next = claim->unloading_next(); ! } while (Atomic::cmpxchg(next, &_postponed_list, claim) != claim); return claim; } public:
< prev index next >