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

Unified Diff: src/api.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/SConscript ('k') | src/d8.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/api.cc
diff --git a/src/api.cc b/src/api.cc
index 52a84edfdabf6e797b3d87cd1b2786eb6bfdd5a2..3c9d1f4e2bec447fd6c9aa831a69af68c26179e1 100644
--- a/src/api.cc
+++ b/src/api.cc
@@ -673,6 +673,14 @@ void V8::DisposeGlobal(i::Object** obj) {
HandleScope::HandleScope() {
i::Isolate* isolate = i::Isolate::Current();
+ if (i::FLAG_optimize_in_parallel &&
+ !isolate->thread_manager()->IsLockedByCurrentThread()) {
+ has_isolate_lock_ = true;
+ isolate->thread_manager()->Lock();
+ } else {
+ has_isolate_lock_ = false;
+ }
+
API_ENTRY_CHECK(isolate, "HandleScope::HandleScope");
v8::ImplementationUtilities::HandleScopeData* current =
isolate->handle_scope_data();
@@ -688,6 +696,9 @@ HandleScope::~HandleScope() {
if (!is_closed_) {
Leave();
}
+ if (has_isolate_lock_) {
+ isolate_->thread_manager()->Unlock();
+ }
}
« no previous file with comments | « src/SConscript ('k') | src/d8.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698