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_FLOW_GRAPH_H_ | 5 #ifndef VM_FLOW_GRAPH_H_ |
6 #define VM_FLOW_GRAPH_H_ | 6 #define VM_FLOW_GRAPH_H_ |
7 | 7 |
8 #include "vm/growable_array.h" | 8 #include "vm/growable_array.h" |
9 #include "vm/parser.h" | 9 #include "vm/parser.h" |
10 | 10 |
11 namespace dart { | 11 namespace dart { |
12 | 12 |
13 class BlockEntryInstr; | 13 class BlockEntryInstr; |
14 class ConstantInstr; | 14 class ConstantInstr; |
15 class Definition; | 15 class Definition; |
16 class FlowGraphBuilder; | 16 class FlowGraphBuilder; |
17 class GraphEntryInstr; | 17 class GraphEntryInstr; |
18 class PhiInstr; | 18 class PhiInstr; |
19 class ReturnInstr; | 19 class ReturnInstr; |
20 class ValueInliningContext; | 20 class ValueInliningContext; |
21 | 21 |
22 class BlockIterator : public ValueObject { | 22 class BlockIterator { |
23 public: | 23 public: |
24 explicit BlockIterator(const GrowableArray<BlockEntryInstr*>& block_order) | 24 explicit BlockIterator(const GrowableArray<BlockEntryInstr*>& block_order) |
25 : block_order_(block_order), current_(0) { } | 25 : block_order_(block_order), current_(0) { } |
26 | 26 |
| 27 BlockIterator(const BlockIterator& other) |
| 28 : block_order_(other.block_order_), current_(other.current_) { } |
| 29 |
| 30 #if 0 |
| 31 BlockIterator& operator=(const BlockIterator& other) { |
| 32 block_order_ = other.block_order_; |
| 33 current_ = other.current_; |
| 34 return *this; |
| 35 } |
| 36 #endif |
| 37 |
27 void Advance() { | 38 void Advance() { |
28 ASSERT(!Done()); | 39 ASSERT(!Done()); |
29 current_++; | 40 current_++; |
30 } | 41 } |
31 | 42 |
32 bool Done() const { return current_ >= block_order_.length(); } | 43 bool Done() const { return current_ >= block_order_.length(); } |
33 | 44 |
34 BlockEntryInstr* Current() const { return block_order_[current_]; } | 45 BlockEntryInstr* Current() const { return block_order_[current_]; } |
35 | 46 |
36 private: | 47 private: |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 GraphEntryInstr* graph_entry_; | 187 GraphEntryInstr* graph_entry_; |
177 GrowableArray<BlockEntryInstr*> preorder_; | 188 GrowableArray<BlockEntryInstr*> preorder_; |
178 GrowableArray<BlockEntryInstr*> postorder_; | 189 GrowableArray<BlockEntryInstr*> postorder_; |
179 GrowableArray<BlockEntryInstr*> reverse_postorder_; | 190 GrowableArray<BlockEntryInstr*> reverse_postorder_; |
180 bool invalid_dominator_tree_; | 191 bool invalid_dominator_tree_; |
181 }; | 192 }; |
182 | 193 |
183 } // namespace dart | 194 } // namespace dart |
184 | 195 |
185 #endif // VM_FLOW_GRAPH_H_ | 196 #endif // VM_FLOW_GRAPH_H_ |
OLD | NEW |