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

Unified Diff: src/v8threads.cc

Issue 18581: Enable preemption in d8. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 11 years, 11 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/top.cc ('k') | tools/v8.xcodeproj/project.pbxproj » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/v8threads.cc
===================================================================
--- src/v8threads.cc (revision 1141)
+++ src/v8threads.cc (working copy)
@@ -28,6 +28,7 @@
#include "v8.h"
#include "api.h"
+#include "bootstrapper.h"
#include "debug.h"
#include "execution.h"
#include "v8threads.h"
@@ -119,6 +120,11 @@
Thread::SetThreadLocal(thread_state_key, NULL);
return true;
}
+
+ // Make sure that the preemption thread cannot modify the thread state while
+ // it is being archived or restored.
+ ExecutionAccess access;
+
// If there is another thread that was lazily archived then we have to really
// archive it now.
if (lazily_archived_thread_.IsValid()) {
@@ -135,6 +141,7 @@
from = Debug::RestoreDebug(from);
from = StackGuard::RestoreStackGuard(from);
from = RegExpStack::RestoreStack(from);
+ from = Bootstrapper::RestoreState(from);
Thread::SetThreadLocal(thread_state_key, NULL);
state->Unlink();
state->LinkInto(ThreadState::FREE_LIST);
@@ -160,7 +167,8 @@
Top::ArchiveSpacePerThread() +
Debug::ArchiveSpacePerThread() +
StackGuard::ArchiveSpacePerThread() +
- RegExpStack::ArchiveSpacePerThread();
+ RegExpStack::ArchiveSpacePerThread() +
+ Bootstrapper::ArchiveSpacePerThread();
}
@@ -242,6 +250,7 @@
to = Debug::ArchiveDebug(to);
to = StackGuard::ArchiveStackGuard(to);
to = RegExpStack::ArchiveStack(to);
+ to = Bootstrapper::ArchiveState(to);
lazily_archived_thread_.Initialize(ThreadHandle::INVALID);
lazily_archived_thread_state_ = NULL;
}
« no previous file with comments | « src/top.cc ('k') | tools/v8.xcodeproj/project.pbxproj » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698