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

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

Issue 2372513003: [es8] Remove syntactic tail calls support. (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 unified diff | Download patch
« no previous file with comments | « src/messages.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 <memory> 7 #include <memory>
8 8
9 #include "src/api.h" 9 #include "src/api.h"
10 #include "src/ast/ast-expression-rewriter.h" 10 #include "src/ast/ast-expression-rewriter.h"
(...skipping 3609 matching lines...) Expand 10 before | Expand all | Expand 10 after
3620 factory()->NewVariableDeclaration(proxy, block_state.scope(), pos); 3620 factory()->NewVariableDeclaration(proxy, block_state.scope(), pos);
3621 Declare(declaration, DeclarationDescriptor::NORMAL, CONST, 3621 Declare(declaration, DeclarationDescriptor::NORMAL, CONST,
3622 Variable::DefaultInitializationFlag(CONST), CHECK_OK); 3622 Variable::DefaultInitializationFlag(CONST), CHECK_OK);
3623 } 3623 }
3624 3624
3625 Expression* extends = nullptr; 3625 Expression* extends = nullptr;
3626 if (Check(Token::EXTENDS)) { 3626 if (Check(Token::EXTENDS)) {
3627 block_state.set_start_position(scanner()->location().end_pos); 3627 block_state.set_start_position(scanner()->location().end_pos);
3628 ExpressionClassifier extends_classifier(this); 3628 ExpressionClassifier extends_classifier(this);
3629 extends = ParseLeftHandSideExpression(CHECK_OK); 3629 extends = ParseLeftHandSideExpression(CHECK_OK);
3630 CheckNoTailCallExpressions(CHECK_OK);
3631 RewriteNonPattern(CHECK_OK); 3630 RewriteNonPattern(CHECK_OK);
3632 impl()->AccumulateFormalParameterContainmentErrors(); 3631 impl()->AccumulateFormalParameterContainmentErrors();
3633 } else { 3632 } else {
3634 block_state.set_start_position(scanner()->location().end_pos); 3633 block_state.set_start_position(scanner()->location().end_pos);
3635 } 3634 }
3636 3635
3637 3636
3638 ClassLiteralChecker checker(this); 3637 ClassLiteralChecker checker(this);
3639 ZoneList<ClassLiteral::Property*>* properties = NewClassPropertyList(4); 3638 ZoneList<ClassLiteral::Property*>* properties = NewClassPropertyList(4);
3640 ZoneList<Expression*>* instance_field_initializers = 3639 ZoneList<Expression*>* instance_field_initializers =
(...skipping 650 matching lines...) Expand 10 before | Expand all | Expand 10 after
4291 // incremented after parsing is done. 4290 // incremented after parsing is done.
4292 ++use_counts_[v8::Isolate::kUseAsm]; 4291 ++use_counts_[v8::Isolate::kUseAsm];
4293 DCHECK(scope()->is_declaration_scope()); 4292 DCHECK(scope()->is_declaration_scope());
4294 scope()->AsDeclarationScope()->set_asm_module(); 4293 scope()->AsDeclarationScope()->set_asm_module();
4295 } 4294 }
4296 4295
4297 void Parser::MarkCollectedTailCallExpressions() { 4296 void Parser::MarkCollectedTailCallExpressions() {
4298 const ZoneList<Expression*>& tail_call_expressions = 4297 const ZoneList<Expression*>& tail_call_expressions =
4299 function_state_->tail_call_expressions().expressions(); 4298 function_state_->tail_call_expressions().expressions();
4300 for (int i = 0; i < tail_call_expressions.length(); ++i) { 4299 for (int i = 0; i < tail_call_expressions.length(); ++i) {
4301 Expression* expression = tail_call_expressions[i]; 4300 MarkTailPosition(tail_call_expressions[i]);
4302 // If only FLAG_harmony_explicit_tailcalls is enabled then expression
4303 // must be a Call expression.
4304 DCHECK(FLAG_harmony_tailcalls || !FLAG_harmony_explicit_tailcalls ||
4305 expression->IsCall());
4306 MarkTailPosition(expression);
4307 } 4301 }
4308 } 4302 }
4309 4303
4310 Expression* Parser::ExpressionListToExpression(ZoneList<Expression*>* args) { 4304 Expression* Parser::ExpressionListToExpression(ZoneList<Expression*>* args) {
4311 Expression* expr = args->at(0); 4305 Expression* expr = args->at(0);
4312 for (int i = 1; i < args->length(); ++i) { 4306 for (int i = 1; i < args->length(); ++i) {
4313 expr = factory()->NewBinaryOperation(Token::COMMA, expr, args->at(i), 4307 expr = factory()->NewBinaryOperation(Token::COMMA, expr, args->at(i),
4314 expr->position()); 4308 expr->position());
4315 } 4309 }
4316 return expr; 4310 return expr;
(...skipping 1259 matching lines...) Expand 10 before | Expand all | Expand 10 after
5576 5570
5577 return final_loop; 5571 return final_loop;
5578 } 5572 }
5579 5573
5580 #undef CHECK_OK 5574 #undef CHECK_OK
5581 #undef CHECK_OK_VOID 5575 #undef CHECK_OK_VOID
5582 #undef CHECK_FAILED 5576 #undef CHECK_FAILED
5583 5577
5584 } // namespace internal 5578 } // namespace internal
5585 } // namespace v8 5579 } // namespace v8
OLDNEW
« no previous file with comments | « src/messages.h ('k') | src/parsing/parser-base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698