Turn off parallel and concurrent sweeping on system with just one processor/core.

BUG=

Review URL: https://codereview.chromium.org/12380020

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13777 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
hpayer@chromium.org 2013-02-28 15:18:15 +00:00
parent a9374e2fea
commit a2b216c47f

View File

@ -136,7 +136,7 @@ int SystemThreadManager::NumberOfParallelSystemThreads(
int number_of_threads = Min(OS::NumberOfCores(), kMaxThreads); int number_of_threads = Min(OS::NumberOfCores(), kMaxThreads);
ASSERT(number_of_threads > 0); ASSERT(number_of_threads > 0);
if (number_of_threads == 1) { if (number_of_threads == 1) {
return 1; return 0;
} }
if (type == PARALLEL_SWEEPING) { if (type == PARALLEL_SWEEPING) {
return number_of_threads; return number_of_threads;
@ -2173,6 +2173,8 @@ bool Isolate::Init(Deserializer* des) {
marking_thread_[i] = new MarkingThread(this); marking_thread_[i] = new MarkingThread(this);
marking_thread_[i]->Start(); marking_thread_[i]->Start();
} }
} else {
FLAG_parallel_marking = false;
} }
if (FLAG_sweeper_threads == 0) { if (FLAG_sweeper_threads == 0) {
@ -2192,6 +2194,9 @@ bool Isolate::Init(Deserializer* des) {
sweeper_thread_[i] = new SweeperThread(this); sweeper_thread_[i] = new SweeperThread(this);
sweeper_thread_[i]->Start(); sweeper_thread_[i]->Start();
} }
} else {
FLAG_concurrent_sweeping = false;
FLAG_parallel_sweeping = false;
} }
return true; return true;
} }