| 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 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 205 // relies on. A marker indicates that a new await state needs to be | 205 // relies on. A marker indicates that a new await state needs to be |
| 206 // added to a function preamble. This type also triggers storing of the | 206 // added to a function preamble. This type also triggers storing of the |
| 207 // current context. | 207 // current context. |
| 208 // | 208 // |
| 209 // It is expected (ASSERT) that an AwaitMarker is followed by | 209 // It is expected (ASSERT) that an AwaitMarker is followed by |
| 210 // a return node of kind kContinuationTarget. That is: | 210 // a return node of kind kContinuationTarget. That is: |
| 211 // <AwaitMarker> -> <other nodes> -> <kContinuationTarget> -> <other nodes> -> | 211 // <AwaitMarker> -> <other nodes> -> <kContinuationTarget> -> <other nodes> -> |
| 212 // <AwaitMarker> -> ... | 212 // <AwaitMarker> -> ... |
| 213 class AwaitMarkerNode : public AstNode { | 213 class AwaitMarkerNode : public AstNode { |
| 214 public: | 214 public: |
| 215 AwaitMarkerNode(LocalScope* async_scope, LocalScope* await_scope) | 215 AwaitMarkerNode(LocalScope* async_scope, |
| 216 : AstNode(Scanner::kNoSourcePos), | 216 LocalScope* await_scope, |
| 217 intptr_t token_pos) |
| 218 : AstNode(token_pos), |
| 217 async_scope_(async_scope), | 219 async_scope_(async_scope), |
| 218 await_scope_(await_scope) { | 220 await_scope_(await_scope) { |
| 219 ASSERT(async_scope != NULL); | 221 ASSERT(async_scope != NULL); |
| 220 ASSERT(await_scope != NULL); | 222 ASSERT(await_scope != NULL); |
| 221 await_scope->CaptureLocalVariables(async_scope); | 223 await_scope->CaptureLocalVariables(async_scope); |
| 222 } | 224 } |
| 223 | 225 |
| 224 void VisitChildren(AstNodeVisitor* visitor) const { } | 226 void VisitChildren(AstNodeVisitor* visitor) const { } |
| 225 | 227 |
| 226 LocalScope* async_scope() const { return async_scope_; } | 228 LocalScope* async_scope() const { return async_scope_; } |
| (...skipping 1797 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2024 const intptr_t try_index_; | 2026 const intptr_t try_index_; |
| 2025 | 2027 |
| 2026 DISALLOW_IMPLICIT_CONSTRUCTORS(InlinedFinallyNode); | 2028 DISALLOW_IMPLICIT_CONSTRUCTORS(InlinedFinallyNode); |
| 2027 }; | 2029 }; |
| 2028 | 2030 |
| 2029 } // namespace dart | 2031 } // namespace dart |
| 2030 | 2032 |
| 2031 #undef DECLARE_COMMON_NODE_FUNCTIONS | 2033 #undef DECLARE_COMMON_NODE_FUNCTIONS |
| 2032 | 2034 |
| 2033 #endif // VM_AST_H_ | 2035 #endif // VM_AST_H_ |
| OLD | NEW |