8080109: Use single-threaded code in Threads::possibly_parallel_oops_do when running with only one worker thread

Reviewed-by: jmasa, kbarrett
This commit is contained in:
Stefan Karlsson 2015-05-21 09:10:47 +02:00
parent c8fa7eb4dd
commit e13e75547c
2 changed files with 2 additions and 2 deletions

View File

@ -253,7 +253,7 @@ void G1RootProcessor::process_java_roots(OopClosure* strong_roots,
{
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);
}
}

View File

@ -609,7 +609,7 @@ void GenCollectedHeap::process_roots(bool activate_scope,
// 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)) {