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

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: Support for CS and TF compilers added 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
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 2785 matching lines...) Expand 10 before | Expand all | Expand 10 after
2796 Expression* is_undefined = factory()->NewCompareOperation( 2796 Expression* is_undefined = factory()->NewCompareOperation(
2797 Token::EQ_STRICT, assign, 2797 Token::EQ_STRICT, assign,
2798 factory()->NewUndefinedLiteral(RelocInfo::kNoPosition), pos); 2798 factory()->NewUndefinedLiteral(RelocInfo::kNoPosition), pos);
2799 2799
2800 // is_undefined ? this : is_object_conditional 2800 // is_undefined ? this : is_object_conditional
2801 return_value = factory()->NewConditional( 2801 return_value = factory()->NewConditional(
2802 is_undefined, ThisExpression(scope_, factory(), pos), 2802 is_undefined, ThisExpression(scope_, factory(), pos),
2803 is_object_conditional, pos); 2803 is_object_conditional, pos);
2804 } 2804 }
2805 2805
2806 return_value->MarkTail(); 2806 // ES6 14.6.1 Static Semantics: IsInTailPosition
2807 if (FLAG_harmony_tailcalls && !is_sloppy(language_mode())) {
2808 return_value->MarkTail();
2809 }
2807 } 2810 }
2808 ExpectSemicolon(CHECK_OK); 2811 ExpectSemicolon(CHECK_OK);
2809 2812
2810 if (is_generator()) { 2813 if (is_generator()) {
2811 Expression* generator = factory()->NewVariableProxy( 2814 Expression* generator = factory()->NewVariableProxy(
2812 function_state_->generator_object_variable()); 2815 function_state_->generator_object_variable());
2813 Expression* yield = factory()->NewYield( 2816 Expression* yield = factory()->NewYield(
2814 generator, return_value, Yield::kFinal, loc.beg_pos); 2817 generator, return_value, Yield::kFinal, loc.beg_pos);
2815 result = factory()->NewExpressionStatement(yield, loc.beg_pos); 2818 result = factory()->NewExpressionStatement(yield, loc.beg_pos);
2816 } else { 2819 } else {
(...skipping 2919 matching lines...) Expand 10 before | Expand all | Expand 10 after
5736 auto class_literal = value->AsClassLiteral(); 5739 auto class_literal = value->AsClassLiteral();
5737 if (class_literal->raw_name() == nullptr) { 5740 if (class_literal->raw_name() == nullptr) {
5738 class_literal->set_raw_name(name); 5741 class_literal->set_raw_name(name);
5739 } 5742 }
5740 } 5743 }
5741 } 5744 }
5742 5745
5743 5746
5744 } // namespace internal 5747 } // namespace internal
5745 } // namespace v8 5748 } // namespace v8
OLDNEW
« no previous file with comments | « src/ic/ic-state.h ('k') | src/x64/builtins-x64.cc » ('j') | src/x64/builtins-x64.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698