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

Unified Diff: src/compiler-dispatcher/compiler-dispatcher-job.cc

Issue 2342443004: Only pass the outer scope info with ParseInfo (Closed)
Patch Set: Created 4 years, 3 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
Index: src/compiler-dispatcher/compiler-dispatcher-job.cc
diff --git a/src/compiler-dispatcher/compiler-dispatcher-job.cc b/src/compiler-dispatcher/compiler-dispatcher-job.cc
index f7959b6a0d75b069408491016b89fef041c0c7b4..1ef7291ae97fdb7adea2657f0ea6e3b705ef7983 100644
--- a/src/compiler-dispatcher/compiler-dispatcher-job.cc
+++ b/src/compiler-dispatcher/compiler-dispatcher-job.cc
@@ -83,8 +83,12 @@ void CompilerDispatcherJob::PrepareToParseOnMainThread() {
parse_info_->set_language_mode(shared->language_mode());
parser_.reset(new Parser(parse_info_.get()));
- parser_->DeserializeScopeChain(parse_info_.get(),
- handle(function_->context(), isolate_));
+ parser_->DeserializeScopeChain(
+ parse_info_.get(),
+ function_->context()->IsNativeContext()
+ ? MaybeHandle<ScopeInfo>()
+ : MaybeHandle<ScopeInfo>(function_->context()->scope_info(),
+ isolate_));
Handle<String> name(String::cast(shared->name()));
parse_info_->set_function_name(
@@ -146,7 +150,10 @@ bool CompilerDispatcherJob::FinalizeParsingOnMainThread() {
Handle<Script> script(Script::cast(shared->script()), isolate_);
parse_info_->set_script(script);
- parse_info_->set_context(handle(function_->context(), isolate_));
+ if (!function_->context()->IsNativeContext()) {
+ parse_info_->set_outer_scope_info(
+ handle(function_->context()->scope_info(), isolate_));
+ }
parse_info_->set_shared_info(handle(function_->shared(), isolate_));
// Do the parsing tasks which need to be done on the main thread. This will

Powered by Google App Engine
This is Rietveld 408576698