mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-26 22:34:27 +02:00
6484982: G1: process references during evacuation pauses
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
This commit is contained in:
parent
70bb8e788e
commit
1b62d10b4b
20 changed files with 1448 additions and 632 deletions
|
@ -2004,7 +2004,7 @@ void CMSCollector::do_compaction_work(bool clear_all_soft_refs) {
|
|||
ReferenceProcessorMTDiscoveryMutator rp_mut_discovery(ref_processor(), false);
|
||||
|
||||
ref_processor()->set_enqueuing_is_done(false);
|
||||
ref_processor()->enable_discovery();
|
||||
ref_processor()->enable_discovery(false /*verify_disabled*/, false /*check_no_refs*/);
|
||||
ref_processor()->setup_policy(clear_all_soft_refs);
|
||||
// If an asynchronous collection finishes, the _modUnionTable is
|
||||
// all clear. If we are assuming the collection from an asynchronous
|
||||
|
@ -3490,8 +3490,8 @@ void CMSCollector::checkpointRootsInitial(bool asynch) {
|
|||
MutexLockerEx x(bitMapLock(),
|
||||
Mutex::_no_safepoint_check_flag);
|
||||
checkpointRootsInitialWork(asynch);
|
||||
rp->verify_no_references_recorded();
|
||||
rp->enable_discovery(); // enable ("weak") refs discovery
|
||||
// enable ("weak") refs discovery
|
||||
rp->enable_discovery(true /*verify_disabled*/, true /*check_no_refs*/);
|
||||
_collectorState = Marking;
|
||||
} else {
|
||||
// (Weak) Refs discovery: this is controlled from genCollectedHeap::do_collection
|
||||
|
@ -3503,7 +3503,8 @@ void CMSCollector::checkpointRootsInitial(bool asynch) {
|
|||
"ref discovery for this generation kind");
|
||||
// already have locks
|
||||
checkpointRootsInitialWork(asynch);
|
||||
rp->enable_discovery(); // now enable ("weak") refs discovery
|
||||
// now enable ("weak") refs discovery
|
||||
rp->enable_discovery(true /*verify_disabled*/, false /*verify_no_refs*/);
|
||||
_collectorState = Marking;
|
||||
}
|
||||
SpecializationStats::print();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue