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

Unified Diff: src/parsing/parse-info.cc

Issue 2397053003: [parser] Load outer ScopeInfo from SharedFunctionInfo. (Closed)
Patch Set: Created 4 years, 2 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/parsing/parse-info.cc
diff --git a/src/parsing/parse-info.cc b/src/parsing/parse-info.cc
index 5b9b5e4ef0635ad9fa59380fc3e082f86d2007e6..927dea86165ab96e2710aadb7a194bed3b7bd458 100644
--- a/src/parsing/parse-info.cc
+++ b/src/parsing/parse-info.cc
@@ -32,11 +32,7 @@ ParseInfo::ParseInfo(Zone* zone)
literal_(nullptr) {}
ParseInfo::ParseInfo(Zone* zone, Handle<JSFunction> function)
- : ParseInfo(zone, Handle<SharedFunctionInfo>(function->shared())) {
- if (!function->context()->IsNativeContext()) {
- set_outer_scope_info(handle(function->context()->scope_info()));
- }
-}
+ : ParseInfo(zone, Handle<SharedFunctionInfo>(function->shared())) {}
ParseInfo::ParseInfo(Zone* zone, Handle<SharedFunctionInfo> shared)
: ParseInfo(zone) {
@@ -59,6 +55,12 @@ ParseInfo::ParseInfo(Zone* zone, Handle<SharedFunctionInfo> shared)
if (!script.is_null() && script->type() == Script::TYPE_NATIVE) {
set_native();
}
+
+ Handle<HeapObject> scope_info(shared->outer_scope_info());
+ if (!scope_info->IsTheHole(isolate()) &&
+ Handle<ScopeInfo>::cast(scope_info)->length() > 0) {
+ set_outer_scope_info(Handle<ScopeInfo>::cast(scope_info));
+ }
}
ParseInfo::ParseInfo(Zone* zone, Handle<Script> script) : ParseInfo(zone) {
« 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