Mercurial > hg > truffle
comparison src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp @ 14305:c685ef164975
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 | 893ce66f7473 |
children | 870aedf4ba4f |
comparison
equal
deleted
inserted
replaced
14304:a2866d45e99e | 14305:c685ef164975 |
---|---|
48 #include "gc_implementation/shared/gcTimer.hpp" | 48 #include "gc_implementation/shared/gcTimer.hpp" |
49 #include "gc_implementation/shared/gcTrace.hpp" | 49 #include "gc_implementation/shared/gcTrace.hpp" |
50 #include "gc_implementation/shared/gcTraceTime.hpp" | 50 #include "gc_implementation/shared/gcTraceTime.hpp" |
51 #include "gc_implementation/shared/isGCActiveMark.hpp" | 51 #include "gc_implementation/shared/isGCActiveMark.hpp" |
52 #include "memory/gcLocker.inline.hpp" | 52 #include "memory/gcLocker.inline.hpp" |
53 #include "memory/genOopClosures.inline.hpp" | |
54 #include "memory/generationSpec.hpp" | 53 #include "memory/generationSpec.hpp" |
54 #include "memory/iterator.hpp" | |
55 #include "memory/referenceProcessor.hpp" | 55 #include "memory/referenceProcessor.hpp" |
56 #include "oops/oop.inline.hpp" | 56 #include "oops/oop.inline.hpp" |
57 #include "oops/oop.pcgc.inline.hpp" | 57 #include "oops/oop.pcgc.inline.hpp" |
58 #include "runtime/vmThread.hpp" | 58 #include "runtime/vmThread.hpp" |
59 #include "utilities/ticks.hpp" | 59 #include "utilities/ticks.hpp" |
3075 default: ShouldNotReachHere(); | 3075 default: ShouldNotReachHere(); |
3076 } | 3076 } |
3077 return NULL; // keep some compilers happy | 3077 return NULL; // keep some compilers happy |
3078 } | 3078 } |
3079 | 3079 |
3080 // TODO: VerifyRootsClosure extends OopsInGenClosure so that we can | 3080 class VerifyRootsClosure: public OopClosure { |
3081 // pass it as the perm_blk to SharedHeap::process_strong_roots. | |
3082 // When process_strong_roots stop calling perm_blk->younger_refs_iterate | |
3083 // we can change this closure to extend the simpler OopClosure. | |
3084 class VerifyRootsClosure: public OopsInGenClosure { | |
3085 private: | 3081 private: |
3086 G1CollectedHeap* _g1h; | 3082 G1CollectedHeap* _g1h; |
3087 VerifyOption _vo; | 3083 VerifyOption _vo; |
3088 bool _failures; | 3084 bool _failures; |
3089 public: | 3085 public: |
3115 | 3111 |
3116 void do_oop(oop* p) { do_oop_nv(p); } | 3112 void do_oop(oop* p) { do_oop_nv(p); } |
3117 void do_oop(narrowOop* p) { do_oop_nv(p); } | 3113 void do_oop(narrowOop* p) { do_oop_nv(p); } |
3118 }; | 3114 }; |
3119 | 3115 |
3120 class G1VerifyCodeRootOopClosure: public OopsInGenClosure { | 3116 class G1VerifyCodeRootOopClosure: public OopClosure { |
3121 G1CollectedHeap* _g1h; | 3117 G1CollectedHeap* _g1h; |
3122 OopClosure* _root_cl; | 3118 OopClosure* _root_cl; |
3123 nmethod* _nm; | 3119 nmethod* _nm; |
3124 VerifyOption _vo; | 3120 VerifyOption _vo; |
3125 bool _failures; | 3121 bool _failures; |
4649 _par_scan_state(par_scan_state), | 4645 _par_scan_state(par_scan_state), |
4650 _worker_id(par_scan_state->queue_num()), | 4646 _worker_id(par_scan_state->queue_num()), |
4651 _during_initial_mark(_g1->g1_policy()->during_initial_mark_pause()), | 4647 _during_initial_mark(_g1->g1_policy()->during_initial_mark_pause()), |
4652 _mark_in_progress(_g1->mark_in_progress()) { } | 4648 _mark_in_progress(_g1->mark_in_progress()) { } |
4653 | 4649 |
4654 template <bool do_gen_barrier, G1Barrier barrier, bool do_mark_object> | 4650 template <G1Barrier barrier, bool do_mark_object> |
4655 void G1ParCopyClosure<do_gen_barrier, barrier, do_mark_object>::mark_object(oop obj) { | 4651 void G1ParCopyClosure<barrier, do_mark_object>::mark_object(oop obj) { |
4656 #ifdef ASSERT | 4652 #ifdef ASSERT |
4657 HeapRegion* hr = _g1->heap_region_containing(obj); | 4653 HeapRegion* hr = _g1->heap_region_containing(obj); |
4658 assert(hr != NULL, "sanity"); | 4654 assert(hr != NULL, "sanity"); |
4659 assert(!hr->in_collection_set(), "should not mark objects in the CSet"); | 4655 assert(!hr->in_collection_set(), "should not mark objects in the CSet"); |
4660 #endif // ASSERT | 4656 #endif // ASSERT |
4661 | 4657 |
4662 // We know that the object is not moving so it's safe to read its size. | 4658 // We know that the object is not moving so it's safe to read its size. |
4663 _cm->grayRoot(obj, (size_t) obj->size(), _worker_id); | 4659 _cm->grayRoot(obj, (size_t) obj->size(), _worker_id); |
4664 } | 4660 } |
4665 | 4661 |
4666 template <bool do_gen_barrier, G1Barrier barrier, bool do_mark_object> | 4662 template <G1Barrier barrier, bool do_mark_object> |
4667 void G1ParCopyClosure<do_gen_barrier, barrier, do_mark_object> | 4663 void G1ParCopyClosure<barrier, do_mark_object> |
4668 ::mark_forwarded_object(oop from_obj, oop to_obj) { | 4664 ::mark_forwarded_object(oop from_obj, oop to_obj) { |
4669 #ifdef ASSERT | 4665 #ifdef ASSERT |
4670 assert(from_obj->is_forwarded(), "from obj should be forwarded"); | 4666 assert(from_obj->is_forwarded(), "from obj should be forwarded"); |
4671 assert(from_obj->forwardee() == to_obj, "to obj should be the forwardee"); | 4667 assert(from_obj->forwardee() == to_obj, "to obj should be the forwardee"); |
4672 assert(from_obj != to_obj, "should not be self-forwarded"); | 4668 assert(from_obj != to_obj, "should not be self-forwarded"); |
4685 // well-formed. So we have to read its size from its from-space | 4681 // well-formed. So we have to read its size from its from-space |
4686 // image which we know should not be changing. | 4682 // image which we know should not be changing. |
4687 _cm->grayRoot(to_obj, (size_t) from_obj->size(), _worker_id); | 4683 _cm->grayRoot(to_obj, (size_t) from_obj->size(), _worker_id); |
4688 } | 4684 } |
4689 | 4685 |
4690 template <bool do_gen_barrier, G1Barrier barrier, bool do_mark_object> | 4686 template <G1Barrier barrier, bool do_mark_object> |
4691 oop G1ParCopyClosure<do_gen_barrier, barrier, do_mark_object> | 4687 oop G1ParCopyClosure<barrier, do_mark_object> |
4692 ::copy_to_survivor_space(oop old) { | 4688 ::copy_to_survivor_space(oop old) { |
4693 size_t word_sz = old->size(); | 4689 size_t word_sz = old->size(); |
4694 HeapRegion* from_region = _g1->heap_region_containing_raw(old); | 4690 HeapRegion* from_region = _g1->heap_region_containing_raw(old); |
4695 // +1 to make the -1 indexes valid... | 4691 // +1 to make the -1 indexes valid... |
4696 int young_index = from_region->young_index_in_cset()+1; | 4692 int young_index = from_region->young_index_in_cset()+1; |
4782 if (_g1->heap_region_containing_raw(new_obj)->is_young()) { | 4778 if (_g1->heap_region_containing_raw(new_obj)->is_young()) { |
4783 _scanned_klass->record_modified_oops(); | 4779 _scanned_klass->record_modified_oops(); |
4784 } | 4780 } |
4785 } | 4781 } |
4786 | 4782 |
4787 template <bool do_gen_barrier, G1Barrier barrier, bool do_mark_object> | 4783 template <G1Barrier barrier, bool do_mark_object> |
4788 template <class T> | 4784 template <class T> |
4789 void G1ParCopyClosure<do_gen_barrier, barrier, do_mark_object> | 4785 void G1ParCopyClosure<barrier, do_mark_object> |
4790 ::do_oop_work(T* p) { | 4786 ::do_oop_work(T* p) { |
4791 oop obj = oopDesc::load_decode_heap_oop(p); | 4787 oop obj = oopDesc::load_decode_heap_oop(p); |
4792 assert(barrier != G1BarrierRS || obj != NULL, | |
4793 "Precondition: G1BarrierRS implies obj is non-NULL"); | |
4794 | 4788 |
4795 assert(_worker_id == _par_scan_state->queue_num(), "sanity"); | 4789 assert(_worker_id == _par_scan_state->queue_num(), "sanity"); |
4796 | 4790 |
4797 // here the null check is implicit in the cset_fast_test() test | 4791 // here the null check is implicit in the cset_fast_test() test |
4798 if (_g1->in_cset_fast_test(obj)) { | 4792 if (_g1->in_cset_fast_test(obj)) { |
4808 // If the object is self-forwarded we don't need to explicitly | 4802 // If the object is self-forwarded we don't need to explicitly |
4809 // mark it, the evacuation failure protocol will do so. | 4803 // mark it, the evacuation failure protocol will do so. |
4810 mark_forwarded_object(obj, forwardee); | 4804 mark_forwarded_object(obj, forwardee); |
4811 } | 4805 } |
4812 | 4806 |
4813 // When scanning the RS, we only care about objs in CS. | 4807 if (barrier == G1BarrierKlass) { |
4814 if (barrier == G1BarrierRS) { | |
4815 _par_scan_state->update_rs(_from, p, _worker_id); | |
4816 } else if (barrier == G1BarrierKlass) { | |
4817 do_klass_barrier(p, forwardee); | 4808 do_klass_barrier(p, forwardee); |
4818 } | 4809 } |
4819 } else { | 4810 } else { |
4820 // The object is not in collection set. If we're a root scanning | 4811 // The object is not in collection set. If we're a root scanning |
4821 // closure during an initial mark pause (i.e. do_mark_object will | 4812 // closure during an initial mark pause (i.e. do_mark_object will |
4826 } | 4817 } |
4827 | 4818 |
4828 if (barrier == G1BarrierEvac && obj != NULL) { | 4819 if (barrier == G1BarrierEvac && obj != NULL) { |
4829 _par_scan_state->update_rs(_from, p, _worker_id); | 4820 _par_scan_state->update_rs(_from, p, _worker_id); |
4830 } | 4821 } |
4831 | 4822 } |
4832 if (do_gen_barrier && obj != NULL) { | 4823 |
4833 par_do_barrier(p); | 4824 template void G1ParCopyClosure<G1BarrierEvac, false>::do_oop_work(oop* p); |
4834 } | 4825 template void G1ParCopyClosure<G1BarrierEvac, false>::do_oop_work(narrowOop* p); |
4835 } | |
4836 | |
4837 template void G1ParCopyClosure<false, G1BarrierEvac, false>::do_oop_work(oop* p); | |
4838 template void G1ParCopyClosure<false, G1BarrierEvac, false>::do_oop_work(narrowOop* p); | |
4839 | 4826 |
4840 template <class T> void G1ParScanPartialArrayClosure::do_oop_nv(T* p) { | 4827 template <class T> void G1ParScanPartialArrayClosure::do_oop_nv(T* p) { |
4841 assert(has_partial_array_mask(p), "invariant"); | 4828 assert(has_partial_array_mask(p), "invariant"); |
4842 oop from_obj = clear_partial_array_mask(p); | 4829 oop from_obj = clear_partial_array_mask(p); |
4843 | 4830 |