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/ast.h" | 8 #include "src/ast/ast.h" |
9 #include "src/ast/scopes.h" | 9 #include "src/ast/scopes.h" |
10 #include "src/bailout-reason.h" | 10 #include "src/bailout-reason.h" |
(...skipping 479 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
490 } | 490 } |
491 | 491 |
492 // Used to assign an index to each literal that needs materialization in | 492 // Used to assign an index to each literal that needs materialization in |
493 // the function. Includes regexp literals, and boilerplate for object and | 493 // the function. Includes regexp literals, and boilerplate for object and |
494 // array literals. | 494 // array literals. |
495 int next_materialized_literal_index_; | 495 int next_materialized_literal_index_; |
496 | 496 |
497 // Properties count estimation. | 497 // Properties count estimation. |
498 int expected_property_count_; | 498 int expected_property_count_; |
499 | 499 |
500 // For generators, this variable may hold the generator object. It variable | |
501 // is used by yield expressions and return statements. It is not necessary | |
502 // for generator functions to have this variable set. | |
503 Variable* generator_object_variable_; | |
504 // For async functions, this variable holds a temporary for the Promise | |
505 // being created as output of the async function. | |
506 Variable* promise_variable_; | |
507 | |
508 FunctionState** function_state_stack_; | 500 FunctionState** function_state_stack_; |
509 FunctionState* outer_function_state_; | 501 FunctionState* outer_function_state_; |
510 | 502 |
511 ZoneList<DestructuringAssignment> destructuring_assignments_to_rewrite_; | 503 ZoneList<DestructuringAssignment> destructuring_assignments_to_rewrite_; |
512 TailCallExpressionList tail_call_expressions_; | 504 TailCallExpressionList tail_call_expressions_; |
513 ReturnExprContext return_expr_context_; | 505 ReturnExprContext return_expr_context_; |
514 ZoneList<ExpressionT> non_patterns_to_rewrite_; | 506 ZoneList<ExpressionT> non_patterns_to_rewrite_; |
515 | 507 |
516 ZoneList<typename ExpressionClassifier::Error> reported_errors_; | 508 ZoneList<typename ExpressionClassifier::Error> reported_errors_; |
517 | 509 |
(...skipping 989 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1507 friend class DiscardableZoneScope; | 1499 friend class DiscardableZoneScope; |
1508 }; | 1500 }; |
1509 | 1501 |
1510 template <typename Impl> | 1502 template <typename Impl> |
1511 ParserBase<Impl>::FunctionState::FunctionState( | 1503 ParserBase<Impl>::FunctionState::FunctionState( |
1512 FunctionState** function_state_stack, ScopeState** scope_stack, | 1504 FunctionState** function_state_stack, ScopeState** scope_stack, |
1513 DeclarationScope* scope) | 1505 DeclarationScope* scope) |
1514 : ScopeState(scope_stack, scope), | 1506 : ScopeState(scope_stack, scope), |
1515 next_materialized_literal_index_(0), | 1507 next_materialized_literal_index_(0), |
1516 expected_property_count_(0), | 1508 expected_property_count_(0), |
1517 generator_object_variable_(nullptr), | |
1518 promise_variable_(nullptr), | |
1519 function_state_stack_(function_state_stack), | 1509 function_state_stack_(function_state_stack), |
1520 outer_function_state_(*function_state_stack), | 1510 outer_function_state_(*function_state_stack), |
1521 destructuring_assignments_to_rewrite_(16, scope->zone()), | 1511 destructuring_assignments_to_rewrite_(16, scope->zone()), |
1522 tail_call_expressions_(scope->zone()), | 1512 tail_call_expressions_(scope->zone()), |
1523 return_expr_context_(ReturnExprContext::kInsideValidBlock), | 1513 return_expr_context_(ReturnExprContext::kInsideValidBlock), |
1524 non_patterns_to_rewrite_(0, scope->zone()), | 1514 non_patterns_to_rewrite_(0, scope->zone()), |
1525 reported_errors_(16, scope->zone()), | 1515 reported_errors_(16, scope->zone()), |
1526 next_function_is_likely_called_(false), | 1516 next_function_is_likely_called_(false), |
1527 previous_function_was_likely_called_(false) { | 1517 previous_function_was_likely_called_(false) { |
1528 *function_state_stack = this; | 1518 *function_state_stack = this; |
(...skipping 4242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5771 } | 5761 } |
5772 | 5762 |
5773 #undef CHECK_OK | 5763 #undef CHECK_OK |
5774 #undef CHECK_OK_CUSTOM | 5764 #undef CHECK_OK_CUSTOM |
5775 #undef CHECK_OK_VOID | 5765 #undef CHECK_OK_VOID |
5776 | 5766 |
5777 } // namespace internal | 5767 } // namespace internal |
5778 } // namespace v8 | 5768 } // namespace v8 |
5779 | 5769 |
5780 #endif // V8_PARSING_PARSER_BASE_H | 5770 #endif // V8_PARSING_PARSER_BASE_H |
OLD | NEW |