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

Unified Diff: src/v8threads.cc

Issue 6529055: [Isolates] Merge crankshaft (r5922 from bleeding_edge). (Closed)
Patch Set: Win32 port Created 9 years, 10 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/v8globals.h ('k') | src/v8utils.h » ('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 0d75d743adb8f6c528be206a742f3725fd77d0c5..c7060b471c2b780cded395df3821005997521e94 100644
--- a/src/v8threads.cc
+++ b/src/v8threads.cc
@@ -74,7 +74,7 @@ Locker::Locker() : has_lock_(false), top_level_(true) {
// Make sure that V8 is initialized. Archiving of threads interferes
// with deserialization by adding additional root pointers, so we must
// initialize here, before anyone can call ~Locker() or Unlocker().
- if (!internal::V8::IsRunning()) {
+ if (!isolate->IsInitialized()) {
V8::Initialize();
}
// This may be a locker within an unlocker in which case we have to
@@ -82,7 +82,7 @@ Locker::Locker() : has_lock_(false), top_level_(true) {
if (isolate->thread_manager()->RestoreThread()) {
top_level_ = false;
} else {
- internal::ExecutionAccess access;
+ internal::ExecutionAccess access(isolate);
isolate->stack_guard()->ClearThread(access);
isolate->stack_guard()->InitThread(access);
}
@@ -98,6 +98,8 @@ bool Locker::IsLocked() {
Locker::~Locker() {
+ // TODO(isolate): this should use a field storing the isolate it
+ // locked instead.
internal::Isolate* isolate = internal::Isolate::Current();
ASSERT(isolate->thread_manager()->IsLockedByCurrentThread());
if (has_lock_) {
@@ -120,6 +122,7 @@ Unlocker::Unlocker() {
Unlocker::~Unlocker() {
+ // TODO(isolates): check it's the isolate we unlocked.
internal::Isolate* isolate = internal::Isolate::Current();
ASSERT(!isolate->thread_manager()->IsLockedByCurrentThread());
isolate->thread_manager()->Lock();
@@ -157,7 +160,7 @@ bool ThreadManager::RestoreThread() {
// Make sure that the preemption thread cannot modify the thread state while
// it is being archived or restored.
- ExecutionAccess access;
+ ExecutionAccess access(isolate_);
// If there is another thread that was lazily archived then we have to really
// archive it now.
@@ -290,7 +293,7 @@ ThreadManager::ThreadManager()
ThreadManager::~ThreadManager() {
- // TODO(isolates): Destroy TLS keys and mutexes.
+ // TODO(isolates): Destroy mutexes.
}
« no previous file with comments | « src/v8globals.h ('k') | src/v8utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698