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

Unified Diff: src/parsing/parser-base.h

Issue 1573363002: [parser cleanup] Unify implementation of CheckPossibleEvalCall (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 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
« no previous file with comments | « src/parsing/parser.cc ('k') | src/parsing/preparser.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/parsing/parser-base.h
diff --git a/src/parsing/parser-base.h b/src/parsing/parser-base.h
index 1aa4f3722a6a61d4f571e9add299b8e0bf1352af..a5e757782b064ccae49e4c49f20cc47e70abdd8b 100644
--- a/src/parsing/parser-base.h
+++ b/src/parsing/parser-base.h
@@ -830,6 +830,17 @@ class ParserBase : public Traits {
return true;
}
+ // Keep track of eval() calls since they disable all local variable
+ // optimizations. This checks if expression is an eval call, and if yes,
+ // forwards the information to scope.
+ void CheckPossibleEvalCall(ExpressionT expression, Scope* scope) {
+ if (Traits::IsIdentifier(expression) &&
+ Traits::IsEval(Traits::AsIdentifier(expression))) {
+ scope->DeclarationScope()->RecordEvalCall();
+ scope->RecordEvalCall();
+ }
+ }
+
// Used to validate property names in object literals and class literals
enum PropertyKind {
kAccessorProperty,
« no previous file with comments | « src/parsing/parser.cc ('k') | src/parsing/preparser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698