| 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/intermediate_language.h" | 9 #include "vm/intermediate_language.h" |
| 10 #include "vm/parser.h" | 10 #include "vm/parser.h" |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 Definition::UseKind use_kind); | 122 Definition::UseKind use_kind); |
| 123 | 123 |
| 124 // Operations on the flow graph. | 124 // Operations on the flow graph. |
| 125 void ComputeSSA(intptr_t next_virtual_register_number, | 125 void ComputeSSA(intptr_t next_virtual_register_number, |
| 126 GrowableArray<Definition*>* inlining_parameters); | 126 GrowableArray<Definition*>* inlining_parameters); |
| 127 | 127 |
| 128 // Finds natural loops in the flow graph and attaches a list of loop | 128 // Finds natural loops in the flow graph and attaches a list of loop |
| 129 // body blocks for each loop header. | 129 // body blocks for each loop header. |
| 130 void ComputeLoops(GrowableArray<BlockEntryInstr*>* loop_headers); | 130 void ComputeLoops(GrowableArray<BlockEntryInstr*>* loop_headers); |
| 131 | 131 |
| 132 void RepairGraphAfterInlining(); |
| 133 |
| 132 // TODO(zerny): Once the SSA is feature complete this should be removed. | 134 // TODO(zerny): Once the SSA is feature complete this should be removed. |
| 133 void Bailout(const char* reason) const; | 135 void Bailout(const char* reason) const; |
| 134 | 136 |
| 137 void InvalidateDominatorTree() { invalid_dominator_tree_ = true; } |
| 138 |
| 135 #ifdef DEBUG | 139 #ifdef DEBUG |
| 136 // Verification methods for debugging. | 140 // Verification methods for debugging. |
| 137 bool VerifyUseLists(); | 141 bool VerifyUseLists(); |
| 138 #endif // DEBUG | 142 #endif // DEBUG |
| 139 | 143 |
| 140 void DiscoverBlocks(); | |
| 141 | |
| 142 private: | 144 private: |
| 143 friend class IfConverter; | 145 friend class IfConverter; |
| 144 friend class BranchSimplifier; | 146 friend class BranchSimplifier; |
| 145 friend class ConstantPropagator; | 147 friend class ConstantPropagator; |
| 146 | 148 |
| 149 void DiscoverBlocks(); |
| 150 |
| 147 // SSA transformation methods and fields. | 151 // SSA transformation methods and fields. |
| 148 void ComputeDominators(GrowableArray<BitVector*>* dominance_frontier); | 152 void ComputeDominators(GrowableArray<BitVector*>* dominance_frontier); |
| 149 | 153 |
| 150 void CompressPath( | 154 void CompressPath( |
| 151 intptr_t start_index, | 155 intptr_t start_index, |
| 152 intptr_t current_index, | 156 intptr_t current_index, |
| 153 GrowableArray<intptr_t>* parent, | 157 GrowableArray<intptr_t>* parent, |
| 154 GrowableArray<intptr_t>* label); | 158 GrowableArray<intptr_t>* label); |
| 155 | 159 |
| 156 void Rename(GrowableArray<PhiInstr*>* live_phis, | 160 void Rename(GrowableArray<PhiInstr*>* live_phis, |
| (...skipping 23 matching lines...) Expand all Loading... |
| 180 | 184 |
| 181 // Flow graph fields. | 185 // Flow graph fields. |
| 182 const ParsedFunction& parsed_function_; | 186 const ParsedFunction& parsed_function_; |
| 183 const intptr_t num_copied_params_; | 187 const intptr_t num_copied_params_; |
| 184 const intptr_t num_non_copied_params_; | 188 const intptr_t num_non_copied_params_; |
| 185 const intptr_t num_stack_locals_; | 189 const intptr_t num_stack_locals_; |
| 186 GraphEntryInstr* graph_entry_; | 190 GraphEntryInstr* graph_entry_; |
| 187 GrowableArray<BlockEntryInstr*> preorder_; | 191 GrowableArray<BlockEntryInstr*> preorder_; |
| 188 GrowableArray<BlockEntryInstr*> postorder_; | 192 GrowableArray<BlockEntryInstr*> postorder_; |
| 189 GrowableArray<BlockEntryInstr*> reverse_postorder_; | 193 GrowableArray<BlockEntryInstr*> reverse_postorder_; |
| 194 bool invalid_dominator_tree_; |
| 190 ConstantInstr* constant_null_; | 195 ConstantInstr* constant_null_; |
| 191 }; | 196 }; |
| 192 | 197 |
| 193 } // namespace dart | 198 } // namespace dart |
| 194 | 199 |
| 195 #endif // VM_FLOW_GRAPH_H_ | 200 #endif // VM_FLOW_GRAPH_H_ |
| OLD | NEW |