8081007: Remove redundant active worker variables and calls in ParNewGeneration::collect
authorstefank
Tue, 26 May 2015 10:06:03 +0200
changeset 30883 357482fa587b
parent 30882 dd444cc8d38d
child 30884 6b4b41edd225
8081007: Remove redundant active worker variables and calls in ParNewGeneration::collect Reviewed-by: pliden, kbarrett, ehelin
hotspot/src/share/vm/gc/cms/parNewGeneration.cpp
--- a/hotspot/src/share/vm/gc/cms/parNewGeneration.cpp	Mon May 25 16:59:28 2015 +0200
+++ b/hotspot/src/share/vm/gc/cms/parNewGeneration.cpp	Tue May 26 10:06:03 2015 +0200
@@ -927,23 +927,21 @@
   to()->clear(SpaceDecorator::Mangle);
 
   gch->save_marks();
-  assert(workers != NULL, "Need parallel worker threads.");
-  uint n_workers = active_workers;
 
   // Set the correct parallelism (number of queues) in the reference processor
-  ref_processor()->set_active_mt_degree(n_workers);
+  ref_processor()->set_active_mt_degree(active_workers);
 
   // Always set the terminator for the active number of workers
   // because only those workers go through the termination protocol.
-  ParallelTaskTerminator _term(n_workers, task_queues());
-  ParScanThreadStateSet thread_state_set(workers->active_workers(),
+  ParallelTaskTerminator _term(active_workers, task_queues());
+  ParScanThreadStateSet thread_state_set(active_workers,
                                          *to(), *this, *_old_gen, *task_queues(),
                                          _overflow_stacks, desired_plab_sz(), _term);
 
-  thread_state_set.reset(n_workers, promotion_failed());
+  thread_state_set.reset(active_workers, promotion_failed());
 
   {
-    StrongRootsScope srs(n_workers);
+    StrongRootsScope srs(active_workers);
 
     ParNewGenTask tsk(this, _old_gen, reserved().end(), &thread_state_set, &srs);
     gch->rem_set()->prepare_for_younger_refs_iterate(true);
@@ -951,7 +949,7 @@
     // separate thread causes wide variance in run times.  We can't help this
     // in the multi-threaded case, but we special-case n=1 here to get
     // repeatable measurements of the 1-thread overhead of the parallel code.
-    if (n_workers > 1) {
+    if (active_workers > 1) {
       workers->run_task(&tsk);
     } else {
       tsk.work(0);
@@ -1024,7 +1022,7 @@
   to()->set_concurrent_iteration_safe_limit(to()->top());
 
   if (ResizePLAB) {
-    plab_stats()->adjust_desired_plab_sz(n_workers);
+    plab_stats()->adjust_desired_plab_sz(active_workers);
   }
 
   if (PrintGC && !PrintGCDetails) {