Commit d538ff90 authored by yangguo@chromium.org's avatar yangguo@chromium.org

Disable concurrent osr when concurrent recompilation is disabled.

Also introduce a flag for a quick check that concurrency is on.

R=jkummerow@chromium.org
BUG=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@17570 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 59536de7
......@@ -305,7 +305,7 @@ class SystemThreadManager {
enum ParallelSystemComponent {
PARALLEL_SWEEPING,
CONCURRENT_SWEEPING,
PARALLEL_RECOMPILATION
CONCURRENT_RECOMPILATION
};
static int NumberOfParallelSystemThreads(ParallelSystemComponent type);
......
......@@ -346,23 +346,23 @@ bool OptimizingCompilerThread::IsQueuedForOSR(JSFunction* function) {
void OptimizingCompilerThread::AddToOsrBuffer(RecompileJob* job) {
ASSERT(!IsOptimizerThread());
// Find the next slot that is empty or has a stale job.
RecompileJob* stale = NULL;
while (true) {
RecompileJob* stale = osr_buffer_[osr_buffer_cursor_];
stale = osr_buffer_[osr_buffer_cursor_];
if (stale == NULL || stale->IsWaitingForInstall()) break;
osr_buffer_cursor_ = (osr_buffer_cursor_ + 1) % osr_buffer_capacity_;
}
// Add to found slot and dispose the evicted job.
RecompileJob* evicted = osr_buffer_[osr_buffer_cursor_];
if (evicted != NULL) {
ASSERT(evicted->IsWaitingForInstall());
CompilationInfo* info = evicted->info();
if (stale != NULL) {
ASSERT(stale->IsWaitingForInstall());
CompilationInfo* info = stale->info();
if (FLAG_trace_osr) {
PrintF("[COSR - Discarded ");
info->closure()->PrintName();
PrintF(", AST id %d]\n", info->osr_ast_id().ToInt());
}
DisposeRecompileJob(evicted, false);
DisposeRecompileJob(stale, false);
}
osr_buffer_[osr_buffer_cursor_] = job;
osr_buffer_cursor_ = (osr_buffer_cursor_ + 1) % osr_buffer_capacity_;
......
......@@ -206,6 +206,7 @@ void V8::InitializeOncePerProcessImpl() {
if (FLAG_concurrent_recompilation &&
(FLAG_trace_hydrogen || FLAG_trace_hydrogen_stubs)) {
FLAG_concurrent_recompilation = false;
FLAG_concurrent_osr = false;
PrintF("Concurrent recompilation has been disabled for tracing.\n");
}
......@@ -229,8 +230,9 @@ void V8::InitializeOncePerProcessImpl() {
if (FLAG_concurrent_recompilation &&
SystemThreadManager::NumberOfParallelSystemThreads(
SystemThreadManager::PARALLEL_RECOMPILATION) == 0) {
SystemThreadManager::CONCURRENT_RECOMPILATION) == 0) {
FLAG_concurrent_recompilation = false;
FLAG_concurrent_osr = false;
}
Sampler::SetUp();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment