141 ParCompactionManager* cm = 142 ParCompactionManager::gc_thread_compaction_manager(which); 143 PCMarkAndPushClosure mark_and_push_closure(cm); 144 ParCompactionManager::FollowStackClosure follow_stack_closure(cm); 145 _rp_task.work(_work_id, *PSParallelCompact::is_alive_closure(), 146 mark_and_push_closure, follow_stack_closure); 147 } 148 149 // 150 // RefProcTaskExecutor 151 // 152 153 void RefProcTaskExecutor::execute(ProcessTask& task, uint ergo_workers) 154 { 155 ParallelScavengeHeap* heap = ParallelScavengeHeap::heap(); 156 uint active_gc_threads = heap->gc_task_manager()->active_workers(); 157 assert(active_gc_threads == ergo_workers, 158 "Ergonomically chosen workers (%u) must be equal to active workers (%u)", 159 ergo_workers, active_gc_threads); 160 OopTaskQueueSet* qset = ParCompactionManager::stack_array(); 161 ParallelTaskTerminator terminator(active_gc_threads, qset); 162 GCTaskQueue* q = GCTaskQueue::create(); 163 for(uint i=0; i<active_gc_threads; i++) { 164 q->enqueue(new RefProcTaskProxy(task, i)); 165 } 166 if (task.marks_oops_alive() && (active_gc_threads>1)) { 167 for (uint j=0; j<active_gc_threads; j++) { 168 q->enqueue(new StealMarkingTask(&terminator)); 169 } 170 } 171 PSParallelCompact::gc_task_manager()->execute_and_wait(q); 172 } 173 174 // 175 // StealMarkingTask 176 // 177 178 StealMarkingTask::StealMarkingTask(ParallelTaskTerminator* t) : 179 _terminator(t) {} 180 181 void StealMarkingTask::do_it(GCTaskManager* manager, uint which) { 182 assert(ParallelScavengeHeap::heap()->is_gc_active(), "called outside gc"); 183 184 ParCompactionManager* cm = 185 ParCompactionManager::gc_thread_compaction_manager(which); 186 187 oop obj = NULL; 188 ObjArrayTask task; | 141 ParCompactionManager* cm = 142 ParCompactionManager::gc_thread_compaction_manager(which); 143 PCMarkAndPushClosure mark_and_push_closure(cm); 144 ParCompactionManager::FollowStackClosure follow_stack_closure(cm); 145 _rp_task.work(_work_id, *PSParallelCompact::is_alive_closure(), 146 mark_and_push_closure, follow_stack_closure); 147 } 148 149 // 150 // RefProcTaskExecutor 151 // 152 153 void RefProcTaskExecutor::execute(ProcessTask& task, uint ergo_workers) 154 { 155 ParallelScavengeHeap* heap = ParallelScavengeHeap::heap(); 156 uint active_gc_threads = heap->gc_task_manager()->active_workers(); 157 assert(active_gc_threads == ergo_workers, 158 "Ergonomically chosen workers (%u) must be equal to active workers (%u)", 159 ergo_workers, active_gc_threads); 160 OopTaskQueueSet* qset = ParCompactionManager::stack_array(); 161 TaskTerminator terminator(active_gc_threads, qset); 162 163 GCTaskQueue* q = GCTaskQueue::create(); 164 for(uint i=0; i<active_gc_threads; i++) { 165 q->enqueue(new RefProcTaskProxy(task, i)); 166 } 167 if (task.marks_oops_alive() && (active_gc_threads>1)) { 168 for (uint j=0; j<active_gc_threads; j++) { 169 q->enqueue(new StealMarkingTask(terminator.terminator())); 170 } 171 } 172 PSParallelCompact::gc_task_manager()->execute_and_wait(q); 173 } 174 175 // 176 // StealMarkingTask 177 // 178 179 StealMarkingTask::StealMarkingTask(ParallelTaskTerminator* t) : 180 _terminator(t) {} 181 182 void StealMarkingTask::do_it(GCTaskManager* manager, uint which) { 183 assert(ParallelScavengeHeap::heap()->is_gc_active(), "called outside gc"); 184 185 ParCompactionManager* cm = 186 ParCompactionManager::gc_thread_compaction_manager(which); 187 188 oop obj = NULL; 189 ObjArrayTask task; |