OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 #ifndef VM_AST_H_ | 5 #ifndef VM_AST_H_ |
6 #define VM_AST_H_ | 6 #define VM_AST_H_ |
7 | 7 |
8 #include "platform/assert.h" | 8 #include "platform/assert.h" |
9 #include "vm/allocation.h" | 9 #include "vm/allocation.h" |
10 #include "vm/growable_array.h" | 10 #include "vm/growable_array.h" |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 friend class ParsedFunction; | 152 friend class ParsedFunction; |
153 | 153 |
154 private: | 154 private: |
155 const intptr_t token_pos_; | 155 const intptr_t token_pos_; |
156 DISALLOW_COPY_AND_ASSIGN(AstNode); | 156 DISALLOW_COPY_AND_ASSIGN(AstNode); |
157 }; | 157 }; |
158 | 158 |
159 | 159 |
160 class AwaitNode : public AstNode { | 160 class AwaitNode : public AstNode { |
161 public: | 161 public: |
162 AwaitNode(intptr_t token_pos, AstNode* expr) | 162 AwaitNode(intptr_t token_pos, |
163 : AstNode(token_pos), expr_(expr) { } | 163 AstNode* expr, |
| 164 LocalScope* try_scope, |
| 165 int16_t try_index, |
| 166 LocalScope* outer_try_scope, |
| 167 intptr_t outer_try_index) |
| 168 : AstNode(token_pos), |
| 169 expr_(expr), |
| 170 try_scope_(try_scope), |
| 171 try_index_(try_index), |
| 172 outer_try_scope_(outer_try_scope), |
| 173 outer_try_index_(outer_try_index) { } |
164 | 174 |
165 void VisitChildren(AstNodeVisitor* visitor) const { | 175 void VisitChildren(AstNodeVisitor* visitor) const { |
166 expr_->Visit(visitor); | 176 expr_->Visit(visitor); |
167 } | 177 } |
168 | 178 |
169 AstNode* expr() const { return expr_; } | 179 AstNode* expr() const { return expr_; } |
| 180 LocalScope* try_scope() const { return try_scope_; } |
| 181 int16_t try_index() const { return try_index_; } |
| 182 LocalScope* outer_try_scope() const { return outer_try_scope_; } |
| 183 int16_t outer_try_index() const { return outer_try_index_; } |
170 | 184 |
171 DECLARE_COMMON_NODE_FUNCTIONS(AwaitNode); | 185 DECLARE_COMMON_NODE_FUNCTIONS(AwaitNode); |
172 | 186 |
173 private: | 187 private: |
174 AstNode* expr_; | 188 AstNode* expr_; |
| 189 LocalScope* try_scope_; |
| 190 int16_t try_index_; |
| 191 LocalScope* outer_try_scope_; |
| 192 int16_t outer_try_index_; |
175 | 193 |
176 DISALLOW_COPY_AND_ASSIGN(AwaitNode); | 194 DISALLOW_COPY_AND_ASSIGN(AwaitNode); |
177 }; | 195 }; |
178 | 196 |
179 | 197 |
180 // AwaitMarker nodes are used to generate markers that the FlowGraphBuilder | 198 // AwaitMarker nodes are used to generate markers that the FlowGraphBuilder |
181 // relies on. A marker indicates that a new await state needs to be | 199 // relies on. A marker indicates that a new await state needs to be |
182 // added to a function preamble. This type also triggers storing of the | 200 // added to a function preamble. This type also triggers storing of the |
183 // current context. | 201 // current context. |
184 // | 202 // |
(...skipping 1730 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1915 const intptr_t try_index_; | 1933 const intptr_t try_index_; |
1916 | 1934 |
1917 DISALLOW_IMPLICIT_CONSTRUCTORS(InlinedFinallyNode); | 1935 DISALLOW_IMPLICIT_CONSTRUCTORS(InlinedFinallyNode); |
1918 }; | 1936 }; |
1919 | 1937 |
1920 } // namespace dart | 1938 } // namespace dart |
1921 | 1939 |
1922 #undef DECLARE_COMMON_NODE_FUNCTIONS | 1940 #undef DECLARE_COMMON_NODE_FUNCTIONS |
1923 | 1941 |
1924 #endif // VM_AST_H_ | 1942 #endif // VM_AST_H_ |
OLD | NEW |