574 _young_old_boundary(young_old_boundary), |
574 _young_old_boundary(young_old_boundary), |
575 _state_set(state_set), |
575 _state_set(state_set), |
576 _strong_roots_scope(strong_roots_scope) |
576 _strong_roots_scope(strong_roots_scope) |
577 {} |
577 {} |
578 |
578 |
579 // Reset the terminator for the given number of |
|
580 // active threads. |
|
581 void ParNewGenTask::set_for_termination(uint active_workers) { |
|
582 _state_set->reset(active_workers, _gen->promotion_failed()); |
|
583 } |
|
584 |
|
585 void ParNewGenTask::work(uint worker_id) { |
579 void ParNewGenTask::work(uint worker_id) { |
586 GenCollectedHeap* gch = GenCollectedHeap::heap(); |
580 GenCollectedHeap* gch = GenCollectedHeap::heap(); |
587 // Since this is being done in a separate thread, need new resource |
581 // Since this is being done in a separate thread, need new resource |
588 // and handle marks. |
582 // and handle marks. |
589 ResourceMark rm; |
583 ResourceMark rm; |
755 HeapWord* young_old_boundary, |
749 HeapWord* young_old_boundary, |
756 ParScanThreadStateSet& state_set); |
750 ParScanThreadStateSet& state_set); |
757 |
751 |
758 private: |
752 private: |
759 virtual void work(uint worker_id); |
753 virtual void work(uint worker_id); |
760 virtual void set_for_termination(uint active_workers) { |
|
761 _state_set.terminator()->reset_for_reuse(active_workers); |
|
762 } |
|
763 private: |
754 private: |
764 ParNewGeneration& _gen; |
755 ParNewGeneration& _gen; |
765 ProcessTask& _task; |
756 ProcessTask& _task; |
766 Generation& _old_gen; |
757 Generation& _old_gen; |
767 HeapWord* _young_old_boundary; |
758 HeapWord* _young_old_boundary; |
946 // because only those workers go through the termination protocol. |
937 // because only those workers go through the termination protocol. |
947 ParallelTaskTerminator _term(n_workers, task_queues()); |
938 ParallelTaskTerminator _term(n_workers, task_queues()); |
948 ParScanThreadStateSet thread_state_set(workers->active_workers(), |
939 ParScanThreadStateSet thread_state_set(workers->active_workers(), |
949 *to(), *this, *_old_gen, *task_queues(), |
940 *to(), *this, *_old_gen, *task_queues(), |
950 _overflow_stacks, desired_plab_sz(), _term); |
941 _overflow_stacks, desired_plab_sz(), _term); |
|
942 |
|
943 thread_state_set.reset(n_workers, promotion_failed()); |
951 |
944 |
952 { |
945 { |
953 StrongRootsScope srs(n_workers); |
946 StrongRootsScope srs(n_workers); |
954 |
947 |
955 ParNewGenTask tsk(this, _old_gen, reserved().end(), &thread_state_set, &srs); |
948 ParNewGenTask tsk(this, _old_gen, reserved().end(), &thread_state_set, &srs); |