OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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_TRANSFORMER_H_ | 5 #ifndef VM_AST_TRANSFORMER_H_ |
6 #define VM_AST_TRANSFORMER_H_ | 6 #define VM_AST_TRANSFORMER_H_ |
7 | 7 |
8 #include "platform/assert.h" | 8 #include "platform/assert.h" |
9 #include "vm/ast.h" | 9 #include "vm/ast.h" |
10 | 10 |
(...skipping 28 matching lines...) Expand all Loading... |
39 // | 39 // |
40 class AwaitTransformer : public AstNodeVisitor { | 40 class AwaitTransformer : public AstNodeVisitor { |
41 public: | 41 public: |
42 AwaitTransformer(SequenceNode* preamble, | 42 AwaitTransformer(SequenceNode* preamble, |
43 const Library& library, | 43 const Library& library, |
44 ParsedFunction* const parsed_function) | 44 ParsedFunction* const parsed_function) |
45 : preamble_(preamble), | 45 : preamble_(preamble), |
46 temp_cnt_(0), | 46 temp_cnt_(0), |
47 library_(library), | 47 library_(library), |
48 parsed_function_(parsed_function), | 48 parsed_function_(parsed_function), |
49 isolate_(Isolate::Current()) {} | 49 isolate_(Isolate::Current()) { |
| 50 // We later on save the continuation context and modify the jump counter |
| 51 // from within the preamble context (in the FlowGraphBuilder). Look up the |
| 52 // needed variables to get their corresponding aliases. |
| 53 preamble->scope()->LookupVariable(Symbols::AwaitContextVar(), false); |
| 54 preamble->scope()->LookupVariable(Symbols::AwaitJumpVar(), false); |
| 55 } |
50 | 56 |
51 #define DECLARE_VISIT(BaseName) \ | 57 #define DECLARE_VISIT(BaseName) \ |
52 virtual void Visit##BaseName##Node(BaseName##Node* node); | 58 virtual void Visit##BaseName##Node(BaseName##Node* node); |
53 | 59 |
54 FOR_EACH_NODE(DECLARE_VISIT) | 60 FOR_EACH_NODE(DECLARE_VISIT) |
55 #undef DECLARE_VISIT | 61 #undef DECLARE_VISIT |
56 | 62 |
57 AstNode* Transform(AstNode* expr); | 63 AstNode* Transform(AstNode* expr); |
58 | 64 |
59 private: | 65 private: |
(...skipping 15 matching lines...) Expand all Loading... |
75 ParsedFunction* const parsed_function_; | 81 ParsedFunction* const parsed_function_; |
76 | 82 |
77 Isolate* isolate_; | 83 Isolate* isolate_; |
78 | 84 |
79 DISALLOW_COPY_AND_ASSIGN(AwaitTransformer); | 85 DISALLOW_COPY_AND_ASSIGN(AwaitTransformer); |
80 }; | 86 }; |
81 | 87 |
82 } // namespace dart | 88 } // namespace dart |
83 | 89 |
84 #endif // VM_AST_TRANSFORMER_H_ | 90 #endif // VM_AST_TRANSFORMER_H_ |
OLD | NEW |