OLD | NEW |
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 Loading... |
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 if (1 || FLAG_harmony_tailcalls) return_value->MarkTail(); |
2807 } | 2807 } |
2808 ExpectSemicolon(CHECK_OK); | 2808 ExpectSemicolon(CHECK_OK); |
2809 | 2809 |
2810 if (is_generator()) { | 2810 if (is_generator()) { |
2811 Expression* generator = factory()->NewVariableProxy( | 2811 Expression* generator = factory()->NewVariableProxy( |
2812 function_state_->generator_object_variable()); | 2812 function_state_->generator_object_variable()); |
2813 Expression* yield = factory()->NewYield( | 2813 Expression* yield = factory()->NewYield( |
2814 generator, return_value, Yield::kFinal, loc.beg_pos); | 2814 generator, return_value, Yield::kFinal, loc.beg_pos); |
2815 result = factory()->NewExpressionStatement(yield, loc.beg_pos); | 2815 result = factory()->NewExpressionStatement(yield, loc.beg_pos); |
2816 } else { | 2816 } else { |
(...skipping 2919 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5736 auto class_literal = value->AsClassLiteral(); | 5736 auto class_literal = value->AsClassLiteral(); |
5737 if (class_literal->raw_name() == nullptr) { | 5737 if (class_literal->raw_name() == nullptr) { |
5738 class_literal->set_raw_name(name); | 5738 class_literal->set_raw_name(name); |
5739 } | 5739 } |
5740 } | 5740 } |
5741 } | 5741 } |
5742 | 5742 |
5743 | 5743 |
5744 } // namespace internal | 5744 } // namespace internal |
5745 } // namespace v8 | 5745 } // namespace v8 |
OLD | NEW |