2002 ReferenceProcessorAtomicMutator rp_mut_atomic(ref_processor(), true); |
2002 ReferenceProcessorAtomicMutator rp_mut_atomic(ref_processor(), true); |
2003 // Temporarily make reference _discovery_ single threaded (non-MT) |
2003 // Temporarily make reference _discovery_ single threaded (non-MT) |
2004 ReferenceProcessorMTDiscoveryMutator rp_mut_discovery(ref_processor(), false); |
2004 ReferenceProcessorMTDiscoveryMutator rp_mut_discovery(ref_processor(), false); |
2005 |
2005 |
2006 ref_processor()->set_enqueuing_is_done(false); |
2006 ref_processor()->set_enqueuing_is_done(false); |
2007 ref_processor()->enable_discovery(); |
2007 ref_processor()->enable_discovery(false /*verify_disabled*/, false /*check_no_refs*/); |
2008 ref_processor()->setup_policy(clear_all_soft_refs); |
2008 ref_processor()->setup_policy(clear_all_soft_refs); |
2009 // If an asynchronous collection finishes, the _modUnionTable is |
2009 // If an asynchronous collection finishes, the _modUnionTable is |
2010 // all clear. If we are assuming the collection from an asynchronous |
2010 // all clear. If we are assuming the collection from an asynchronous |
2011 // collection, clear the _modUnionTable. |
2011 // collection, clear the _modUnionTable. |
2012 assert(_collectorState != Idling || _modUnionTable.isAllClear(), |
2012 assert(_collectorState != Idling || _modUnionTable.isAllClear(), |
3488 if (asynch) { |
3488 if (asynch) { |
3489 // acquire locks for subsequent manipulations |
3489 // acquire locks for subsequent manipulations |
3490 MutexLockerEx x(bitMapLock(), |
3490 MutexLockerEx x(bitMapLock(), |
3491 Mutex::_no_safepoint_check_flag); |
3491 Mutex::_no_safepoint_check_flag); |
3492 checkpointRootsInitialWork(asynch); |
3492 checkpointRootsInitialWork(asynch); |
3493 rp->verify_no_references_recorded(); |
3493 // enable ("weak") refs discovery |
3494 rp->enable_discovery(); // enable ("weak") refs discovery |
3494 rp->enable_discovery(true /*verify_disabled*/, true /*check_no_refs*/); |
3495 _collectorState = Marking; |
3495 _collectorState = Marking; |
3496 } else { |
3496 } else { |
3497 // (Weak) Refs discovery: this is controlled from genCollectedHeap::do_collection |
3497 // (Weak) Refs discovery: this is controlled from genCollectedHeap::do_collection |
3498 // which recognizes if we are a CMS generation, and doesn't try to turn on |
3498 // which recognizes if we are a CMS generation, and doesn't try to turn on |
3499 // discovery; verify that they aren't meddling. |
3499 // discovery; verify that they aren't meddling. |
3501 "incorrect setting of discovery predicate"); |
3501 "incorrect setting of discovery predicate"); |
3502 assert(!rp->discovery_enabled(), "genCollectedHeap shouldn't control " |
3502 assert(!rp->discovery_enabled(), "genCollectedHeap shouldn't control " |
3503 "ref discovery for this generation kind"); |
3503 "ref discovery for this generation kind"); |
3504 // already have locks |
3504 // already have locks |
3505 checkpointRootsInitialWork(asynch); |
3505 checkpointRootsInitialWork(asynch); |
3506 rp->enable_discovery(); // now enable ("weak") refs discovery |
3506 // now enable ("weak") refs discovery |
|
3507 rp->enable_discovery(true /*verify_disabled*/, false /*verify_no_refs*/); |
3507 _collectorState = Marking; |
3508 _collectorState = Marking; |
3508 } |
3509 } |
3509 SpecializationStats::print(); |
3510 SpecializationStats::print(); |
3510 } |
3511 } |
3511 |
3512 |