Mercurial > hg > truffle
diff src/share/vm/gc_implementation/g1/heapRegion.hpp @ 4787:2ace1c4ee8da
6888336: G1: avoid explicitly marking and pushing objects in survivor spaces
Summary: This change simplifies the interaction between GC and concurrent marking. By disabling survivor spaces during the initial-mark pause we don't need to propagate marks of objects we copy during each GC (since we never need to copy an explicitly marked object).
Reviewed-by: johnc, brutisso
author | tonyp |
---|---|
date | Tue, 10 Jan 2012 18:58:13 -0500 |
parents | 023652e49ac0 |
children | d30fa85f9994 |
line wrap: on
line diff
--- a/src/share/vm/gc_implementation/g1/heapRegion.hpp Tue Jan 10 20:02:41 2012 +0100 +++ b/src/share/vm/gc_implementation/g1/heapRegion.hpp Tue Jan 10 18:58:13 2012 -0500 @@ -583,37 +583,33 @@ // that the collector is about to start or has finished (concurrently) // marking the heap. - // Note the start of a marking phase. Record the - // start of the unmarked area of the region here. - void note_start_of_marking(bool during_initial_mark) { - init_top_at_conc_mark_count(); - _next_marked_bytes = 0; - if (during_initial_mark && is_young() && !is_survivor()) - _next_top_at_mark_start = bottom(); - else - _next_top_at_mark_start = top(); - } + // Notify the region that concurrent marking is starting. Initialize + // all fields related to the next marking info. + inline void note_start_of_marking(); + + // Notify the region that concurrent marking has finished. Copy the + // (now finalized) next marking info fields into the prev marking + // info fields. + inline void note_end_of_marking(); + + // Notify the region that it will be used as to-space during a GC + // and we are about to start copying objects into it. + inline void note_start_of_copying(bool during_initial_mark); - // Note the end of a marking phase. Install the start of - // the unmarked area that was captured at start of marking. - void note_end_of_marking() { - _prev_top_at_mark_start = _next_top_at_mark_start; - _prev_marked_bytes = _next_marked_bytes; - _next_marked_bytes = 0; + // Notify the region that it ceases being to-space during a GC and + // we will not copy objects into it any more. + inline void note_end_of_copying(bool during_initial_mark); - guarantee(_prev_marked_bytes <= - (size_t) (prev_top_at_mark_start() - bottom()) * HeapWordSize, - "invariant"); - } + // Notify the region that we are about to start processing + // self-forwarded objects during evac failure handling. + void note_self_forwarding_removal_start(bool during_initial_mark, + bool during_conc_mark); - // After an evacuation, we need to update _next_top_at_mark_start - // to be the current top. Note this is only valid if we have only - // ever evacuated into this region. If we evacuate, allocate, and - // then evacuate we are in deep doodoo. - void note_end_of_copying() { - assert(top() >= _next_top_at_mark_start, "Increase only"); - _next_top_at_mark_start = top(); - } + // Notify the region that we have finished processing self-forwarded + // objects during evac failure handling. + void note_self_forwarding_removal_end(bool during_initial_mark, + bool during_conc_mark, + size_t marked_bytes); // Returns "false" iff no object in the region was allocated when the // last mark phase ended.