Print this page
rev 2691 : [mq]: g1-reference-processing

Split Close
Expand all
Collapse all
          --- old/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp
          +++ new/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp
↓ open down ↓ 1996 lines elided ↑ open up ↑
1997 1997    // reference processor.
1998 1998    ReferenceProcessorIsAliveMutator rp_mut_closure(ref_processor(), NULL);
1999 1999    // Temporarily make reference _processing_ single threaded (non-MT).
2000 2000    ReferenceProcessorMTProcMutator rp_mut_mt_processing(ref_processor(), false);
2001 2001    // Temporarily make refs discovery atomic
2002 2002    ReferenceProcessorAtomicMutator rp_mut_atomic(ref_processor(), true);
2003 2003    // Temporarily make reference _discovery_ single threaded (non-MT)
2004 2004    ReferenceProcessorMTDiscoveryMutator rp_mut_discovery(ref_processor(), false);
2005 2005  
2006 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 2008    ref_processor()->setup_policy(clear_all_soft_refs);
2009 2009    // If an asynchronous collection finishes, the _modUnionTable is
2010 2010    // all clear.  If we are assuming the collection from an asynchronous
2011 2011    // collection, clear the _modUnionTable.
2012 2012    assert(_collectorState != Idling || _modUnionTable.isAllClear(),
2013 2013      "_modUnionTable should be clear if the baton was not passed");
2014 2014    _modUnionTable.clear_all();
2015 2015  
2016 2016    // We must adjust the allocation statistics being maintained
2017 2017    // in the free list space. We do so by reading and clearing
↓ open down ↓ 1465 lines elided ↑ open up ↑
3483 3483    TraceCMSMemoryManagerStats tms(_collectorState,GenCollectedHeap::heap()->gc_cause());
3484 3484  
3485 3485    ReferenceProcessor* rp = ref_processor();
3486 3486    SpecializationStats::clear();
3487 3487    assert(_restart_addr == NULL, "Control point invariant");
3488 3488    if (asynch) {
3489 3489      // acquire locks for subsequent manipulations
3490 3490      MutexLockerEx x(bitMapLock(),
3491 3491                      Mutex::_no_safepoint_check_flag);
3492 3492      checkpointRootsInitialWork(asynch);
3493      -    rp->verify_no_references_recorded();
3494      -    rp->enable_discovery(); // enable ("weak") refs discovery
     3493 +    // enable ("weak") refs discovery
     3494 +    rp->enable_discovery(true /*verify_disabled*/, true /*check_no_refs*/);
3495 3495      _collectorState = Marking;
3496 3496    } else {
3497 3497      // (Weak) Refs discovery: this is controlled from genCollectedHeap::do_collection
3498 3498      // which recognizes if we are a CMS generation, and doesn't try to turn on
3499 3499      // discovery; verify that they aren't meddling.
3500 3500      assert(!rp->discovery_is_atomic(),
3501 3501             "incorrect setting of discovery predicate");
3502 3502      assert(!rp->discovery_enabled(), "genCollectedHeap shouldn't control "
3503 3503             "ref discovery for this generation kind");
3504 3504      // already have locks
3505 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 3508      _collectorState = Marking;
3508 3509    }
3509 3510    SpecializationStats::print();
3510 3511  }
3511 3512  
3512 3513  void CMSCollector::checkpointRootsInitialWork(bool asynch) {
3513 3514    assert(SafepointSynchronize::is_at_safepoint(), "world should be stopped");
3514 3515    assert(_collectorState == InitialMarking, "just checking");
3515 3516  
3516 3517    // If there has not been a GC[n-1] since last GC[n] cycle completed,
↓ open down ↓ 5828 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX