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

Unified Diff: src/api.cc

Issue 962963007: Use locker when creating snapshot if necessary. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fix assertion instead Created 5 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 | « no previous file | test/cctest/test-serialize.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 1dd3f616660997266414cd5556540a2c4d697758..cb30a5319d0538e487b59e5527a013ea8e9a63b4 100644
--- a/src/api.cc
+++ b/src/api.cc
@@ -590,10 +590,14 @@ void HandleScope::Initialize(Isolate* isolate) {
// We do not want to check the correct usage of the Locker class all over the
// place, so we do it only here: Without a HandleScope, an embedder can do
// almost nothing, so it is enough to check in this central place.
- Utils::ApiCheck(!v8::Locker::IsActive() ||
- internal_isolate->thread_manager()->IsLockedByCurrentThread(),
- "HandleScope::HandleScope",
- "Entering the V8 API without proper locking in place");
+ // We make an exception if the serializer is enabled, which means that the
+ // Isolate is exclusively used to create a snapshot.
+ Utils::ApiCheck(
+ !v8::Locker::IsActive() ||
+ internal_isolate->thread_manager()->IsLockedByCurrentThread() ||
+ internal_isolate->serializer_enabled(),
+ "HandleScope::HandleScope",
+ "Entering the V8 API without proper locking in place");
i::HandleScopeData* current = internal_isolate->handle_scope_data();
isolate_ = internal_isolate;
prev_next_ = current->next;
« no previous file with comments | « no previous file | test/cctest/test-serialize.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698