777 balance_queues(_discoveredSoftRefs);
778 balance_queues(_discoveredWeakRefs);
779 balance_queues(_discoveredFinalRefs);
780 balance_queues(_discoveredPhantomRefs);
781 }
782
783 void ReferenceProcessor::process_discovered_reflist(
784 DiscoveredList refs_lists[],
785 ReferencePolicy* policy,
786 bool clear_referent,
787 BoolObjectClosure* is_alive,
788 OopClosure* keep_alive,
789 VoidClosure* complete_gc,
790 AbstractRefProcTaskExecutor* task_executor,
791 ReferenceProcessorPhaseTimes* phase_times)
792 {
793 bool mt_processing = task_executor != NULL && _processing_is_mt;
794
795 phase_times->set_processing_is_mt(mt_processing);
796
797 // If discovery used MT and a dynamic number of GC threads, then
798 // the queues must be balanced for correctness if fewer than the
799 // maximum number of queues were used. The number of queue used
800 // during discovery may be different than the number to be used
801 // for processing so don't depend of _num_q < _max_num_q as part
802 // of the test.
803 bool must_balance = _discovery_is_mt;
804
805 if ((mt_processing && ParallelRefProcBalancingEnabled) ||
806 must_balance) {
807 RefProcBalanceQueuesTimeTracker tt(phase_times);
808 balance_queues(refs_lists);
809 }
810
811 // Phase 1 (soft refs only):
812 // . Traverse the list and remove any SoftReferences whose
813 // referents are not alive, but that should be kept alive for
814 // policy reasons. Keep alive the transitive closure of all
815 // such referents.
816 if (policy != NULL) {
817 RefProcParPhaseTimeTracker tt(ReferenceProcessorPhaseTimes::RefPhase1, phase_times);
818
819 if (mt_processing) {
820 RefProcPhase1Task phase1(*this, refs_lists, policy, true /*marks_oops_alive*/, phase_times);
821 task_executor->execute(phase1);
822 } else {
823 for (uint i = 0; i < _max_num_q; i++) {
824 process_phase1(refs_lists[i], policy,
825 is_alive, keep_alive, complete_gc);
826 }
|
777 balance_queues(_discoveredSoftRefs);
778 balance_queues(_discoveredWeakRefs);
779 balance_queues(_discoveredFinalRefs);
780 balance_queues(_discoveredPhantomRefs);
781 }
782
783 void ReferenceProcessor::process_discovered_reflist(
784 DiscoveredList refs_lists[],
785 ReferencePolicy* policy,
786 bool clear_referent,
787 BoolObjectClosure* is_alive,
788 OopClosure* keep_alive,
789 VoidClosure* complete_gc,
790 AbstractRefProcTaskExecutor* task_executor,
791 ReferenceProcessorPhaseTimes* phase_times)
792 {
793 bool mt_processing = task_executor != NULL && _processing_is_mt;
794
795 phase_times->set_processing_is_mt(mt_processing);
796
797 if (mt_processing && ParallelRefProcBalancingEnabled) {
798 RefProcBalanceQueuesTimeTracker tt(phase_times);
799 balance_queues(refs_lists);
800 }
801
802 // Phase 1 (soft refs only):
803 // . Traverse the list and remove any SoftReferences whose
804 // referents are not alive, but that should be kept alive for
805 // policy reasons. Keep alive the transitive closure of all
806 // such referents.
807 if (policy != NULL) {
808 RefProcParPhaseTimeTracker tt(ReferenceProcessorPhaseTimes::RefPhase1, phase_times);
809
810 if (mt_processing) {
811 RefProcPhase1Task phase1(*this, refs_lists, policy, true /*marks_oops_alive*/, phase_times);
812 task_executor->execute(phase1);
813 } else {
814 for (uint i = 0; i < _max_num_q; i++) {
815 process_phase1(refs_lists[i], policy,
816 is_alive, keep_alive, complete_gc);
817 }
|