Thu, 26 Jun 2014 10:00:00 +0200
8047821: G1 Does not use the save_marks functionality as intended
Summary: Rename save_marks to record_top_and_timestamp and remove som unused but related methods
Reviewed-by: stefank, ehelin
1.1 --- a/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp Wed Jun 25 16:53:13 2014 +0200 1.2 +++ b/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp Thu Jun 26 10:00:00 2014 +0200 1.3 @@ -4361,7 +4361,7 @@ 1.4 !(retained_region->top() == retained_region->end()) && 1.5 !retained_region->is_empty() && 1.6 !retained_region->isHumongous()) { 1.7 - retained_region->set_saved_mark(); 1.8 + retained_region->record_top_and_timestamp(); 1.9 // The retained region was added to the old region set when it was 1.10 // retired. We have to remove it now, since we don't allow regions 1.11 // we allocate to in the region sets. We'll re-add it later, when 1.12 @@ -6304,7 +6304,7 @@ 1.13 // We really only need to do this for old regions given that we 1.14 // should never scan survivors. But it doesn't hurt to do it 1.15 // for survivors too. 1.16 - new_alloc_region->set_saved_mark(); 1.17 + new_alloc_region->record_top_and_timestamp(); 1.18 if (survivor) { 1.19 new_alloc_region->set_survivor(); 1.20 _hr_printer.alloc(new_alloc_region, G1HRPrinter::Survivor);
2.1 --- a/src/share/vm/gc_implementation/g1/heapRegion.cpp Wed Jun 25 16:53:13 2014 +0200 2.2 +++ b/src/share/vm/gc_implementation/g1/heapRegion.cpp Thu Jun 26 10:00:00 2014 +0200 2.3 @@ -373,7 +373,7 @@ 2.4 // region. 2.5 hr_clear(false /*par*/, false /*clear_space*/); 2.6 set_top(bottom()); 2.7 - set_saved_mark(); 2.8 + record_top_and_timestamp(); 2.9 2.10 assert(HeapRegionRemSet::num_par_rem_sets() > 0, "Invariant."); 2.11 } 2.12 @@ -393,32 +393,6 @@ 2.13 return NULL; 2.14 } 2.15 2.16 -void HeapRegion::save_marks() { 2.17 - set_saved_mark(); 2.18 -} 2.19 - 2.20 -void HeapRegion::oops_in_mr_iterate(MemRegion mr, ExtendedOopClosure* cl) { 2.21 - HeapWord* p = mr.start(); 2.22 - HeapWord* e = mr.end(); 2.23 - oop obj; 2.24 - while (p < e) { 2.25 - obj = oop(p); 2.26 - p += obj->oop_iterate(cl); 2.27 - } 2.28 - assert(p == e, "bad memregion: doesn't end on obj boundary"); 2.29 -} 2.30 - 2.31 -#define HeapRegion_OOP_SINCE_SAVE_MARKS_DEFN(OopClosureType, nv_suffix) \ 2.32 -void HeapRegion::oop_since_save_marks_iterate##nv_suffix(OopClosureType* cl) { \ 2.33 - ContiguousSpace::oop_since_save_marks_iterate##nv_suffix(cl); \ 2.34 -} 2.35 -SPECIALIZED_SINCE_SAVE_MARKS_CLOSURES(HeapRegion_OOP_SINCE_SAVE_MARKS_DEFN) 2.36 - 2.37 - 2.38 -void HeapRegion::oop_before_save_marks_iterate(ExtendedOopClosure* cl) { 2.39 - oops_in_mr_iterate(MemRegion(bottom(), saved_mark_word()), cl); 2.40 -} 2.41 - 2.42 void HeapRegion::note_self_forwarding_removal_start(bool during_initial_mark, 2.43 bool during_conc_mark) { 2.44 // We always recreate the prev marking info and we'll explicitly 2.45 @@ -1107,7 +1081,7 @@ 2.46 return ContiguousSpace::saved_mark_word(); 2.47 } 2.48 2.49 -void G1OffsetTableContigSpace::set_saved_mark() { 2.50 +void G1OffsetTableContigSpace::record_top_and_timestamp() { 2.51 G1CollectedHeap* g1h = G1CollectedHeap::heap(); 2.52 unsigned curr_gc_time_stamp = g1h->get_gc_time_stamp(); 2.53
3.1 --- a/src/share/vm/gc_implementation/g1/heapRegion.hpp Wed Jun 25 16:53:13 2014 +0200 3.2 +++ b/src/share/vm/gc_implementation/g1/heapRegion.hpp Thu Jun 26 10:00:00 2014 +0200 3.3 @@ -148,7 +148,7 @@ 3.4 void set_end(HeapWord* value); 3.5 3.6 virtual HeapWord* saved_mark_word() const; 3.7 - virtual void set_saved_mark(); 3.8 + void record_top_and_timestamp(); 3.9 void reset_gc_time_stamp() { _gc_time_stamp = 0; } 3.10 unsigned get_gc_time_stamp() { return _gc_time_stamp; } 3.11 3.12 @@ -202,10 +202,6 @@ 3.13 ContinuesHumongous 3.14 }; 3.15 3.16 - // Requires that the region "mr" be dense with objects, and begin and end 3.17 - // with an object. 3.18 - void oops_in_mr_iterate(MemRegion mr, ExtendedOopClosure* cl); 3.19 - 3.20 // The remembered set for this region. 3.21 // (Might want to make this "inline" later, to avoid some alloc failure 3.22 // issues.) 3.23 @@ -569,9 +565,6 @@ 3.24 3.25 HeapWord* orig_end() { return _orig_end; } 3.26 3.27 - // Allows logical separation between objects allocated before and after. 3.28 - void save_marks(); 3.29 - 3.30 // Reset HR stuff to default values. 3.31 void hr_clear(bool par, bool clear_space, bool locked = false); 3.32 void par_clear(); 3.33 @@ -580,10 +573,6 @@ 3.34 HeapWord* prev_top_at_mark_start() const { return _prev_top_at_mark_start; } 3.35 HeapWord* next_top_at_mark_start() const { return _next_top_at_mark_start; } 3.36 3.37 - // Apply "cl->do_oop" to (the addresses of) all reference fields in objects 3.38 - // allocated in the current region before the last call to "save_mark". 3.39 - void oop_before_save_marks_iterate(ExtendedOopClosure* cl); 3.40 - 3.41 // Note the start or end of marking. This tells the heap region 3.42 // that the collector is about to start or has finished (concurrently) 3.43 // marking the heap. 3.44 @@ -769,10 +758,6 @@ 3.45 _predicted_bytes_to_copy = bytes; 3.46 } 3.47 3.48 -#define HeapRegion_OOP_SINCE_SAVE_MARKS_DECL(OopClosureType, nv_suffix) \ 3.49 - virtual void oop_since_save_marks_iterate##nv_suffix(OopClosureType* cl); 3.50 - SPECIALIZED_SINCE_SAVE_MARKS_CLOSURES(HeapRegion_OOP_SINCE_SAVE_MARKS_DECL) 3.51 - 3.52 virtual CompactibleSpace* next_compaction_space() const; 3.53 3.54 virtual void reset_after_compaction();