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 #ifndef V8_PARSING_PARSER_BASE_H | 5 #ifndef V8_PARSING_PARSER_BASE_H |
6 #define V8_PARSING_PARSER_BASE_H | 6 #define V8_PARSING_PARSER_BASE_H |
7 | 7 |
8 #include "src/ast/scopes.h" | 8 #include "src/ast/scopes.h" |
9 #include "src/bailout-reason.h" | 9 #include "src/bailout-reason.h" |
10 #include "src/hashmap.h" | 10 #include "src/hashmap.h" |
(...skipping 2854 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2865 parenthesized_function_ = false; | 2865 parenthesized_function_ = false; |
2866 ExpressionClassifier classifier(this); | 2866 ExpressionClassifier classifier(this); |
2867 ExpressionT expression = | 2867 ExpressionT expression = |
2868 ParseAssignmentExpression(accept_IN, &classifier, CHECK_OK); | 2868 ParseAssignmentExpression(accept_IN, &classifier, CHECK_OK); |
2869 Traits::RewriteNonPattern(&classifier, CHECK_OK); | 2869 Traits::RewriteNonPattern(&classifier, CHECK_OK); |
2870 body = this->NewStatementList(1, zone()); | 2870 body = this->NewStatementList(1, zone()); |
2871 this->AddParameterInitializationBlock(formal_parameters, body, CHECK_OK); | 2871 this->AddParameterInitializationBlock(formal_parameters, body, CHECK_OK); |
2872 body->Add(factory()->NewReturnStatement(expression, pos), zone()); | 2872 body->Add(factory()->NewReturnStatement(expression, pos), zone()); |
2873 materialized_literal_count = function_state.materialized_literal_count(); | 2873 materialized_literal_count = function_state.materialized_literal_count(); |
2874 expected_property_count = function_state.expected_property_count(); | 2874 expected_property_count = function_state.expected_property_count(); |
| 2875 // ES6 14.6.1 Static Semantics: IsInTailPosition |
| 2876 if (allow_tailcalls() && !is_sloppy(language_mode())) { |
| 2877 this->MarkTailPosition(expression); |
| 2878 } |
2875 } | 2879 } |
2876 super_loc = function_state.super_location(); | 2880 super_loc = function_state.super_location(); |
2877 | 2881 |
2878 formal_parameters.scope->set_end_position(scanner()->location().end_pos); | 2882 formal_parameters.scope->set_end_position(scanner()->location().end_pos); |
2879 | 2883 |
2880 // Arrow function formal parameters are parsed as StrictFormalParameterList, | 2884 // Arrow function formal parameters are parsed as StrictFormalParameterList, |
2881 // which is not the same as "parameters of a strict function"; it only means | 2885 // which is not the same as "parameters of a strict function"; it only means |
2882 // that duplicates are not allowed. Of course, the arrow function may | 2886 // that duplicates are not allowed. Of course, the arrow function may |
2883 // itself be strict as well. | 2887 // itself be strict as well. |
2884 const bool allow_duplicate_parameters = false; | 2888 const bool allow_duplicate_parameters = false; |
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3123 has_seen_constructor_ = true; | 3127 has_seen_constructor_ = true; |
3124 return; | 3128 return; |
3125 } | 3129 } |
3126 } | 3130 } |
3127 | 3131 |
3128 | 3132 |
3129 } // namespace internal | 3133 } // namespace internal |
3130 } // namespace v8 | 3134 } // namespace v8 |
3131 | 3135 |
3132 #endif // V8_PARSING_PARSER_BASE_H | 3136 #endif // V8_PARSING_PARSER_BASE_H |
OLD | NEW |