| 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 | |
| 134 // TODO(zerny): Once the SSA is feature complete this should be removed. | 132 // TODO(zerny): Once the SSA is feature complete this should be removed. |
| 135 void Bailout(const char* reason) const; | 133 void Bailout(const char* reason) const; |
| 136 | 134 |
| 137 void InvalidateDominatorTree() { invalid_dominator_tree_ = true; } | |
| 138 | |
| 139 #ifdef DEBUG | 135 #ifdef DEBUG |
| 140 // Verification methods for debugging. | 136 // Verification methods for debugging. |
| 141 bool VerifyUseLists(); | 137 bool VerifyUseLists(); |
| 142 #endif // DEBUG | 138 #endif // DEBUG |
| 143 | 139 |
| 140 void DiscoverBlocks(); |
| 141 |
| 144 private: | 142 private: |
| 145 friend class BranchSimplifier; | 143 friend class BranchSimplifier; |
| 146 friend class ConstantPropagator; | 144 friend class ConstantPropagator; |
| 147 | 145 |
| 148 void DiscoverBlocks(); | |
| 149 | |
| 150 // SSA transformation methods and fields. | 146 // SSA transformation methods and fields. |
| 151 void ComputeDominators(GrowableArray<BitVector*>* dominance_frontier); | 147 void ComputeDominators(GrowableArray<BitVector*>* dominance_frontier); |
| 152 | 148 |
| 153 void CompressPath( | 149 void CompressPath( |
| 154 intptr_t start_index, | 150 intptr_t start_index, |
| 155 intptr_t current_index, | 151 intptr_t current_index, |
| 156 GrowableArray<intptr_t>* parent, | 152 GrowableArray<intptr_t>* parent, |
| 157 GrowableArray<intptr_t>* label); | 153 GrowableArray<intptr_t>* label); |
| 158 | 154 |
| 159 void Rename(GrowableArray<PhiInstr*>* live_phis, | 155 void Rename(GrowableArray<PhiInstr*>* live_phis, |
| (...skipping 23 matching lines...) Expand all Loading... |
| 183 | 179 |
| 184 // Flow graph fields. | 180 // Flow graph fields. |
| 185 const ParsedFunction& parsed_function_; | 181 const ParsedFunction& parsed_function_; |
| 186 const intptr_t num_copied_params_; | 182 const intptr_t num_copied_params_; |
| 187 const intptr_t num_non_copied_params_; | 183 const intptr_t num_non_copied_params_; |
| 188 const intptr_t num_stack_locals_; | 184 const intptr_t num_stack_locals_; |
| 189 GraphEntryInstr* graph_entry_; | 185 GraphEntryInstr* graph_entry_; |
| 190 GrowableArray<BlockEntryInstr*> preorder_; | 186 GrowableArray<BlockEntryInstr*> preorder_; |
| 191 GrowableArray<BlockEntryInstr*> postorder_; | 187 GrowableArray<BlockEntryInstr*> postorder_; |
| 192 GrowableArray<BlockEntryInstr*> reverse_postorder_; | 188 GrowableArray<BlockEntryInstr*> reverse_postorder_; |
| 193 bool invalid_dominator_tree_; | |
| 194 ConstantInstr* constant_null_; | 189 ConstantInstr* constant_null_; |
| 195 }; | 190 }; |
| 196 | 191 |
| 197 } // namespace dart | 192 } // namespace dart |
| 198 | 193 |
| 199 #endif // VM_FLOW_GRAPH_H_ | 194 #endif // VM_FLOW_GRAPH_H_ |
| OLD | NEW |