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

Unified Diff: src/v8threads.cc

Issue 10417010: Run Crankshaft on a separate thread. (Closed) Base URL: https://chromiumcodereview.appspot.com/10387157
Patch Set: 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
« src/v8.cc ('K') | « src/v8.cc ('k') | test/cctest/test-debug.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/v8threads.cc
diff --git a/src/v8threads.cc b/src/v8threads.cc
index fd8d5364011cdee45c196cd58550fa31313cb9d7..25d7b90f78b693ae8f3285d9d2c176bb8806cf68 100644
--- a/src/v8threads.cc
+++ b/src/v8threads.cc
@@ -103,7 +103,7 @@ Locker::~Locker() {
ASSERT(isolate_->thread_manager()->IsLockedByCurrentThread());
if (has_lock_) {
if (isolate_->IsDefaultIsolate()) {
- isolate_->Exit();
+ isolate_->Exit(false);
}
if (top_level_) {
isolate_->thread_manager()->FreeThreadResources();
@@ -122,7 +122,9 @@ Unlocker::Unlocker(v8::Isolate* isolate)
}
ASSERT(isolate_->thread_manager()->IsLockedByCurrentThread());
if (isolate_->IsDefaultIsolate()) {
- isolate_->Exit();
+ // Small hack to make sure ArchiveThread does not see an unlocked
+ // view of the isolate.
+ isolate_->Exit(false);
}
isolate_->thread_manager()->ArchiveThread();
isolate_->thread_manager()->Unlock();
@@ -210,6 +212,7 @@ bool ThreadManager::RestoreThread() {
void ThreadManager::Lock() {
+ ASSERT(!IsLockedByCurrentThread());
mutex_->Lock();
mutex_owner_ = ThreadId::Current();
ASSERT(IsLockedByCurrentThread());
@@ -217,6 +220,7 @@ void ThreadManager::Lock() {
void ThreadManager::Unlock() {
+ ASSERT(IsLockedByCurrentThread());
mutex_owner_ = ThreadId::Invalid();
mutex_->Unlock();
}
« src/v8.cc ('K') | « src/v8.cc ('k') | test/cctest/test-debug.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698