| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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/hash_map.h" | 9 #include "vm/hash_map.h" |
| 10 #include "vm/intermediate_language.h" | 10 #include "vm/intermediate_language.h" |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 bool Done() const { return current_ >= block_order_.length(); } | 35 bool Done() const { return current_ >= block_order_.length(); } |
| 36 | 36 |
| 37 BlockEntryInstr* Current() const { return block_order_[current_]; } | 37 BlockEntryInstr* Current() const { return block_order_[current_]; } |
| 38 | 38 |
| 39 private: | 39 private: |
| 40 const GrowableArray<BlockEntryInstr*>& block_order_; | 40 const GrowableArray<BlockEntryInstr*>& block_order_; |
| 41 intptr_t current_; | 41 intptr_t current_; |
| 42 }; | 42 }; |
| 43 | 43 |
| 44 | 44 |
| 45 struct BlockEntryEdge { |
| 46 BlockEntryEdge(BlockEntryInstr* parent, BlockEntryInstr* child) |
| 47 : parent(parent), |
| 48 child(child) { } |
| 49 BlockEntryInstr* parent; |
| 50 BlockEntryInstr* child; |
| 51 |
| 52 DISALLOW_ALLOCATION(); |
| 53 }; |
| 54 |
| 55 |
| 45 struct ConstantPoolTrait { | 56 struct ConstantPoolTrait { |
| 46 typedef ConstantInstr* Value; | 57 typedef ConstantInstr* Value; |
| 47 typedef const Object& Key; | 58 typedef const Object& Key; |
| 48 typedef ConstantInstr* Pair; | 59 typedef ConstantInstr* Pair; |
| 49 | 60 |
| 50 static Key KeyOf(Pair kv) { | 61 static Key KeyOf(Pair kv) { |
| 51 return kv->value(); | 62 return kv->value(); |
| 52 } | 63 } |
| 53 | 64 |
| 54 static Value ValueOf(Pair kv) { | 65 static Value ValueOf(Pair kv) { |
| (...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 439 // Per block sets of available blocks. Block A is available at the block B if | 450 // Per block sets of available blocks. Block A is available at the block B if |
| 440 // and only if A dominates B and all paths from A to B are free of side | 451 // and only if A dominates B and all paths from A to B are free of side |
| 441 // effects. | 452 // effects. |
| 442 GrowableArray<BitVector*> available_at_; | 453 GrowableArray<BitVector*> available_at_; |
| 443 }; | 454 }; |
| 444 | 455 |
| 445 | 456 |
| 446 } // namespace dart | 457 } // namespace dart |
| 447 | 458 |
| 448 #endif // VM_FLOW_GRAPH_H_ | 459 #endif // VM_FLOW_GRAPH_H_ |
| OLD | NEW |