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

Side by Side Diff: src/parsing/parser.cc

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 unified diff | Download patch
« no previous file with comments | « src/parsing/parser.h ('k') | src/parsing/parser-base.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/parsing/parser.h" 5 #include "src/parsing/parser.h"
6 6
7 #include "src/api.h" 7 #include "src/api.h"
8 #include "src/ast/ast.h" 8 #include "src/ast/ast.h"
9 #include "src/ast/ast-expression-visitor.h" 9 #include "src/ast/ast-expression-visitor.h"
10 #include "src/ast/ast-literal-reindexer.h" 10 #include "src/ast/ast-literal-reindexer.h"
(...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after
368 368
369 void ParserTraits::CheckAssigningFunctionLiteralToProperty(Expression* left, 369 void ParserTraits::CheckAssigningFunctionLiteralToProperty(Expression* left,
370 Expression* right) { 370 Expression* right) {
371 DCHECK(left != NULL); 371 DCHECK(left != NULL);
372 if (left->IsProperty() && right->IsFunctionLiteral()) { 372 if (left->IsProperty() && right->IsFunctionLiteral()) {
373 right->AsFunctionLiteral()->set_pretenure(); 373 right->AsFunctionLiteral()->set_pretenure();
374 } 374 }
375 } 375 }
376 376
377 377
378 void ParserTraits::CheckPossibleEvalCall(Expression* expression,
379 Scope* scope) {
380 VariableProxy* callee = expression->AsVariableProxy();
381 if (callee != NULL &&
382 callee->raw_name() == parser_->ast_value_factory()->eval_string()) {
383 scope->DeclarationScope()->RecordEvalCall();
384 scope->RecordEvalCall();
385 }
386 }
387
388
389 Expression* ParserTraits::MarkExpressionAsAssigned(Expression* expression) { 378 Expression* ParserTraits::MarkExpressionAsAssigned(Expression* expression) {
390 VariableProxy* proxy = 379 VariableProxy* proxy =
391 expression != NULL ? expression->AsVariableProxy() : NULL; 380 expression != NULL ? expression->AsVariableProxy() : NULL;
392 if (proxy != NULL) proxy->set_is_assigned(); 381 if (proxy != NULL) proxy->set_is_assigned();
393 return expression; 382 return expression;
394 } 383 }
395 384
396 385
397 bool ParserTraits::ShortcutNumericLiteralBinaryExpression( 386 bool ParserTraits::ShortcutNumericLiteralBinaryExpression(
398 Expression** x, Expression* y, Token::Value op, int pos, 387 Expression** x, Expression* y, Token::Value op, int pos,
(...skipping 5052 matching lines...) Expand 10 before | Expand all | Expand 10 after
5451 auto class_literal = value->AsClassLiteral(); 5440 auto class_literal = value->AsClassLiteral();
5452 if (class_literal->raw_name() == nullptr) { 5441 if (class_literal->raw_name() == nullptr) {
5453 class_literal->set_raw_name(name); 5442 class_literal->set_raw_name(name);
5454 } 5443 }
5455 } 5444 }
5456 } 5445 }
5457 5446
5458 5447
5459 } // namespace internal 5448 } // namespace internal
5460 } // namespace v8 5449 } // namespace v8
OLDNEW
« no previous file with comments | « src/parsing/parser.h ('k') | src/parsing/parser-base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698