| 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) | |
| 93 | 92 |
| 94 #define AST_NODE_LIST(V) \ | 93 #define AST_NODE_LIST(V) \ |
| 95 DECLARATION_NODE_LIST(V) \ | 94 DECLARATION_NODE_LIST(V) \ |
| 96 STATEMENT_NODE_LIST(V) \ | 95 STATEMENT_NODE_LIST(V) \ |
| 97 EXPRESSION_NODE_LIST(V) | 96 EXPRESSION_NODE_LIST(V) |
| 98 | 97 |
| 99 // Forward declarations | 98 // Forward declarations |
| 100 class AstNodeFactory; | 99 class AstNodeFactory; |
| 101 class AstVisitor; | 100 class AstVisitor; |
| 102 class Declaration; | 101 class Declaration; |
| (...skipping 2739 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2842 DCHECK(this_function_var->raw_name()->IsOneByteEqualTo(".this_function")); | 2841 DCHECK(this_function_var->raw_name()->IsOneByteEqualTo(".this_function")); |
| 2843 } | 2842 } |
| 2844 | 2843 |
| 2845 private: | 2844 private: |
| 2846 VariableProxy* this_var_; | 2845 VariableProxy* this_var_; |
| 2847 VariableProxy* new_target_var_; | 2846 VariableProxy* new_target_var_; |
| 2848 VariableProxy* this_function_var_; | 2847 VariableProxy* this_function_var_; |
| 2849 }; | 2848 }; |
| 2850 | 2849 |
| 2851 | 2850 |
| 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 | |
| 2863 #undef DECLARE_NODE_TYPE | 2851 #undef DECLARE_NODE_TYPE |
| 2864 | 2852 |
| 2865 | 2853 |
| 2866 // ---------------------------------------------------------------------------- | 2854 // ---------------------------------------------------------------------------- |
| 2867 // Regular expressions | 2855 // Regular expressions |
| 2868 | 2856 |
| 2869 | 2857 |
| 2870 class RegExpVisitor BASE_EMBEDDED { | 2858 class RegExpVisitor BASE_EMBEDDED { |
| 2871 public: | 2859 public: |
| 2872 virtual ~RegExpVisitor() { } | 2860 virtual ~RegExpVisitor() { } |
| (...skipping 765 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3638 } | 3626 } |
| 3639 | 3627 |
| 3640 SuperCallReference* NewSuperCallReference(VariableProxy* this_var, | 3628 SuperCallReference* NewSuperCallReference(VariableProxy* this_var, |
| 3641 VariableProxy* new_target_var, | 3629 VariableProxy* new_target_var, |
| 3642 VariableProxy* this_function_var, | 3630 VariableProxy* this_function_var, |
| 3643 int pos) { | 3631 int pos) { |
| 3644 return new (zone_) SuperCallReference(zone_, this_var, new_target_var, | 3632 return new (zone_) SuperCallReference(zone_, this_var, new_target_var, |
| 3645 this_function_var, pos); | 3633 this_function_var, pos); |
| 3646 } | 3634 } |
| 3647 | 3635 |
| 3648 EmptyParentheses* NewEmptyParentheses(int pos) { | |
| 3649 return new (zone_) EmptyParentheses(zone_, pos); | |
| 3650 } | |
| 3651 | |
| 3652 private: | 3636 private: |
| 3653 Zone* zone_; | 3637 Zone* zone_; |
| 3654 AstValueFactory* ast_value_factory_; | 3638 AstValueFactory* ast_value_factory_; |
| 3655 }; | 3639 }; |
| 3656 | 3640 |
| 3657 | 3641 |
| 3658 } } // namespace v8::internal | 3642 } } // namespace v8::internal |
| 3659 | 3643 |
| 3660 #endif // V8_AST_H_ | 3644 #endif // V8_AST_H_ |
| OLD | NEW |