| 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 409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 420 void SkipMaterializedLiterals(int count) { | 420 void SkipMaterializedLiterals(int count) { |
| 421 next_materialized_literal_index_ += count; | 421 next_materialized_literal_index_ += count; |
| 422 } | 422 } |
| 423 | 423 |
| 424 void AddProperty() { expected_property_count_++; } | 424 void AddProperty() { expected_property_count_++; } |
| 425 int expected_property_count() { return expected_property_count_; } | 425 int expected_property_count() { return expected_property_count_; } |
| 426 | 426 |
| 427 FunctionKind kind() const { return scope()->function_kind(); } | 427 FunctionKind kind() const { return scope()->function_kind(); } |
| 428 FunctionState* outer() const { return outer_function_state_; } | 428 FunctionState* outer() const { return outer_function_state_; } |
| 429 | 429 |
| 430 void set_generator_object_variable(typename Types::Variable* variable) { | |
| 431 DCHECK_NOT_NULL(variable); | |
| 432 DCHECK(IsResumableFunction(kind())); | |
| 433 DCHECK(scope()->has_forced_context_allocation()); | |
| 434 generator_object_variable_ = variable; | |
| 435 } | |
| 436 typename Types::Variable* generator_object_variable() const { | 430 typename Types::Variable* generator_object_variable() const { |
| 437 return generator_object_variable_; | 431 return scope()->generator_object_var(); |
| 438 } | 432 } |
| 439 | 433 |
| 440 void set_promise_variable(typename Types::Variable* variable) { | |
| 441 DCHECK(variable != NULL); | |
| 442 DCHECK(IsAsyncFunction(kind())); | |
| 443 promise_variable_ = variable; | |
| 444 } | |
| 445 typename Types::Variable* promise_variable() const { | 434 typename Types::Variable* promise_variable() const { |
| 446 return promise_variable_; | 435 return scope()->promise_var(); |
| 447 } | 436 } |
| 448 | 437 |
| 449 const ZoneList<DestructuringAssignment>& | 438 const ZoneList<DestructuringAssignment>& |
| 450 destructuring_assignments_to_rewrite() const { | 439 destructuring_assignments_to_rewrite() const { |
| 451 return destructuring_assignments_to_rewrite_; | 440 return destructuring_assignments_to_rewrite_; |
| 452 } | 441 } |
| 453 | 442 |
| 454 TailCallExpressionList& tail_call_expressions() { | 443 TailCallExpressionList& tail_call_expressions() { |
| 455 return tail_call_expressions_; | 444 return tail_call_expressions_; |
| 456 } | 445 } |
| (...skipping 5317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5774 } | 5763 } |
| 5775 | 5764 |
| 5776 #undef CHECK_OK | 5765 #undef CHECK_OK |
| 5777 #undef CHECK_OK_CUSTOM | 5766 #undef CHECK_OK_CUSTOM |
| 5778 #undef CHECK_OK_VOID | 5767 #undef CHECK_OK_VOID |
| 5779 | 5768 |
| 5780 } // namespace internal | 5769 } // namespace internal |
| 5781 } // namespace v8 | 5770 } // namespace v8 |
| 5782 | 5771 |
| 5783 #endif // V8_PARSING_PARSER_BASE_H | 5772 #endif // V8_PARSING_PARSER_BASE_H |
| OLD | NEW |