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

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

Issue 1609893003: [es6] Tail calls support. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebasing Created 4 years, 10 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/mips64/code-stubs-mips64.cc ('k') | src/x64/builtins-x64.cc » ('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-rewriter.h" 9 #include "src/ast/ast-expression-rewriter.h"
10 #include "src/ast/ast-expression-visitor.h" 10 #include "src/ast/ast-expression-visitor.h"
(...skipping 2789 matching lines...) Expand 10 before | Expand all | Expand 10 after
2800 Expression* is_undefined = factory()->NewCompareOperation( 2800 Expression* is_undefined = factory()->NewCompareOperation(
2801 Token::EQ_STRICT, assign, 2801 Token::EQ_STRICT, assign,
2802 factory()->NewUndefinedLiteral(RelocInfo::kNoPosition), pos); 2802 factory()->NewUndefinedLiteral(RelocInfo::kNoPosition), pos);
2803 2803
2804 // is_undefined ? this : is_object_conditional 2804 // is_undefined ? this : is_object_conditional
2805 return_value = factory()->NewConditional( 2805 return_value = factory()->NewConditional(
2806 is_undefined, ThisExpression(scope_, factory(), pos), 2806 is_undefined, ThisExpression(scope_, factory(), pos),
2807 is_object_conditional, pos); 2807 is_object_conditional, pos);
2808 } 2808 }
2809 2809
2810 return_value->MarkTail(); 2810 // ES6 14.6.1 Static Semantics: IsInTailPosition
2811 if (FLAG_harmony_tailcalls && !is_sloppy(language_mode())) {
2812 return_value->MarkTail();
2813 }
2811 } 2814 }
2812 ExpectSemicolon(CHECK_OK); 2815 ExpectSemicolon(CHECK_OK);
2813 2816
2814 if (is_generator()) { 2817 if (is_generator()) {
2815 Expression* generator = factory()->NewVariableProxy( 2818 Expression* generator = factory()->NewVariableProxy(
2816 function_state_->generator_object_variable()); 2819 function_state_->generator_object_variable());
2817 Expression* yield = factory()->NewYield( 2820 Expression* yield = factory()->NewYield(
2818 generator, return_value, Yield::kFinal, loc.beg_pos); 2821 generator, return_value, Yield::kFinal, loc.beg_pos);
2819 result = factory()->NewExpressionStatement(yield, loc.beg_pos); 2822 result = factory()->NewExpressionStatement(yield, loc.beg_pos);
2820 } else { 2823 } else {
(...skipping 2912 matching lines...) Expand 10 before | Expand all | Expand 10 after
5733 auto class_literal = value->AsClassLiteral(); 5736 auto class_literal = value->AsClassLiteral();
5734 if (class_literal->raw_name() == nullptr) { 5737 if (class_literal->raw_name() == nullptr) {
5735 class_literal->set_raw_name(name); 5738 class_literal->set_raw_name(name);
5736 } 5739 }
5737 } 5740 }
5738 } 5741 }
5739 5742
5740 5743
5741 } // namespace internal 5744 } // namespace internal
5742 } // namespace v8 5745 } // namespace v8
OLDNEW
« no previous file with comments | « src/mips64/code-stubs-mips64.cc ('k') | src/x64/builtins-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698