comparison 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
comparison
equal deleted inserted replaced
4786:1d6185f732aa 4787:2ace1c4ee8da
581 581
582 // Note the start or end of marking. This tells the heap region 582 // Note the start or end of marking. This tells the heap region
583 // that the collector is about to start or has finished (concurrently) 583 // that the collector is about to start or has finished (concurrently)
584 // marking the heap. 584 // marking the heap.
585 585
586 // Note the start of a marking phase. Record the 586 // Notify the region that concurrent marking is starting. Initialize
587 // start of the unmarked area of the region here. 587 // all fields related to the next marking info.
588 void note_start_of_marking(bool during_initial_mark) { 588 inline void note_start_of_marking();
589 init_top_at_conc_mark_count(); 589
590 _next_marked_bytes = 0; 590 // Notify the region that concurrent marking has finished. Copy the
591 if (during_initial_mark && is_young() && !is_survivor()) 591 // (now finalized) next marking info fields into the prev marking
592 _next_top_at_mark_start = bottom(); 592 // info fields.
593 else 593 inline void note_end_of_marking();
594 _next_top_at_mark_start = top(); 594
595 } 595 // Notify the region that it will be used as to-space during a GC
596 596 // and we are about to start copying objects into it.
597 // Note the end of a marking phase. Install the start of 597 inline void note_start_of_copying(bool during_initial_mark);
598 // the unmarked area that was captured at start of marking. 598
599 void note_end_of_marking() { 599 // Notify the region that it ceases being to-space during a GC and
600 _prev_top_at_mark_start = _next_top_at_mark_start; 600 // we will not copy objects into it any more.
601 _prev_marked_bytes = _next_marked_bytes; 601 inline void note_end_of_copying(bool during_initial_mark);
602 _next_marked_bytes = 0; 602
603 603 // Notify the region that we are about to start processing
604 guarantee(_prev_marked_bytes <= 604 // self-forwarded objects during evac failure handling.
605 (size_t) (prev_top_at_mark_start() - bottom()) * HeapWordSize, 605 void note_self_forwarding_removal_start(bool during_initial_mark,
606 "invariant"); 606 bool during_conc_mark);
607 } 607
608 608 // Notify the region that we have finished processing self-forwarded
609 // After an evacuation, we need to update _next_top_at_mark_start 609 // objects during evac failure handling.
610 // to be the current top. Note this is only valid if we have only 610 void note_self_forwarding_removal_end(bool during_initial_mark,
611 // ever evacuated into this region. If we evacuate, allocate, and 611 bool during_conc_mark,
612 // then evacuate we are in deep doodoo. 612 size_t marked_bytes);
613 void note_end_of_copying() {
614 assert(top() >= _next_top_at_mark_start, "Increase only");
615 _next_top_at_mark_start = top();
616 }
617 613
618 // Returns "false" iff no object in the region was allocated when the 614 // Returns "false" iff no object in the region was allocated when the
619 // last mark phase ended. 615 // last mark phase ended.
620 bool is_marked() { return _prev_top_at_mark_start != bottom(); } 616 bool is_marked() { return _prev_top_at_mark_start != bottom(); }
621 617