| 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 |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 } | 74 } |
| 75 | 75 |
| 76 // Iterators. | 76 // Iterators. |
| 77 BlockIterator reverse_postorder_iterator() const { | 77 BlockIterator reverse_postorder_iterator() const { |
| 78 return BlockIterator(reverse_postorder()); | 78 return BlockIterator(reverse_postorder()); |
| 79 } | 79 } |
| 80 BlockIterator postorder_iterator() const { | 80 BlockIterator postorder_iterator() const { |
| 81 return BlockIterator(postorder()); | 81 return BlockIterator(postorder()); |
| 82 } | 82 } |
| 83 | 83 |
| 84 intptr_t current_ssa_temp_index() const { return current_ssa_temp_index_; } |
| 85 |
| 84 intptr_t max_virtual_register_number() const { | 86 intptr_t max_virtual_register_number() const { |
| 85 return current_ssa_temp_index(); | 87 return current_ssa_temp_index(); |
| 86 } | 88 } |
| 87 | 89 |
| 88 GraphEntryInstr* graph_entry() const { | 90 GraphEntryInstr* graph_entry() const { |
| 89 return graph_entry_; | 91 return graph_entry_; |
| 90 } | 92 } |
| 91 | 93 |
| 92 ZoneGrowableArray<ReturnInstr*>* exits() const { return exits_; } | 94 ZoneGrowableArray<ReturnInstr*>* exits() const { return exits_; } |
| 93 void set_exits(ZoneGrowableArray<ReturnInstr*>* exits) { exits_ = exits; } | 95 void set_exits(ZoneGrowableArray<ReturnInstr*>* exits) { exits_ = exits; } |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 GrowableArray<Definition*>* env, | 136 GrowableArray<Definition*>* env, |
| 135 GrowableArray<PhiInstr*>* live_phis); | 137 GrowableArray<PhiInstr*>* live_phis); |
| 136 | 138 |
| 137 void InsertPhis( | 139 void InsertPhis( |
| 138 const GrowableArray<BlockEntryInstr*>& preorder, | 140 const GrowableArray<BlockEntryInstr*>& preorder, |
| 139 const GrowableArray<BitVector*>& assigned_vars, | 141 const GrowableArray<BitVector*>& assigned_vars, |
| 140 const GrowableArray<BitVector*>& dom_frontier); | 142 const GrowableArray<BitVector*>& dom_frontier); |
| 141 | 143 |
| 142 void MarkLivePhis(GrowableArray<PhiInstr*>* live_phis); | 144 void MarkLivePhis(GrowableArray<PhiInstr*>* live_phis); |
| 143 | 145 |
| 144 intptr_t current_ssa_temp_index() const { return current_ssa_temp_index_; } | |
| 145 | |
| 146 // DiscoverBlocks computes parent_ and assigned_vars_ which are then used | 146 // DiscoverBlocks computes parent_ and assigned_vars_ which are then used |
| 147 // if/when computing SSA. | 147 // if/when computing SSA. |
| 148 GrowableArray<intptr_t> parent_; | 148 GrowableArray<intptr_t> parent_; |
| 149 GrowableArray<BitVector*> assigned_vars_; | 149 GrowableArray<BitVector*> assigned_vars_; |
| 150 | 150 |
| 151 intptr_t current_ssa_temp_index_; | 151 intptr_t current_ssa_temp_index_; |
| 152 | 152 |
| 153 // Flow graph fields. | 153 // Flow graph fields. |
| 154 const ParsedFunction& parsed_function_; | 154 const ParsedFunction& parsed_function_; |
| 155 const intptr_t num_copied_params_; | 155 const intptr_t num_copied_params_; |
| 156 const intptr_t num_non_copied_params_; | 156 const intptr_t num_non_copied_params_; |
| 157 const intptr_t num_stack_locals_; | 157 const intptr_t num_stack_locals_; |
| 158 GraphEntryInstr* graph_entry_; | 158 GraphEntryInstr* graph_entry_; |
| 159 GrowableArray<BlockEntryInstr*> preorder_; | 159 GrowableArray<BlockEntryInstr*> preorder_; |
| 160 GrowableArray<BlockEntryInstr*> postorder_; | 160 GrowableArray<BlockEntryInstr*> postorder_; |
| 161 GrowableArray<BlockEntryInstr*> reverse_postorder_; | 161 GrowableArray<BlockEntryInstr*> reverse_postorder_; |
| 162 ZoneGrowableArray<ReturnInstr*>* exits_; | 162 ZoneGrowableArray<ReturnInstr*>* exits_; |
| 163 }; | 163 }; |
| 164 | 164 |
| 165 } // namespace dart | 165 } // namespace dart |
| 166 | 166 |
| 167 #endif // VM_FLOW_GRAPH_H_ | 167 #endif // VM_FLOW_GRAPH_H_ |
| OLD | NEW |