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_AST_H_ | 5 #ifndef V8_AST_H_ |
6 #define V8_AST_H_ | 6 #define V8_AST_H_ |
7 | 7 |
8 #include "src/assembler.h" | 8 #include "src/assembler.h" |
9 #include "src/ast-value-factory.h" | 9 #include "src/ast-value-factory.h" |
10 #include "src/bailout-reason.h" | 10 #include "src/bailout-reason.h" |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 V(CallNew) \ | 81 V(CallNew) \ |
82 V(CallRuntime) \ | 82 V(CallRuntime) \ |
83 V(UnaryOperation) \ | 83 V(UnaryOperation) \ |
84 V(CountOperation) \ | 84 V(CountOperation) \ |
85 V(BinaryOperation) \ | 85 V(BinaryOperation) \ |
86 V(CompareOperation) \ | 86 V(CompareOperation) \ |
87 V(Spread) \ | 87 V(Spread) \ |
88 V(ThisFunction) \ | 88 V(ThisFunction) \ |
89 V(SuperPropertyReference) \ | 89 V(SuperPropertyReference) \ |
90 V(SuperCallReference) \ | 90 V(SuperCallReference) \ |
91 V(CaseClause) | 91 V(CaseClause) \ |
| 92 V(EmptyParentheses) |
92 | 93 |
93 #define AST_NODE_LIST(V) \ | 94 #define AST_NODE_LIST(V) \ |
94 DECLARATION_NODE_LIST(V) \ | 95 DECLARATION_NODE_LIST(V) \ |
95 STATEMENT_NODE_LIST(V) \ | 96 STATEMENT_NODE_LIST(V) \ |
96 EXPRESSION_NODE_LIST(V) | 97 EXPRESSION_NODE_LIST(V) |
97 | 98 |
98 // Forward declarations | 99 // Forward declarations |
99 class AstNodeFactory; | 100 class AstNodeFactory; |
100 class AstVisitor; | 101 class AstVisitor; |
101 class Declaration; | 102 class Declaration; |
(...skipping 2739 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2841 DCHECK(this_function_var->raw_name()->IsOneByteEqualTo(".this_function")); | 2842 DCHECK(this_function_var->raw_name()->IsOneByteEqualTo(".this_function")); |
2842 } | 2843 } |
2843 | 2844 |
2844 private: | 2845 private: |
2845 VariableProxy* this_var_; | 2846 VariableProxy* this_var_; |
2846 VariableProxy* new_target_var_; | 2847 VariableProxy* new_target_var_; |
2847 VariableProxy* this_function_var_; | 2848 VariableProxy* this_function_var_; |
2848 }; | 2849 }; |
2849 | 2850 |
2850 | 2851 |
| 2852 // This class is produced when parsing the () in arrow functions without any |
| 2853 // arguments and is not actually a valid expression. |
| 2854 class EmptyParentheses final : public Expression { |
| 2855 public: |
| 2856 DECLARE_NODE_TYPE(EmptyParentheses) |
| 2857 |
| 2858 private: |
| 2859 EmptyParentheses(Zone* zone, int pos) : Expression(zone, pos) {} |
| 2860 }; |
| 2861 |
| 2862 |
2851 #undef DECLARE_NODE_TYPE | 2863 #undef DECLARE_NODE_TYPE |
2852 | 2864 |
2853 | 2865 |
2854 // ---------------------------------------------------------------------------- | 2866 // ---------------------------------------------------------------------------- |
2855 // Regular expressions | 2867 // Regular expressions |
2856 | 2868 |
2857 | 2869 |
2858 class RegExpVisitor BASE_EMBEDDED { | 2870 class RegExpVisitor BASE_EMBEDDED { |
2859 public: | 2871 public: |
2860 virtual ~RegExpVisitor() { } | 2872 virtual ~RegExpVisitor() { } |
(...skipping 765 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3626 } | 3638 } |
3627 | 3639 |
3628 SuperCallReference* NewSuperCallReference(VariableProxy* this_var, | 3640 SuperCallReference* NewSuperCallReference(VariableProxy* this_var, |
3629 VariableProxy* new_target_var, | 3641 VariableProxy* new_target_var, |
3630 VariableProxy* this_function_var, | 3642 VariableProxy* this_function_var, |
3631 int pos) { | 3643 int pos) { |
3632 return new (zone_) SuperCallReference(zone_, this_var, new_target_var, | 3644 return new (zone_) SuperCallReference(zone_, this_var, new_target_var, |
3633 this_function_var, pos); | 3645 this_function_var, pos); |
3634 } | 3646 } |
3635 | 3647 |
| 3648 EmptyParentheses* NewEmptyParentheses(int pos) { |
| 3649 return new (zone_) EmptyParentheses(zone_, pos); |
| 3650 } |
| 3651 |
3636 private: | 3652 private: |
3637 Zone* zone_; | 3653 Zone* zone_; |
3638 AstValueFactory* ast_value_factory_; | 3654 AstValueFactory* ast_value_factory_; |
3639 }; | 3655 }; |
3640 | 3656 |
3641 | 3657 |
3642 } } // namespace v8::internal | 3658 } } // namespace v8::internal |
3643 | 3659 |
3644 #endif // V8_AST_H_ | 3660 #endif // V8_AST_H_ |
OLD | NEW |