3789 g1h->ref_processor_stw()->set_active_mt_degree(n_workers); |
3789 g1h->ref_processor_stw()->set_active_mt_degree(n_workers); |
3790 } |
3790 } |
3791 |
3791 |
3792 // Executes the given task using concurrent marking worker threads. |
3792 // Executes the given task using concurrent marking worker threads. |
3793 virtual void execute(ProcessTask& task); |
3793 virtual void execute(ProcessTask& task); |
3794 virtual void execute(EnqueueTask& task); |
|
3795 }; |
3794 }; |
3796 |
3795 |
3797 // Gang task for possibly parallel reference processing |
3796 // Gang task for possibly parallel reference processing |
3798 |
3797 |
3799 class G1STWRefProcTaskProxy: public AbstractGangTask { |
3798 class G1STWRefProcTaskProxy: public AbstractGangTask { |
3852 |
3851 |
3853 ParallelTaskTerminator terminator(_active_workers, _queues); |
3852 ParallelTaskTerminator terminator(_active_workers, _queues); |
3854 G1STWRefProcTaskProxy proc_task_proxy(proc_task, _g1h, _pss, _queues, &terminator); |
3853 G1STWRefProcTaskProxy proc_task_proxy(proc_task, _g1h, _pss, _queues, &terminator); |
3855 |
3854 |
3856 _workers->run_task(&proc_task_proxy); |
3855 _workers->run_task(&proc_task_proxy); |
3857 } |
|
3858 |
|
3859 // Gang task for parallel reference enqueueing. |
|
3860 |
|
3861 class G1STWRefEnqueueTaskProxy: public AbstractGangTask { |
|
3862 typedef AbstractRefProcTaskExecutor::EnqueueTask EnqueueTask; |
|
3863 EnqueueTask& _enq_task; |
|
3864 |
|
3865 public: |
|
3866 G1STWRefEnqueueTaskProxy(EnqueueTask& enq_task) : |
|
3867 AbstractGangTask("Enqueue reference objects in parallel"), |
|
3868 _enq_task(enq_task) |
|
3869 { } |
|
3870 |
|
3871 virtual void work(uint worker_id) { |
|
3872 _enq_task.work(worker_id); |
|
3873 } |
|
3874 }; |
|
3875 |
|
3876 // Driver routine for parallel reference enqueueing. |
|
3877 // Creates an instance of the ref enqueueing gang |
|
3878 // task and has the worker threads execute it. |
|
3879 |
|
3880 void G1STWRefProcTaskExecutor::execute(EnqueueTask& enq_task) { |
|
3881 assert(_workers != NULL, "Need parallel worker threads."); |
|
3882 |
|
3883 G1STWRefEnqueueTaskProxy enq_task_proxy(enq_task); |
|
3884 |
|
3885 _workers->run_task(&enq_task_proxy); |
|
3886 } |
3856 } |
3887 |
3857 |
3888 // End of weak reference support closures |
3858 // End of weak reference support closures |
3889 |
3859 |
3890 void G1CollectedHeap::process_discovered_references(G1ParScanThreadStateSet* per_thread_states) { |
3860 void G1CollectedHeap::process_discovered_references(G1ParScanThreadStateSet* per_thread_states) { |