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

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

Issue 2242583003: [Parser] Remove Variable::is_possibly_eval. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@toon_cl
Patch Set: Address comment Created 4 years, 4 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/interpreter/bytecode-generator.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 c7e4daf97c2b555056c1e17d9d7d78d09df19f0f..2be6dfb15572fd85a73c4341b20ffbdda36dee25 100644
--- a/src/parsing/parser-base.h
+++ b/src/parsing/parser-base.h
@@ -1160,7 +1160,8 @@ class ParserBase : public Traits {
// 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) {
+ Call::PossiblyEval CheckPossibleEvalCall(ExpressionT expression,
+ Scope* scope) {
if (Traits::IsIdentifier(expression) &&
Traits::IsEval(Traits::AsIdentifier(expression))) {
scope->RecordEvalCall();
@@ -1169,7 +1170,9 @@ class ParserBase : public Traits {
// in case it includes declarations that will be hoisted.
scope->GetDeclarationScope()->RecordEvalCall();
}
+ return Call::IS_POSSIBLY_EVAL;
}
+ return Call::NOT_EVAL;
}
// Used to validate property names in object literals and class literals
@@ -2916,14 +2919,15 @@ ParserBase<Traits>::ParseLeftHandSideExpression(
// no explicit receiver.
// These calls are marked as potentially direct eval calls. Whether
// they are actually direct calls to eval is determined at run time.
- this->CheckPossibleEvalCall(result, scope());
+ Call::PossiblyEval is_possibly_eval =
+ CheckPossibleEvalCall(result, scope());
bool is_super_call = result->IsSuperCallReference();
if (spread_pos.IsValid()) {
args = Traits::PrepareSpreadArguments(args);
result = Traits::SpreadCall(result, args, pos);
} else {
- result = factory()->NewCall(result, args, pos);
+ result = factory()->NewCall(result, args, pos, is_possibly_eval);
}
// Explicit calls to the super constructor using super() perform an
« no previous file with comments | « src/interpreter/bytecode-generator.cc ('k') | src/parsing/preparser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698