< prev index next >

src/hotspot/share/gc/shared/genCollectedHeap.cpp

Print this page
rev 49834 : [mq]: 8202021-cleanup-referenceprocessor


 498 
 499     HandleMark hm;  // Discard invalid handles created during gc
 500     save_marks();   // save marks for all gens
 501     // We want to discover references, but not process them yet.
 502     // This mode is disabled in process_discovered_references if the
 503     // generation does some collection work, or in
 504     // enqueue_discovered_references if the generation returns
 505     // without doing any work.
 506     ReferenceProcessor* rp = gen->ref_processor();
 507     // If the discovery of ("weak") refs in this generation is
 508     // atomic wrt other collectors in this configuration, we
 509     // are guaranteed to have empty discovered ref lists.
 510     if (rp->discovery_is_atomic()) {
 511       rp->enable_discovery();
 512       rp->setup_policy(clear_soft_refs);
 513     } else {
 514       // collect() below will enable discovery as appropriate
 515     }
 516     gen->collect(full, clear_soft_refs, size, is_tlab);
 517     if (!rp->enqueuing_is_done()) {
 518       ReferenceProcessorPhaseTimes pt(NULL, rp->num_q());
 519       rp->enqueue_discovered_references(NULL, &pt);
 520       pt.print_enqueue_phase();
 521     } else {
 522       rp->set_enqueuing_is_done(false);
 523     }
 524     rp->verify_no_references_recorded();
 525   }
 526 
 527   COMPILER2_PRESENT(DerivedPointerTable::update_pointers());
 528 
 529   gen->stat_record()->accumulated_time.stop();
 530 
 531   update_gc_stats(gen, full);
 532 
 533   if (run_verification && VerifyAfterGC) {
 534     HandleMark hm;  // Discard invalid handles created during verification
 535     Universe::verify("After GC");
 536   }
 537 }
 538 




 498 
 499     HandleMark hm;  // Discard invalid handles created during gc
 500     save_marks();   // save marks for all gens
 501     // We want to discover references, but not process them yet.
 502     // This mode is disabled in process_discovered_references if the
 503     // generation does some collection work, or in
 504     // enqueue_discovered_references if the generation returns
 505     // without doing any work.
 506     ReferenceProcessor* rp = gen->ref_processor();
 507     // If the discovery of ("weak") refs in this generation is
 508     // atomic wrt other collectors in this configuration, we
 509     // are guaranteed to have empty discovered ref lists.
 510     if (rp->discovery_is_atomic()) {
 511       rp->enable_discovery();
 512       rp->setup_policy(clear_soft_refs);
 513     } else {
 514       // collect() below will enable discovery as appropriate
 515     }
 516     gen->collect(full, clear_soft_refs, size, is_tlab);
 517     if (!rp->enqueuing_is_done()) {
 518       ReferenceProcessorPhaseTimes pt(NULL, rp->num_queues());
 519       rp->enqueue_discovered_references(NULL, &pt);
 520       pt.print_enqueue_phase();
 521     } else {
 522       rp->set_enqueuing_is_done(false);
 523     }
 524     rp->verify_no_references_recorded();
 525   }
 526 
 527   COMPILER2_PRESENT(DerivedPointerTable::update_pointers());
 528 
 529   gen->stat_record()->accumulated_time.stop();
 530 
 531   update_gc_stats(gen, full);
 532 
 533   if (run_verification && VerifyAfterGC) {
 534     HandleMark hm;  // Discard invalid handles created during verification
 535     Universe::verify("After GC");
 536   }
 537 }
 538 


< prev index next >