Commit 9a549cc6 authored by jochen's avatar jochen Committed by Commit bot

Deserialize the scope chain for background parsing jobs on the main thread

Even though there is no scope chain, just the empty outer scope.

R=marja@chromium.org
BUG=

Review-Url: https://codereview.chromium.org/2273553003
Cr-Commit-Position: refs/heads/master@{#38814}
parent dc18cc1d
...@@ -42,6 +42,9 @@ BackgroundParsingTask::BackgroundParsingTask( ...@@ -42,6 +42,9 @@ BackgroundParsingTask::BackgroundParsingTask(
// Parser needs to stay alive for finalizing the parsing on the main // Parser needs to stay alive for finalizing the parsing on the main
// thread. // thread.
source_->parser.reset(new Parser(source_->info.get())); source_->parser.reset(new Parser(source_->info.get()));
source_->parser->DeserializeScopeChain(
source_->info.get(), Handle<Context>::null(),
Scope::DeserializationMode::kDeserializeOffHeap);
} }
...@@ -61,9 +64,6 @@ void BackgroundParsingTask::Run() { ...@@ -61,9 +64,6 @@ void BackgroundParsingTask::Run() {
Isolate* isolate = source_->info->isolate(); Isolate* isolate = source_->info->isolate();
source_->info->set_isolate(nullptr); source_->info->set_isolate(nullptr);
source_->parser->DeserializeScopeChain(
source_->info.get(), Handle<Context>::null(),
Scope::DeserializationMode::kDeserializeOffHeap);
source_->parser->ParseOnBackground(source_->info.get()); source_->parser->ParseOnBackground(source_->info.get());
if (script_data_ != nullptr) { if (script_data_ != nullptr) {
......
...@@ -767,6 +767,7 @@ Parser::Parser(ParseInfo* info) ...@@ -767,6 +767,7 @@ Parser::Parser(ParseInfo* info)
void Parser::DeserializeScopeChain( void Parser::DeserializeScopeChain(
ParseInfo* info, Handle<Context> context, ParseInfo* info, Handle<Context> context,
Scope::DeserializationMode deserialization_mode) { Scope::DeserializationMode deserialization_mode) {
DCHECK(ThreadId::Current().Equals(info->isolate()->thread_id()));
// TODO(wingo): Add an outer SCRIPT_SCOPE corresponding to the native // TODO(wingo): Add an outer SCRIPT_SCOPE corresponding to the native
// context, which will have the "this" binding for script scopes. // context, which will have the "this" binding for script scopes.
DeclarationScope* script_scope = NewScriptScope(); DeclarationScope* script_scope = NewScriptScope();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment