@@ -199,17 +199,17 @@ ReferenceProcessorStats ReferenceProcessor::process_discovered_references(RefPro
199199 update_soft_ref_master_clock ();
200200
201201 {
202- RefProcTotalPhaseTimesTracker tt (RefPhase2 , &phase_times);
202+ RefProcTotalPhaseTimesTracker tt (SoftWeakFinalRefsPhase , &phase_times);
203203 process_soft_weak_final_refs (proxy_task, phase_times);
204204 }
205205
206206 {
207- RefProcTotalPhaseTimesTracker tt (RefPhase3 , &phase_times);
207+ RefProcTotalPhaseTimesTracker tt (KeepAliveFinalRefsPhase , &phase_times);
208208 process_final_keep_alive (proxy_task, phase_times);
209209 }
210210
211211 {
212- RefProcTotalPhaseTimesTracker tt (RefPhase4 , &phase_times);
212+ RefProcTotalPhaseTimesTracker tt (PhantomRefsPhase , &phase_times);
213213 process_phantom_refs (proxy_task, phase_times);
214214 }
215215
@@ -452,8 +452,8 @@ size_t ReferenceProcessor::total_reference_count(ReferenceType type) const {
452452}
453453
454454
455- class RefProcPhase2Task : public RefProcTask {
456- void run_phase2 (uint worker_id,
455+ class RefProcSoftWeakFinalPhaseTask : public RefProcTask {
456+ void run_phase (uint worker_id,
457457 DiscoveredList list[],
458458 BoolObjectClosure* is_alive,
459459 OopClosure* keep_alive,
@@ -467,8 +467,8 @@ class RefProcPhase2Task: public RefProcTask {
467467 }
468468
469469public:
470- RefProcPhase2Task (ReferenceProcessor& ref_processor,
471- ReferenceProcessorPhaseTimes* phase_times)
470+ RefProcSoftWeakFinalPhaseTask (ReferenceProcessor& ref_processor,
471+ ReferenceProcessorPhaseTimes* phase_times)
472472 : RefProcTask(ref_processor,
473473 phase_times) {}
474474
@@ -477,29 +477,29 @@ class RefProcPhase2Task: public RefProcTask {
477477 OopClosure* keep_alive,
478478 VoidClosure* complete_gc) override {
479479 ResourceMark rm;
480- RefProcWorkerTimeTracker t (_phase_times->phase2_worker_time_sec (), tracker_id (worker_id));
480+ RefProcWorkerTimeTracker t (_phase_times->soft_weak_final_refs_phase_worker_time_sec (), tracker_id (worker_id));
481481 {
482- RefProcSubPhasesWorkerTimeTracker tt (ReferenceProcessor::SoftRefSubPhase2 , _phase_times, tracker_id (worker_id));
483- run_phase2 (worker_id, _ref_processor._discoveredSoftRefs , is_alive, keep_alive, true /* do_enqueue_and_clear */ , REF_SOFT);
482+ RefProcSubPhasesWorkerTimeTracker tt (ReferenceProcessor::ProcessSoftRefSubPhase , _phase_times, tracker_id (worker_id));
483+ run_phase (worker_id, _ref_processor._discoveredSoftRefs , is_alive, keep_alive, true /* do_enqueue_and_clear */ , REF_SOFT);
484484 }
485485 {
486- RefProcSubPhasesWorkerTimeTracker tt (ReferenceProcessor::WeakRefSubPhase2 , _phase_times, tracker_id (worker_id));
487- run_phase2 (worker_id, _ref_processor._discoveredWeakRefs , is_alive, keep_alive, true /* do_enqueue_and_clear */ , REF_WEAK);
486+ RefProcSubPhasesWorkerTimeTracker tt (ReferenceProcessor::ProcessWeakRefSubPhase , _phase_times, tracker_id (worker_id));
487+ run_phase (worker_id, _ref_processor._discoveredWeakRefs , is_alive, keep_alive, true /* do_enqueue_and_clear */ , REF_WEAK);
488488 }
489489 {
490- RefProcSubPhasesWorkerTimeTracker tt (ReferenceProcessor::FinalRefSubPhase2 , _phase_times, tracker_id (worker_id));
491- run_phase2 (worker_id, _ref_processor._discoveredFinalRefs , is_alive, keep_alive, false /* do_enqueue_and_clear */ , REF_FINAL);
490+ RefProcSubPhasesWorkerTimeTracker tt (ReferenceProcessor::ProcessFinalRefSubPhase , _phase_times, tracker_id (worker_id));
491+ run_phase (worker_id, _ref_processor._discoveredFinalRefs , is_alive, keep_alive, false /* do_enqueue_and_clear */ , REF_FINAL);
492492 }
493493 // Close the reachable set; needed for collectors which keep_alive_closure do
494494 // not immediately complete their work.
495495 complete_gc->do_void ();
496496 }
497497};
498498
499- class RefProcPhase3Task : public RefProcTask {
499+ class RefProcKeepAliveFinalPhaseTask : public RefProcTask {
500500public:
501- RefProcPhase3Task (ReferenceProcessor& ref_processor,
502- ReferenceProcessorPhaseTimes* phase_times)
501+ RefProcKeepAliveFinalPhaseTask (ReferenceProcessor& ref_processor,
502+ ReferenceProcessorPhaseTimes* phase_times)
503503 : RefProcTask(ref_processor,
504504 phase_times) {}
505505
@@ -508,15 +508,15 @@ class RefProcPhase3Task: public RefProcTask {
508508 OopClosure* keep_alive,
509509 VoidClosure* complete_gc) override {
510510 ResourceMark rm;
511- RefProcSubPhasesWorkerTimeTracker tt (ReferenceProcessor::FinalRefSubPhase3 , _phase_times, tracker_id (worker_id));
511+ RefProcSubPhasesWorkerTimeTracker tt (ReferenceProcessor::KeepAliveFinalRefsSubPhase , _phase_times, tracker_id (worker_id));
512512 _ref_processor.process_final_keep_alive_work (_ref_processor._discoveredFinalRefs [worker_id], keep_alive, complete_gc);
513513 }
514514};
515515
516- class RefProcPhase4Task : public RefProcTask {
516+ class RefProcPhantomPhaseTask : public RefProcTask {
517517public:
518- RefProcPhase4Task (ReferenceProcessor& ref_processor,
519- ReferenceProcessorPhaseTimes* phase_times)
518+ RefProcPhantomPhaseTask (ReferenceProcessor& ref_processor,
519+ ReferenceProcessorPhaseTimes* phase_times)
520520 : RefProcTask(ref_processor,
521521 phase_times) {}
522522
@@ -525,7 +525,7 @@ class RefProcPhase4Task: public RefProcTask {
525525 OopClosure* keep_alive,
526526 VoidClosure* complete_gc) override {
527527 ResourceMark rm;
528- RefProcSubPhasesWorkerTimeTracker tt (ReferenceProcessor::PhantomRefSubPhase4 , _phase_times, tracker_id (worker_id));
528+ RefProcSubPhasesWorkerTimeTracker tt (ReferenceProcessor::ProcessPhantomRefsSubPhase , _phase_times, tracker_id (worker_id));
529529 size_t const removed = _ref_processor.process_phantom_refs_work (_ref_processor._discoveredPhantomRefs [worker_id],
530530 is_alive,
531531 keep_alive,
@@ -720,31 +720,31 @@ void ReferenceProcessor::process_soft_weak_final_refs(RefProcProxyTask& proxy_ta
720720 phase_times.set_processing_is_mt (processing_is_mt ());
721721
722722 if (num_total_refs == 0 ) {
723- log_debug (gc, ref)(" Skipped phase 2 of Reference Processing: no references" );
723+ log_debug (gc, ref)(" Skipped SoftWeakFinalRefsPhase of Reference Processing: no references" );
724724 return ;
725725 }
726726
727- RefProcMTDegreeAdjuster a (this , RefPhase2 , num_total_refs);
727+ RefProcMTDegreeAdjuster a (this , SoftWeakFinalRefsPhase , num_total_refs);
728728
729729 if (processing_is_mt ()) {
730- RefProcBalanceQueuesTimeTracker tt (RefPhase2 , &phase_times);
730+ RefProcBalanceQueuesTimeTracker tt (SoftWeakFinalRefsPhase , &phase_times);
731731 maybe_balance_queues (_discoveredSoftRefs);
732732 maybe_balance_queues (_discoveredWeakRefs);
733733 maybe_balance_queues (_discoveredFinalRefs);
734734 }
735735
736- RefProcPhaseTimeTracker tt (RefPhase2 , &phase_times);
736+ RefProcPhaseTimeTracker tt (SoftWeakFinalRefsPhase , &phase_times);
737737
738- log_reflist (" Phase 2 Soft before" , _discoveredSoftRefs, _max_num_queues);
739- log_reflist (" Phase 2 Weak before" , _discoveredWeakRefs, _max_num_queues);
740- log_reflist (" Phase 2 Final before" , _discoveredFinalRefs, _max_num_queues);
738+ log_reflist (" SoftWeakFinalRefsPhase Soft before" , _discoveredSoftRefs, _max_num_queues);
739+ log_reflist (" SoftWeakFinalRefsPhase Weak before" , _discoveredWeakRefs, _max_num_queues);
740+ log_reflist (" SoftWeakFinalRefsPhase Final before" , _discoveredFinalRefs, _max_num_queues);
741741
742- RefProcPhase2Task phase2 (*this , &phase_times);
743- run_task (phase2 , proxy_task, false );
742+ RefProcSoftWeakFinalPhaseTask phase_task (*this , &phase_times);
743+ run_task (phase_task , proxy_task, false );
744744
745745 verify_total_count_zero (_discoveredSoftRefs, " SoftReference" );
746746 verify_total_count_zero (_discoveredWeakRefs, " WeakReference" );
747- log_reflist (" Phase 2 Final after" , _discoveredFinalRefs, _max_num_queues);
747+ log_reflist (" SoftWeakFinalRefsPhase Final after" , _discoveredFinalRefs, _max_num_queues);
748748}
749749
750750void ReferenceProcessor::process_final_keep_alive (RefProcProxyTask& proxy_task,
@@ -754,22 +754,21 @@ void ReferenceProcessor::process_final_keep_alive(RefProcProxyTask& proxy_task,
754754 phase_times.set_processing_is_mt (processing_is_mt ());
755755
756756 if (num_final_refs == 0 ) {
757- log_debug (gc, ref)(" Skipped phase 3 of Reference Processing: no references" );
757+ log_debug (gc, ref)(" Skipped KeepAliveFinalRefsPhase of Reference Processing: no references" );
758758 return ;
759759 }
760760
761- RefProcMTDegreeAdjuster a (this , RefPhase3 , num_final_refs);
761+ RefProcMTDegreeAdjuster a (this , KeepAliveFinalRefsPhase , num_final_refs);
762762
763763 if (processing_is_mt ()) {
764- RefProcBalanceQueuesTimeTracker tt (RefPhase3 , &phase_times);
764+ RefProcBalanceQueuesTimeTracker tt (KeepAliveFinalRefsPhase , &phase_times);
765765 maybe_balance_queues (_discoveredFinalRefs);
766766 }
767767
768- // Phase 3:
769- // . Traverse referents of final references and keep them and followers alive.
770- RefProcPhaseTimeTracker tt (RefPhase3, &phase_times);
771- RefProcPhase3Task phase3 (*this , &phase_times);
772- run_task (phase3, proxy_task, true );
768+ // Traverse referents of final references and keep them and followers alive.
769+ RefProcPhaseTimeTracker tt (KeepAliveFinalRefsPhase, &phase_times);
770+ RefProcKeepAliveFinalPhaseTask phase_task (*this , &phase_times);
771+ run_task (phase_task, proxy_task, true );
773772
774773 verify_total_count_zero (_discoveredFinalRefs, " FinalReference" );
775774}
@@ -782,24 +781,24 @@ void ReferenceProcessor::process_phantom_refs(RefProcProxyTask& proxy_task,
782781 phase_times.set_processing_is_mt (processing_is_mt ());
783782
784783 if (num_phantom_refs == 0 ) {
785- log_debug (gc, ref)(" Skipped phase 4 of Reference Processing: no references" );
784+ log_debug (gc, ref)(" Skipped PhantomRefsPhase of Reference Processing: no references" );
786785 return ;
787786 }
788787
789- RefProcMTDegreeAdjuster a (this , RefPhase4 , num_phantom_refs);
788+ RefProcMTDegreeAdjuster a (this , PhantomRefsPhase , num_phantom_refs);
790789
791790 if (processing_is_mt ()) {
792- RefProcBalanceQueuesTimeTracker tt (RefPhase4 , &phase_times);
791+ RefProcBalanceQueuesTimeTracker tt (PhantomRefsPhase , &phase_times);
793792 maybe_balance_queues (_discoveredPhantomRefs);
794793 }
795794
796- // Phase 4: Walk phantom references appropriately.
797- RefProcPhaseTimeTracker tt (RefPhase4 , &phase_times);
795+ // Walk phantom references appropriately.
796+ RefProcPhaseTimeTracker tt (PhantomRefsPhase , &phase_times);
798797
799- log_reflist (" Phase 4 Phantom before" , _discoveredPhantomRefs, _max_num_queues);
798+ log_reflist (" PhantomRefsPhase Phantom before" , _discoveredPhantomRefs, _max_num_queues);
800799
801- RefProcPhase4Task phase4 (*this , &phase_times);
802- run_task (phase4 , proxy_task, false );
800+ RefProcPhantomPhaseTask phase_task (*this , &phase_times);
801+ run_task (phase_task , proxy_task, false );
803802
804803 verify_total_count_zero (_discoveredPhantomRefs, " PhantomReference" );
805804}
@@ -1190,7 +1189,7 @@ uint RefProcMTDegreeAdjuster::ergo_proc_thread_count(size_t ref_count,
11901189
11911190bool RefProcMTDegreeAdjuster::use_max_threads (RefProcPhases phase) const {
11921191 // Even a small number of references in this phase could produce large amounts of work.
1193- return phase == ReferenceProcessor::RefPhase3 ;
1192+ return phase == ReferenceProcessor::KeepAliveFinalRefsPhase ;
11941193}
11951194
11961195RefProcMTDegreeAdjuster::RefProcMTDegreeAdjuster (ReferenceProcessor* rp,
0 commit comments