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

Unified Diff: src/isolate.cc

Issue 10417010: Run Crankshaft on a separate thread. (Closed) Base URL: https://chromiumcodereview.appspot.com/10387157
Patch Set: Set optimize_in_parallel to false by default. Created 8 years, 7 months 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
« no previous file with comments | « src/isolate.h ('k') | src/objects.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/isolate.cc
diff --git a/src/isolate.cc b/src/isolate.cc
index 0c97abd89e8e186722834fad855f9adc4141783b..8ab9efe72ef89c4143ebaa9e0d99e9aa7ea9831f 100644
--- a/src/isolate.cc
+++ b/src/isolate.cc
@@ -41,6 +41,7 @@
#include "lithium-allocator.h"
#include "log.h"
#include "messages.h"
+#include "optimizing-compiler-thread.h"
#include "platform.h"
#include "regexp-stack.h"
#include "runtime-profiler.h"
@@ -1552,6 +1553,13 @@ void Isolate::Deinit() {
if (FLAG_hydrogen_stats) HStatistics::Instance()->Print();
+ if (FLAG_optimize_in_parallel) {
+ ASSERT(optimizing_compiler_thread_);
+ optimizing_compiler_thread_->StopThread();
+ delete optimizing_compiler_thread_;
+ optimizing_compiler_thread_ = NULL;
+ }
+
// We must stop the logger before we tear down other components.
logger_->EnsureTickerStopped();
@@ -1592,6 +1600,12 @@ void Isolate::SetIsolateThreadLocals(Isolate* isolate,
}
+void Isolate::queue_for_optimization(Handle<JSFunction> function) {
+ ASSERT(FLAG_optimize_in_parallel);
+ optimizing_compiler_thread_->QueueForOptimization(function);
+}
+
+
Isolate::~Isolate() {
TRACE_ISOLATE(destructor);
@@ -1864,6 +1878,11 @@ bool Isolate::Init(Deserializer* des) {
CHECK_EQ(static_cast<int>(OFFSET_OF(Isolate, heap_.roots_)),
Internals::kIsolateRootsOffset);
+ if (FLAG_optimize_in_parallel) {
+ optimizing_compiler_thread_ = new OptimizingCompilerThread(this);
+ optimizing_compiler_thread_->Start();
+ }
+
state_ = INITIALIZED;
time_millis_at_init_ = OS::TimeCurrentMillis();
return true;
« no previous file with comments | « src/isolate.h ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698