8080109: Use single-threaded code in Threads::possibly_parallel_oops_do when running with only one worker thread
Reviewed-by: jmasa, kbarrett
--- a/hotspot/src/share/vm/gc/g1/g1RootProcessor.cpp Wed May 20 10:45:40 2015 +0200
+++ b/hotspot/src/share/vm/gc/g1/g1RootProcessor.cpp Thu May 21 09:10:47 2015 +0200
@@ -253,7 +253,7 @@
{
G1GCParPhaseTimesTracker x(phase_times, G1GCPhaseTimes::ThreadRoots, worker_i);
- bool is_par = _g1h->n_par_threads() > 0;
+ bool is_par = _g1h->n_par_threads() > 1;
Threads::possibly_parallel_oops_do(is_par, strong_roots, thread_stack_clds, strong_code);
}
}
--- a/hotspot/src/share/vm/gc/shared/genCollectedHeap.cpp Wed May 20 10:45:40 2015 +0200
+++ b/hotspot/src/share/vm/gc/shared/genCollectedHeap.cpp Thu May 21 09:10:47 2015 +0200
@@ -609,7 +609,7 @@
// Only process code roots from thread stacks if we aren't visiting the entire CodeCache anyway
CodeBlobClosure* roots_from_code_p = (so & SO_AllCodeCache) ? NULL : code_roots;
- bool is_par = n_par_threads() > 0;
+ bool is_par = n_par_threads() > 1;
Threads::possibly_parallel_oops_do(is_par, strong_roots, roots_from_clds_p, roots_from_code_p);
if (!_process_strong_tasks->is_task_claimed(GCH_PS_Universe_oops_do)) {