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

Unified Diff: src/background-parsing-task.cc

Issue 2182493006: Background parsing: Ensure we don't use the Isolate on a background thread. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 5 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/background-parsing-task.cc
diff --git a/src/background-parsing-task.cc b/src/background-parsing-task.cc
index c5abe3ab1b179714785ad703a4d78351debd39c7..cbfaae5fe98eaa9ea39f9851b293bb59301890cf 100644
--- a/src/background-parsing-task.cc
+++ b/src/background-parsing-task.cc
@@ -49,6 +49,11 @@ void BackgroundParsingTask::Run() {
source_->info->set_cached_data(&script_data);
}
+ // Nullify the Isolate temporarily so that the background parser doesn't
+ // accidentally use it.
+ Isolate* isolate = source_->info->isolate();
+ source_->info->set_isolate(nullptr);
+
uintptr_t stack_limit =
reinterpret_cast<uintptr_t>(&stack_limit) - stack_size_ * KB;
@@ -65,6 +70,7 @@ void BackgroundParsingTask::Run() {
script_data->ReleaseDataOwnership();
delete script_data;
}
+ source_->info->set_isolate(isolate);
}
} // namespace internal
} // namespace v8
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698