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

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

Issue 1530403004: [es6] Mark tail Call nodes (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years 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/ast/ast.h ('k') | no next file » | 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 2892 matching lines...) Expand 10 before | Expand all | Expand 10 after
2903 // temp === undefined 2903 // temp === undefined
2904 Expression* is_undefined = factory()->NewCompareOperation( 2904 Expression* is_undefined = factory()->NewCompareOperation(
2905 Token::EQ_STRICT, assign, 2905 Token::EQ_STRICT, assign,
2906 factory()->NewUndefinedLiteral(RelocInfo::kNoPosition), pos); 2906 factory()->NewUndefinedLiteral(RelocInfo::kNoPosition), pos);
2907 2907
2908 // is_undefined ? this : is_object_conditional 2908 // is_undefined ? this : is_object_conditional
2909 return_value = factory()->NewConditional( 2909 return_value = factory()->NewConditional(
2910 is_undefined, ThisExpression(scope_, factory(), pos), 2910 is_undefined, ThisExpression(scope_, factory(), pos),
2911 is_object_conditional, pos); 2911 is_object_conditional, pos);
2912 } 2912 }
2913
2914 return_value->MarkTail();
2913 } 2915 }
2914 ExpectSemicolon(CHECK_OK); 2916 ExpectSemicolon(CHECK_OK);
2915 2917
2916 if (is_generator()) { 2918 if (is_generator()) {
2917 Expression* generator = factory()->NewVariableProxy( 2919 Expression* generator = factory()->NewVariableProxy(
2918 function_state_->generator_object_variable()); 2920 function_state_->generator_object_variable());
2919 Expression* yield = factory()->NewYield( 2921 Expression* yield = factory()->NewYield(
2920 generator, return_value, Yield::kFinal, loc.beg_pos); 2922 generator, return_value, Yield::kFinal, loc.beg_pos);
2921 result = factory()->NewExpressionStatement(yield, loc.beg_pos); 2923 result = factory()->NewExpressionStatement(yield, loc.beg_pos);
2922 } else { 2924 } else {
(...skipping 3668 matching lines...) Expand 10 before | Expand all | Expand 10 after
6591 6593
6592 void ParserTraits::QueueDestructuringAssignmentForRewriting(Expression* expr) { 6594 void ParserTraits::QueueDestructuringAssignmentForRewriting(Expression* expr) {
6593 DCHECK(expr->IsRewritableAssignmentExpression()); 6595 DCHECK(expr->IsRewritableAssignmentExpression());
6594 parser_->function_state_->AddDestructuringAssignment( 6596 parser_->function_state_->AddDestructuringAssignment(
6595 Parser::DestructuringAssignment(expr, parser_->scope_)); 6597 Parser::DestructuringAssignment(expr, parser_->scope_));
6596 } 6598 }
6597 6599
6598 6600
6599 } // namespace internal 6601 } // namespace internal
6600 } // namespace v8 6602 } // namespace v8
OLDNEW
« no previous file with comments | « src/ast/ast.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698