< prev index next >

src/share/vm/gc/parallel/pcTasks.cpp

Print this page




 237 StealRegionCompactionTask::StealRegionCompactionTask(ParallelTaskTerminator* t):
 238   _terminator(t) {}
 239 
 240 void StealRegionCompactionTask::do_it(GCTaskManager* manager, uint which) {
 241   assert(ParallelScavengeHeap::heap()->is_gc_active(), "called outside gc");
 242 
 243   NOT_PRODUCT(GCTraceTime tm("StealRegionCompactionTask",
 244     PrintGCDetails && TraceParallelOldGCTasks, true, NULL, PSParallelCompact::gc_tracer()->gc_id()));
 245 
 246   ParCompactionManager* cm =
 247     ParCompactionManager::gc_thread_compaction_manager(which);
 248 
 249 
 250   // If not all threads are active, get a draining stack
 251   // from the list.  Else, just use this threads draining stack.
 252   uint which_stack_index;
 253   bool use_all_workers = manager->all_workers_active();
 254   if (use_all_workers) {
 255     which_stack_index = which;
 256     assert(manager->active_workers() == ParallelGCThreads,
 257            err_msg("all_workers_active has been incorrectly set: "
 258                    " active %d  ParallelGCThreads %u", manager->active_workers(),
 259                    ParallelGCThreads));
 260   } else {
 261     which_stack_index = ParCompactionManager::pop_recycled_stack_index();
 262   }
 263 
 264   cm->set_region_stack_index(which_stack_index);
 265   cm->set_region_stack(ParCompactionManager::region_list(which_stack_index));
 266   if (TraceDynamicGCThreads) {
 267     gclog_or_tty->print_cr("StealRegionCompactionTask::do_it "
 268                            "region_stack_index %d region_stack = " PTR_FORMAT " "
 269                            " empty (%d) use all workers %d",
 270     which_stack_index, p2i(ParCompactionManager::region_list(which_stack_index)),
 271     cm->region_stack()->is_empty(),
 272     use_all_workers);
 273   }
 274 
 275   // Has to drain stacks first because there may be regions on
 276   // preloaded onto the stack and this thread may never have
 277   // done a draining task.  Are the draining tasks needed?
 278 
 279   cm->drain_region_stacks();


 316   PSParallelCompact::update_and_deadwood_in_dense_prefix(cm,
 317                                                          _space_id,
 318                                                          _region_index_start,
 319                                                          _region_index_end);
 320 }
 321 
 322 void DrainStacksCompactionTask::do_it(GCTaskManager* manager, uint which) {
 323   assert(ParallelScavengeHeap::heap()->is_gc_active(), "called outside gc");
 324 
 325   NOT_PRODUCT(GCTraceTime tm("DrainStacksCompactionTask",
 326     PrintGCDetails && TraceParallelOldGCTasks, true, NULL, PSParallelCompact::gc_tracer()->gc_id()));
 327 
 328   ParCompactionManager* cm =
 329     ParCompactionManager::gc_thread_compaction_manager(which);
 330 
 331   uint which_stack_index;
 332   bool use_all_workers = manager->all_workers_active();
 333   if (use_all_workers) {
 334     which_stack_index = which;
 335     assert(manager->active_workers() == ParallelGCThreads,
 336            err_msg("all_workers_active has been incorrectly set: "
 337                    " active %d  ParallelGCThreads %u", manager->active_workers(),
 338                    ParallelGCThreads));
 339   } else {
 340     which_stack_index = stack_index();
 341   }
 342 
 343   cm->set_region_stack(ParCompactionManager::region_list(which_stack_index));
 344   if (TraceDynamicGCThreads) {
 345     gclog_or_tty->print_cr("DrainStacksCompactionTask::do_it which = %d "
 346                            "which_stack_index = %d/empty(%d) "
 347                            "use all workers %d",
 348                            which, which_stack_index,
 349                            cm->region_stack()->is_empty(),
 350                            use_all_workers);
 351   }
 352 
 353   cm->set_region_stack_index(which_stack_index);
 354 
 355   // Process any regions already in the compaction managers stacks.
 356   cm->drain_region_stacks();
 357 
 358   assert(cm->region_stack()->is_empty(), "Not empty");


 237 StealRegionCompactionTask::StealRegionCompactionTask(ParallelTaskTerminator* t):
 238   _terminator(t) {}
 239 
 240 void StealRegionCompactionTask::do_it(GCTaskManager* manager, uint which) {
 241   assert(ParallelScavengeHeap::heap()->is_gc_active(), "called outside gc");
 242 
 243   NOT_PRODUCT(GCTraceTime tm("StealRegionCompactionTask",
 244     PrintGCDetails && TraceParallelOldGCTasks, true, NULL, PSParallelCompact::gc_tracer()->gc_id()));
 245 
 246   ParCompactionManager* cm =
 247     ParCompactionManager::gc_thread_compaction_manager(which);
 248 
 249 
 250   // If not all threads are active, get a draining stack
 251   // from the list.  Else, just use this threads draining stack.
 252   uint which_stack_index;
 253   bool use_all_workers = manager->all_workers_active();
 254   if (use_all_workers) {
 255     which_stack_index = which;
 256     assert(manager->active_workers() == ParallelGCThreads,
 257            "all_workers_active has been incorrectly set: "
 258            " active %d  ParallelGCThreads %u", manager->active_workers(),
 259            ParallelGCThreads);
 260   } else {
 261     which_stack_index = ParCompactionManager::pop_recycled_stack_index();
 262   }
 263 
 264   cm->set_region_stack_index(which_stack_index);
 265   cm->set_region_stack(ParCompactionManager::region_list(which_stack_index));
 266   if (TraceDynamicGCThreads) {
 267     gclog_or_tty->print_cr("StealRegionCompactionTask::do_it "
 268                            "region_stack_index %d region_stack = " PTR_FORMAT " "
 269                            " empty (%d) use all workers %d",
 270     which_stack_index, p2i(ParCompactionManager::region_list(which_stack_index)),
 271     cm->region_stack()->is_empty(),
 272     use_all_workers);
 273   }
 274 
 275   // Has to drain stacks first because there may be regions on
 276   // preloaded onto the stack and this thread may never have
 277   // done a draining task.  Are the draining tasks needed?
 278 
 279   cm->drain_region_stacks();


 316   PSParallelCompact::update_and_deadwood_in_dense_prefix(cm,
 317                                                          _space_id,
 318                                                          _region_index_start,
 319                                                          _region_index_end);
 320 }
 321 
 322 void DrainStacksCompactionTask::do_it(GCTaskManager* manager, uint which) {
 323   assert(ParallelScavengeHeap::heap()->is_gc_active(), "called outside gc");
 324 
 325   NOT_PRODUCT(GCTraceTime tm("DrainStacksCompactionTask",
 326     PrintGCDetails && TraceParallelOldGCTasks, true, NULL, PSParallelCompact::gc_tracer()->gc_id()));
 327 
 328   ParCompactionManager* cm =
 329     ParCompactionManager::gc_thread_compaction_manager(which);
 330 
 331   uint which_stack_index;
 332   bool use_all_workers = manager->all_workers_active();
 333   if (use_all_workers) {
 334     which_stack_index = which;
 335     assert(manager->active_workers() == ParallelGCThreads,
 336            "all_workers_active has been incorrectly set: "
 337            " active %d  ParallelGCThreads %u", manager->active_workers(),
 338            ParallelGCThreads);
 339   } else {
 340     which_stack_index = stack_index();
 341   }
 342 
 343   cm->set_region_stack(ParCompactionManager::region_list(which_stack_index));
 344   if (TraceDynamicGCThreads) {
 345     gclog_or_tty->print_cr("DrainStacksCompactionTask::do_it which = %d "
 346                            "which_stack_index = %d/empty(%d) "
 347                            "use all workers %d",
 348                            which, which_stack_index,
 349                            cm->region_stack()->is_empty(),
 350                            use_all_workers);
 351   }
 352 
 353   cm->set_region_stack_index(which_stack_index);
 354 
 355   // Process any regions already in the compaction managers stacks.
 356   cm->drain_region_stacks();
 357 
 358   assert(cm->region_stack()->is_empty(), "Not empty");
< prev index next >