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}
This commit is contained in:
jochen 2016-08-23 04:45:59 -07:00 committed by Commit bot
parent dc18cc1d4f
commit 9a549cc621
2 changed files with 4 additions and 3 deletions

View File

@ -42,6 +42,9 @@ BackgroundParsingTask::BackgroundParsingTask(
// Parser needs to stay alive for finalizing the parsing on the main
// thread.
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() {
Isolate* isolate = source_->info->isolate();
source_->info->set_isolate(nullptr);
source_->parser->DeserializeScopeChain(
source_->info.get(), Handle<Context>::null(),
Scope::DeserializationMode::kDeserializeOffHeap);
source_->parser->ParseOnBackground(source_->info.get());
if (script_data_ != nullptr) {

View File

@ -767,6 +767,7 @@ Parser::Parser(ParseInfo* info)
void Parser::DeserializeScopeChain(
ParseInfo* info, Handle<Context> context,
Scope::DeserializationMode deserialization_mode) {
DCHECK(ThreadId::Current().Equals(info->isolate()->thread_id()));
// TODO(wingo): Add an outer SCRIPT_SCOPE corresponding to the native
// context, which will have the "this" binding for script scopes.
DeclarationScope* script_scope = NewScriptScope();