Mercurial > hg > graal-compiler
comparison src/share/vm/gc_implementation/g1/heapRegion.hpp @ 3979:4dfb2df418f2
6484982: G1: process references during evacuation pauses
Summary: G1 now uses two reference processors - one is used by concurrent marking and the other is used by STW GCs (both full and incremental evacuation pauses). In an evacuation pause, the reference processor is embedded into the closures used to scan objects. Doing so causes causes reference objects to be 'discovered' by the reference processor. At the end of the evacuation pause, these discovered reference objects are processed - preserving (and copying) referent objects (and their reachable graphs) as appropriate.
Reviewed-by: ysr, jwilhelm, brutisso, stefank, tonyp
author | johnc |
---|---|
date | Thu, 22 Sep 2011 10:57:37 -0700 |
parents | f44782f04dd4 |
children | 8229bd737950 |
comparison
equal
deleted
inserted
replaced
3978:f0ecbe78fc7b | 3979:4dfb2df418f2 |
---|---|
116 HeapRegion* hr, OopClosure* cl, | 116 HeapRegion* hr, OopClosure* cl, |
117 CardTableModRefBS::PrecisionStyle precision, | 117 CardTableModRefBS::PrecisionStyle precision, |
118 FilterKind fk); | 118 FilterKind fk); |
119 }; | 119 }; |
120 | 120 |
121 | |
122 // The complicating factor is that BlockOffsetTable diverged | 121 // The complicating factor is that BlockOffsetTable diverged |
123 // significantly, and we need functionality that is only in the G1 version. | 122 // significantly, and we need functionality that is only in the G1 version. |
124 // So I copied that code, which led to an alternate G1 version of | 123 // So I copied that code, which led to an alternate G1 version of |
125 // OffsetTableContigSpace. If the two versions of BlockOffsetTable could | 124 // OffsetTableContigSpace. If the two versions of BlockOffsetTable could |
126 // be reconciled, then G1OffsetTableContigSpace could go away. | 125 // be reconciled, then G1OffsetTableContigSpace could go away. |
220 enum HumongousType { | 219 enum HumongousType { |
221 NotHumongous = 0, | 220 NotHumongous = 0, |
222 StartsHumongous, | 221 StartsHumongous, |
223 ContinuesHumongous | 222 ContinuesHumongous |
224 }; | 223 }; |
225 | |
226 // The next filter kind that should be used for a "new_dcto_cl" call with | |
227 // the "traditional" signature. | |
228 HeapRegionDCTOC::FilterKind _next_fk; | |
229 | 224 |
230 // Requires that the region "mr" be dense with objects, and begin and end | 225 // Requires that the region "mr" be dense with objects, and begin and end |
231 // with an object. | 226 // with an object. |
232 void oops_in_mr_iterate(MemRegion mr, OopClosure* cl); | 227 void oops_in_mr_iterate(MemRegion mr, OopClosure* cl); |
233 | 228 |
571 | 566 |
572 // Apply "cl->do_oop" to (the addresses of) all reference fields in objects | 567 // Apply "cl->do_oop" to (the addresses of) all reference fields in objects |
573 // allocated in the current region before the last call to "save_mark". | 568 // allocated in the current region before the last call to "save_mark". |
574 void oop_before_save_marks_iterate(OopClosure* cl); | 569 void oop_before_save_marks_iterate(OopClosure* cl); |
575 | 570 |
576 // This call determines the "filter kind" argument that will be used for | |
577 // the next call to "new_dcto_cl" on this region with the "traditional" | |
578 // signature (i.e., the call below.) The default, in the absence of a | |
579 // preceding call to this method, is "NoFilterKind", and a call to this | |
580 // method is necessary for each such call, or else it reverts to the | |
581 // default. | |
582 // (This is really ugly, but all other methods I could think of changed a | |
583 // lot of main-line code for G1.) | |
584 void set_next_filter_kind(HeapRegionDCTOC::FilterKind nfk) { | |
585 _next_fk = nfk; | |
586 } | |
587 | |
588 DirtyCardToOopClosure* | 571 DirtyCardToOopClosure* |
589 new_dcto_closure(OopClosure* cl, | 572 new_dcto_closure(OopClosure* cl, |
590 CardTableModRefBS::PrecisionStyle precision, | 573 CardTableModRefBS::PrecisionStyle precision, |
591 HeapRegionDCTOC::FilterKind fk); | 574 HeapRegionDCTOC::FilterKind fk); |
592 | 575 |
593 #if WHASSUP | |
594 DirtyCardToOopClosure* | |
595 new_dcto_closure(OopClosure* cl, | |
596 CardTableModRefBS::PrecisionStyle precision, | |
597 HeapWord* boundary) { | |
598 assert(boundary == NULL, "This arg doesn't make sense here."); | |
599 DirtyCardToOopClosure* res = new_dcto_closure(cl, precision, _next_fk); | |
600 _next_fk = HeapRegionDCTOC::NoFilterKind; | |
601 return res; | |
602 } | |
603 #endif | |
604 | |
605 // | |
606 // Note the start or end of marking. This tells the heap region | 576 // Note the start or end of marking. This tells the heap region |
607 // that the collector is about to start or has finished (concurrently) | 577 // that the collector is about to start or has finished (concurrently) |
608 // marking the heap. | 578 // marking the heap. |
609 // | |
610 | 579 |
611 // Note the start of a marking phase. Record the | 580 // Note the start of a marking phase. Record the |
612 // start of the unmarked area of the region here. | 581 // start of the unmarked area of the region here. |
613 void note_start_of_marking(bool during_initial_mark) { | 582 void note_start_of_marking(bool during_initial_mark) { |
614 init_top_at_conc_mark_count(); | 583 init_top_at_conc_mark_count(); |