--- old/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp 2014-01-10 09:58:16.525509112 +0100 +++ new/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp 2014-01-10 09:58:16.401509115 +0100 @@ -50,8 +50,8 @@ #include "gc_implementation/shared/gcTraceTime.hpp" #include "gc_implementation/shared/isGCActiveMark.hpp" #include "memory/gcLocker.inline.hpp" -#include "memory/genOopClosures.inline.hpp" #include "memory/generationSpec.hpp" +#include "memory/iterator.hpp" #include "memory/referenceProcessor.hpp" #include "oops/oop.inline.hpp" #include "oops/oop.pcgc.inline.hpp" @@ -3077,11 +3077,7 @@ return NULL; // keep some compilers happy } -// TODO: VerifyRootsClosure extends OopsInGenClosure so that we can -// pass it as the perm_blk to SharedHeap::process_strong_roots. -// When process_strong_roots stop calling perm_blk->younger_refs_iterate -// we can change this closure to extend the simpler OopClosure. -class VerifyRootsClosure: public OopsInGenClosure { +class VerifyRootsClosure: public OopClosure { private: G1CollectedHeap* _g1h; VerifyOption _vo; @@ -3117,7 +3113,7 @@ void do_oop(narrowOop* p) { do_oop_nv(p); } }; -class G1VerifyCodeRootOopClosure: public OopsInGenClosure { +class G1VerifyCodeRootOopClosure: public OopClosure { G1CollectedHeap* _g1h; OopClosure* _root_cl; nmethod* _nm; @@ -4651,8 +4647,8 @@ _during_initial_mark(_g1->g1_policy()->during_initial_mark_pause()), _mark_in_progress(_g1->mark_in_progress()) { } -template -void G1ParCopyClosure::mark_object(oop obj) { +template +void G1ParCopyClosure::mark_object(oop obj) { #ifdef ASSERT HeapRegion* hr = _g1->heap_region_containing(obj); assert(hr != NULL, "sanity"); @@ -4663,8 +4659,8 @@ _cm->grayRoot(obj, (size_t) obj->size(), _worker_id); } -template -void G1ParCopyClosure +template +void G1ParCopyClosure ::mark_forwarded_object(oop from_obj, oop to_obj) { #ifdef ASSERT assert(from_obj->is_forwarded(), "from obj should be forwarded"); @@ -4687,8 +4683,8 @@ _cm->grayRoot(to_obj, (size_t) from_obj->size(), _worker_id); } -template -oop G1ParCopyClosure +template +oop G1ParCopyClosure ::copy_to_survivor_space(oop old) { size_t word_sz = old->size(); HeapRegion* from_region = _g1->heap_region_containing_raw(old); @@ -4784,13 +4780,11 @@ } } -template +template template -void G1ParCopyClosure +void G1ParCopyClosure ::do_oop_work(T* p) { oop obj = oopDesc::load_decode_heap_oop(p); - assert(barrier != G1BarrierRS || obj != NULL, - "Precondition: G1BarrierRS implies obj is non-NULL"); assert(_worker_id == _par_scan_state->queue_num(), "sanity"); @@ -4810,10 +4804,7 @@ mark_forwarded_object(obj, forwardee); } - // When scanning the RS, we only care about objs in CS. - if (barrier == G1BarrierRS) { - _par_scan_state->update_rs(_from, p, _worker_id); - } else if (barrier == G1BarrierKlass) { + if (barrier == G1BarrierKlass) { do_klass_barrier(p, forwardee); } } else { @@ -4828,14 +4819,10 @@ if (barrier == G1BarrierEvac && obj != NULL) { _par_scan_state->update_rs(_from, p, _worker_id); } - - if (do_gen_barrier && obj != NULL) { - par_do_barrier(p); - } } -template void G1ParCopyClosure::do_oop_work(oop* p); -template void G1ParCopyClosure::do_oop_work(narrowOop* p); +template void G1ParCopyClosure::do_oop_work(oop* p); +template void G1ParCopyClosure::do_oop_work(narrowOop* p); template void G1ParScanPartialArrayClosure::do_oop_nv(T* p) { assert(has_partial_array_mask(p), "invariant");