Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(874)

Unified Diff: src/optimizing-compiler-thread.cc

Issue 11419012: Introduce helper functions to test parallel recompilation. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/optimizing-compiler-thread.cc
diff --git a/src/optimizing-compiler-thread.cc b/src/optimizing-compiler-thread.cc
index 06018dd1a993b876d9e846eb73c5ffc5af034c2e..48ee12c680b33b8692c63755cc80bed3ca3bc5dd 100644
--- a/src/optimizing-compiler-thread.cc
+++ b/src/optimizing-compiler-thread.cc
@@ -72,7 +72,13 @@ void OptimizingCompilerThread::Run() {
USE(status);
output_queue_.Enqueue(optimizing_compiler);
- isolate_->stack_guard()->RequestCodeReadyEvent();
+ if (!FLAG_manual_parallel_recompilation) {
+ isolate_->stack_guard()->RequestCodeReadyEvent();
+ } else {
+ // In manual mode, do not trigger a code ready event.
+ // Instead, wait for the optimized functions to be installed manually.
+ output_queue_semaphore_->Signal();
+ }
if (FLAG_trace_parallel_recompilation) {
time_spent_compiling_ += OS::Ticks() - compiling_start;
@@ -99,6 +105,9 @@ void OptimizingCompilerThread::InstallOptimizedFunctions() {
HandleScope handle_scope(isolate_);
int functions_installed = 0;
while (!output_queue_.IsEmpty()) {
+ if (FLAG_manual_parallel_recompilation) {
+ output_queue_semaphore_->Wait();
+ }
OptimizingCompiler* compiler = NULL;
output_queue_.Dequeue(&compiler);
Compiler::InstallOptimizedCode(compiler);
@@ -110,6 +119,17 @@ void OptimizingCompilerThread::InstallOptimizedFunctions() {
}
+Handle<SharedFunctionInfo>
+ OptimizingCompilerThread::InstallNextOptimizedFunction() {
+ ASSERT(FLAG_manual_parallel_recompilation);
+ output_queue_semaphore_->Wait();
+ OptimizingCompiler* compiler = NULL;
+ output_queue_.Dequeue(&compiler);
+ Compiler::InstallOptimizedCode(compiler);
+ return compiler->info()->shared_info();
+}
+
+
void OptimizingCompilerThread::QueueForOptimization(
OptimizingCompiler* optimizing_compiler) {
input_queue_.Enqueue(optimizing_compiler);
« no previous file with comments | « src/optimizing-compiler-thread.h ('k') | src/runtime.h » ('j') | src/runtime.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698