Mercurial > hg > truffle
diff src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp @ 17636:889068b9a088
8027746: Remove do_gen_barrier template parameter in G1ParCopyClosure
Summary: Remove the above mentioned template parameter and related unused code. Also remove some classes that are never used.
Reviewed-by: stefank, mgerdin, jwilhelm
author | tschatzl |
---|---|
date | Mon, 20 Jan 2014 11:47:53 +0100 |
parents | 5a32d2a3cc1e |
children | a034dc5e910b |
line wrap: on
line diff
--- a/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp Mon Jan 20 11:47:29 2014 +0100 +++ b/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp Mon Jan 20 11:47:53 2014 +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" @@ -3096,11 +3096,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; @@ -3136,7 +3132,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; @@ -4670,8 +4666,8 @@ _during_initial_mark(_g1->g1_policy()->during_initial_mark_pause()), _mark_in_progress(_g1->mark_in_progress()) { } -template <bool do_gen_barrier, G1Barrier barrier, bool do_mark_object> -void G1ParCopyClosure<do_gen_barrier, barrier, do_mark_object>::mark_object(oop obj) { +template <G1Barrier barrier, bool do_mark_object> +void G1ParCopyClosure<barrier, do_mark_object>::mark_object(oop obj) { #ifdef ASSERT HeapRegion* hr = _g1->heap_region_containing(obj); assert(hr != NULL, "sanity"); @@ -4682,8 +4678,8 @@ _cm->grayRoot(obj, (size_t) obj->size(), _worker_id); } -template <bool do_gen_barrier, G1Barrier barrier, bool do_mark_object> -void G1ParCopyClosure<do_gen_barrier, barrier, do_mark_object> +template <G1Barrier barrier, bool do_mark_object> +void G1ParCopyClosure<barrier, do_mark_object> ::mark_forwarded_object(oop from_obj, oop to_obj) { #ifdef ASSERT assert(from_obj->is_forwarded(), "from obj should be forwarded"); @@ -4706,8 +4702,8 @@ _cm->grayRoot(to_obj, (size_t) from_obj->size(), _worker_id); } -template <bool do_gen_barrier, G1Barrier barrier, bool do_mark_object> -oop G1ParCopyClosure<do_gen_barrier, barrier, do_mark_object> +template <G1Barrier barrier, bool do_mark_object> +oop G1ParCopyClosure<barrier, do_mark_object> ::copy_to_survivor_space(oop old) { size_t word_sz = old->size(); HeapRegion* from_region = _g1->heap_region_containing_raw(old); @@ -4803,13 +4799,11 @@ } } -template <bool do_gen_barrier, G1Barrier barrier, bool do_mark_object> +template <G1Barrier barrier, bool do_mark_object> template <class T> -void G1ParCopyClosure<do_gen_barrier, barrier, do_mark_object> +void G1ParCopyClosure<barrier, do_mark_object> ::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"); @@ -4829,10 +4823,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 { @@ -4847,14 +4838,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<false, G1BarrierEvac, false>::do_oop_work(oop* p); -template void G1ParCopyClosure<false, G1BarrierEvac, false>::do_oop_work(narrowOop* p); +} + +template void G1ParCopyClosure<G1BarrierEvac, false>::do_oop_work(oop* p); +template void G1ParCopyClosure<G1BarrierEvac, false>::do_oop_work(narrowOop* p); template <class T> void G1ParScanPartialArrayClosure::do_oop_nv(T* p) { assert(has_partial_array_mask(p), "invariant");