From d538ff90b53b7672f089e467d0db1eb1c114909c Mon Sep 17 00:00:00 2001 From: "yangguo@chromium.org" Date: Thu, 7 Nov 2013 16:25:20 +0000 Subject: [PATCH] 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 --- src/isolate.h | 2 +- src/optimizing-compiler-thread.cc | 12 ++++++------ src/v8.cc | 4 +++- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/isolate.h b/src/isolate.h index 9aa14ee..cef7159 100644 --- a/src/isolate.h +++ b/src/isolate.h @@ -305,7 +305,7 @@ class SystemThreadManager { enum ParallelSystemComponent { PARALLEL_SWEEPING, CONCURRENT_SWEEPING, - PARALLEL_RECOMPILATION + CONCURRENT_RECOMPILATION }; static int NumberOfParallelSystemThreads(ParallelSystemComponent type); diff --git a/src/optimizing-compiler-thread.cc b/src/optimizing-compiler-thread.cc index e9c0254..fbc4f05 100644 --- a/src/optimizing-compiler-thread.cc +++ b/src/optimizing-compiler-thread.cc @@ -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_; diff --git a/src/v8.cc b/src/v8.cc index 62330c3..fc6c56d 100644 --- a/src/v8.cc +++ b/src/v8.cc @@ -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(); -- 2.7.4