| 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 Definition; |
| 14 class FlowGraphBuilder; | 15 class FlowGraphBuilder; |
| 15 class GraphEntryInstr; | 16 class GraphEntryInstr; |
| 16 class PhiInstr; | 17 class PhiInstr; |
| 17 class Value; | |
| 18 | 18 |
| 19 // Class to incapsulate the construction and manipulation of the flow graph. | 19 // Class to incapsulate the construction and manipulation of the flow graph. |
| 20 class FlowGraph: public ZoneAllocated { | 20 class FlowGraph: public ZoneAllocated { |
| 21 public: | 21 public: |
| 22 FlowGraph(const FlowGraphBuilder& builder, GraphEntryInstr* graph_entry); | 22 FlowGraph(const FlowGraphBuilder& builder, GraphEntryInstr* graph_entry); |
| 23 | 23 |
| 24 // Function properties. | 24 // Function properties. |
| 25 const ParsedFunction& parsed_function() const { | 25 const ParsedFunction& parsed_function() const { |
| 26 return parsed_function_; | 26 return parsed_function_; |
| 27 } | 27 } |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 | 73 |
| 74 void CompressPath( | 74 void CompressPath( |
| 75 intptr_t start_index, | 75 intptr_t start_index, |
| 76 intptr_t current_index, | 76 intptr_t current_index, |
| 77 GrowableArray<intptr_t>* parent, | 77 GrowableArray<intptr_t>* parent, |
| 78 GrowableArray<intptr_t>* label); | 78 GrowableArray<intptr_t>* label); |
| 79 | 79 |
| 80 void Rename(GrowableArray<PhiInstr*>* live_phis); | 80 void Rename(GrowableArray<PhiInstr*>* live_phis); |
| 81 void RenameRecursive( | 81 void RenameRecursive( |
| 82 BlockEntryInstr* block_entry, | 82 BlockEntryInstr* block_entry, |
| 83 GrowableArray<Value*>* env, | 83 GrowableArray<Definition*>* env, |
| 84 GrowableArray<PhiInstr*>* live_phis); | 84 GrowableArray<PhiInstr*>* live_phis); |
| 85 | 85 |
| 86 void InsertPhis( | 86 void InsertPhis( |
| 87 const GrowableArray<BlockEntryInstr*>& preorder, | 87 const GrowableArray<BlockEntryInstr*>& preorder, |
| 88 const GrowableArray<BitVector*>& assigned_vars, | 88 const GrowableArray<BitVector*>& assigned_vars, |
| 89 const GrowableArray<BitVector*>& dom_frontier); | 89 const GrowableArray<BitVector*>& dom_frontier); |
| 90 | 90 |
| 91 void MarkLivePhis(GrowableArray<PhiInstr*>* live_phis); | 91 void MarkLivePhis(GrowableArray<PhiInstr*>* live_phis); |
| 92 | 92 |
| 93 intptr_t current_ssa_temp_index() const { return current_ssa_temp_index_; } | 93 intptr_t current_ssa_temp_index() const { return current_ssa_temp_index_; } |
| (...skipping 13 matching lines...) Expand all Loading... |
| 107 const intptr_t stack_local_count_; | 107 const intptr_t stack_local_count_; |
| 108 GraphEntryInstr* graph_entry_; | 108 GraphEntryInstr* graph_entry_; |
| 109 GrowableArray<BlockEntryInstr*> preorder_; | 109 GrowableArray<BlockEntryInstr*> preorder_; |
| 110 GrowableArray<BlockEntryInstr*> postorder_; | 110 GrowableArray<BlockEntryInstr*> postorder_; |
| 111 GrowableArray<BlockEntryInstr*> reverse_postorder_; | 111 GrowableArray<BlockEntryInstr*> reverse_postorder_; |
| 112 }; | 112 }; |
| 113 | 113 |
| 114 } // namespace dart | 114 } // namespace dart |
| 115 | 115 |
| 116 #endif // VM_FLOW_GRAPH_H_ | 116 #endif // VM_FLOW_GRAPH_H_ |
| OLD | NEW |