OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 924 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
935 | 935 |
936 private: | 936 private: |
937 Expression* expression_; | 937 Expression* expression_; |
938 }; | 938 }; |
939 | 939 |
940 | 940 |
941 class WithStatement: public Statement { | 941 class WithStatement: public Statement { |
942 public: | 942 public: |
943 DECLARE_NODE_TYPE(WithStatement) | 943 DECLARE_NODE_TYPE(WithStatement) |
944 | 944 |
| 945 Scope* scope() { return scope_; } |
945 Expression* expression() const { return expression_; } | 946 Expression* expression() const { return expression_; } |
946 Statement* statement() const { return statement_; } | 947 Statement* statement() const { return statement_; } |
947 | 948 |
948 protected: | 949 protected: |
949 WithStatement(Expression* expression, Statement* statement) | 950 WithStatement(Scope* scope, Expression* expression, Statement* statement) |
950 : expression_(expression), | 951 : scope_(scope), |
| 952 expression_(expression), |
951 statement_(statement) { } | 953 statement_(statement) { } |
952 | 954 |
953 private: | 955 private: |
| 956 Scope* scope_; |
954 Expression* expression_; | 957 Expression* expression_; |
955 Statement* statement_; | 958 Statement* statement_; |
956 }; | 959 }; |
957 | 960 |
958 | 961 |
959 class CaseClause: public ZoneObject { | 962 class CaseClause: public ZoneObject { |
960 public: | 963 public: |
961 CaseClause(Isolate* isolate, | 964 CaseClause(Isolate* isolate, |
962 Expression* label, | 965 Expression* label, |
963 ZoneList<Statement*>* statements, | 966 ZoneList<Statement*>* statements, |
(...skipping 1816 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2780 BreakStatement* NewBreakStatement(BreakableStatement* target) { | 2783 BreakStatement* NewBreakStatement(BreakableStatement* target) { |
2781 BreakStatement* stmt = new(zone_) BreakStatement(target); | 2784 BreakStatement* stmt = new(zone_) BreakStatement(target); |
2782 VISIT_AND_RETURN(BreakStatement, stmt) | 2785 VISIT_AND_RETURN(BreakStatement, stmt) |
2783 } | 2786 } |
2784 | 2787 |
2785 ReturnStatement* NewReturnStatement(Expression* expression) { | 2788 ReturnStatement* NewReturnStatement(Expression* expression) { |
2786 ReturnStatement* stmt = new(zone_) ReturnStatement(expression); | 2789 ReturnStatement* stmt = new(zone_) ReturnStatement(expression); |
2787 VISIT_AND_RETURN(ReturnStatement, stmt) | 2790 VISIT_AND_RETURN(ReturnStatement, stmt) |
2788 } | 2791 } |
2789 | 2792 |
2790 WithStatement* NewWithStatement(Expression* expression, | 2793 WithStatement* NewWithStatement(Scope* scope, |
| 2794 Expression* expression, |
2791 Statement* statement) { | 2795 Statement* statement) { |
2792 WithStatement* stmt = new(zone_) WithStatement(expression, statement); | 2796 WithStatement* stmt = new(zone_) WithStatement( |
| 2797 scope, expression, statement); |
2793 VISIT_AND_RETURN(WithStatement, stmt) | 2798 VISIT_AND_RETURN(WithStatement, stmt) |
2794 } | 2799 } |
2795 | 2800 |
2796 IfStatement* NewIfStatement(Expression* condition, | 2801 IfStatement* NewIfStatement(Expression* condition, |
2797 Statement* then_statement, | 2802 Statement* then_statement, |
2798 Statement* else_statement) { | 2803 Statement* else_statement) { |
2799 IfStatement* stmt = new(zone_) IfStatement( | 2804 IfStatement* stmt = new(zone_) IfStatement( |
2800 isolate_, condition, then_statement, else_statement); | 2805 isolate_, condition, then_statement, else_statement); |
2801 VISIT_AND_RETURN(IfStatement, stmt) | 2806 VISIT_AND_RETURN(IfStatement, stmt) |
2802 } | 2807 } |
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3033 private: | 3038 private: |
3034 Isolate* isolate_; | 3039 Isolate* isolate_; |
3035 Zone* zone_; | 3040 Zone* zone_; |
3036 Visitor visitor_; | 3041 Visitor visitor_; |
3037 }; | 3042 }; |
3038 | 3043 |
3039 | 3044 |
3040 } } // namespace v8::internal | 3045 } } // namespace v8::internal |
3041 | 3046 |
3042 #endif // V8_AST_H_ | 3047 #endif // V8_AST_H_ |
OLD | NEW |