Mercurial > hg > graal-jvmci-8
comparison src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp @ 23801:dae1435f96b7
8145442: Add the facility to verify remembered sets for G1
Summary: Implement remembered sets verification for G1 with option VerifyRememberedSets
Reviewed-by: jmasa, mgerdin
author | poonam |
---|---|
date | Mon, 01 Feb 2016 13:19:14 -0800 |
parents | f3f2f71d2dc8 |
children | b5f3a471e646 6c57a16d0238 |
comparison
equal
deleted
inserted
replaced
23800:7a567d2cc7fb | 23801:dae1435f96b7 |
---|---|
3837 guarantee( _surviving_young_words != NULL, "pre-condition" ); | 3837 guarantee( _surviving_young_words != NULL, "pre-condition" ); |
3838 FREE_C_HEAP_ARRAY(size_t, _surviving_young_words, mtGC); | 3838 FREE_C_HEAP_ARRAY(size_t, _surviving_young_words, mtGC); |
3839 _surviving_young_words = NULL; | 3839 _surviving_young_words = NULL; |
3840 } | 3840 } |
3841 | 3841 |
3842 class VerifyRegionRemSetClosure : public HeapRegionClosure { | |
3843 public: | |
3844 bool doHeapRegion(HeapRegion* hr) { | |
3845 if (!hr->continuesHumongous()) { | |
3846 hr->verify_rem_set(); | |
3847 } | |
3848 return false; | |
3849 } | |
3850 }; | |
3851 | |
3842 #ifdef ASSERT | 3852 #ifdef ASSERT |
3843 class VerifyCSetClosure: public HeapRegionClosure { | 3853 class VerifyCSetClosure: public HeapRegionClosure { |
3844 public: | 3854 public: |
3845 bool doHeapRegion(HeapRegion* hr) { | 3855 bool doHeapRegion(HeapRegion* hr) { |
3846 // Here we check that the CSet region's RSet is ready for parallel | 3856 // Here we check that the CSet region's RSet is ready for parallel |
4012 IsGCActiveMark x; | 4022 IsGCActiveMark x; |
4013 | 4023 |
4014 gc_prologue(false); | 4024 gc_prologue(false); |
4015 increment_total_collections(false /* full gc */); | 4025 increment_total_collections(false /* full gc */); |
4016 increment_gc_time_stamp(); | 4026 increment_gc_time_stamp(); |
4027 | |
4028 if (VerifyRememberedSets) { | |
4029 if (!VerifySilently) { | |
4030 gclog_or_tty->print_cr("[Verifying RemSets before GC]"); | |
4031 } | |
4032 VerifyRegionRemSetClosure v_cl; | |
4033 heap_region_iterate(&v_cl); | |
4034 } | |
4017 | 4035 |
4018 verify_before_gc(); | 4036 verify_before_gc(); |
4019 check_bitmaps("GC Start"); | 4037 check_bitmaps("GC Start"); |
4020 | 4038 |
4021 COMPILER2_PRESENT(DerivedPointerTable::clear()); | 4039 COMPILER2_PRESENT(DerivedPointerTable::clear()); |
4243 // saved_mark_word() will return top() between pauses, i.e., | 4261 // saved_mark_word() will return top() between pauses, i.e., |
4244 // during concurrent refinement. So we don't need the | 4262 // during concurrent refinement. So we don't need the |
4245 // is_gc_active() check to decided which top to use when | 4263 // is_gc_active() check to decided which top to use when |
4246 // scanning cards (see CR 7039627). | 4264 // scanning cards (see CR 7039627). |
4247 increment_gc_time_stamp(); | 4265 increment_gc_time_stamp(); |
4266 | |
4267 if (VerifyRememberedSets) { | |
4268 if (!VerifySilently) { | |
4269 gclog_or_tty->print_cr("[Verifying RemSets after GC]"); | |
4270 } | |
4271 VerifyRegionRemSetClosure v_cl; | |
4272 heap_region_iterate(&v_cl); | |
4273 } | |
4248 | 4274 |
4249 verify_after_gc(); | 4275 verify_after_gc(); |
4250 check_bitmaps("GC End"); | 4276 check_bitmaps("GC End"); |
4251 | 4277 |
4252 assert(!ref_processor_stw()->discovery_enabled(), "Postcondition"); | 4278 assert(!ref_processor_stw()->discovery_enabled(), "Postcondition"); |