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

Unified Diff: src/parsing/parser.h

Issue 2656753003: [ast/parsing] Pessimistically assume all top-level variables will be assigned. (Closed)
Patch Set: Created 3 years, 11 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/parsing/parser.h
diff --git a/src/parsing/parser.h b/src/parsing/parser.h
index 0ae8fb9cd100270fb29be1e1287c15b927420f40..d2dcca1a08f649948670f8e9531dcc592484c8af 100644
--- a/src/parsing/parser.h
+++ b/src/parsing/parser.h
@@ -823,6 +823,18 @@ class V8_EXPORT_PRIVATE Parser : public NON_EXPORTED_BASE(ParserBase<Parser>) {
}
}
+ // We have to pessimistically assume that top-level variables will be
+ // assigned. This is because they might be accessed by a lazily parsed
marja 2017/01/25 12:44:10 You could fix this comment in this CL :) (There's
+ // top-level function, which, for efficiency, we preparse without
+ // variable tracking. In the case of a script (not a module), they
+ // might also get accessed by another script.
+ V8_INLINE static void MarkTopLevelVariableAsAssigned(Scope* scope,
+ VariableProxy* proxy) {
+ if (scope->is_script_scope() || scope->is_module_scope()) {
adamk 2017/01/27 16:07:36 I thought we currently disable preparsing of funct
+ proxy->set_is_assigned();
+ }
+ }
+
// Returns true if we have a binary expression between two numeric
// literals. In that case, *x will be changed to an expression which is the
// computed value.
« no previous file with comments | « src/ast/scopes.cc ('k') | src/parsing/parser.cc » ('j') | src/parsing/pattern-rewriter.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698