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 BindInstr; |
13 class BlockEntryInstr; | 14 class BlockEntryInstr; |
| 15 class StaticCallComp; |
14 class Definition; | 16 class Definition; |
15 class FlowGraphBuilder; | 17 class FlowGraphBuilder; |
16 class GraphEntryInstr; | 18 class GraphEntryInstr; |
17 class PhiInstr; | 19 class PhiInstr; |
18 class ReturnInstr; | 20 class ReturnInstr; |
19 class StaticCallInstr; | |
20 | 21 |
21 // Class to incapsulate the construction and manipulation of the flow graph. | 22 // Class to incapsulate the construction and manipulation of the flow graph. |
22 class FlowGraph: public ZoneAllocated { | 23 class FlowGraph: public ZoneAllocated { |
23 public: | 24 public: |
24 FlowGraph(const FlowGraphBuilder& builder, GraphEntryInstr* graph_entry); | 25 FlowGraph(const FlowGraphBuilder& builder, GraphEntryInstr* graph_entry); |
25 | 26 |
26 // Function properties. | 27 // Function properties. |
27 const ParsedFunction& parsed_function() const { | 28 const ParsedFunction& parsed_function() const { |
28 return parsed_function_; | 29 return parsed_function_; |
29 } | 30 } |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 | 65 |
65 ZoneGrowableArray<ReturnInstr*>* exits() const { return exits_; } | 66 ZoneGrowableArray<ReturnInstr*>* exits() const { return exits_; } |
66 void set_exits(ZoneGrowableArray<ReturnInstr*>* exits) { exits_ = exits; } | 67 void set_exits(ZoneGrowableArray<ReturnInstr*>* exits) { exits_ = exits; } |
67 | 68 |
68 intptr_t alloc_ssa_temp_index() { return current_ssa_temp_index_++; } | 69 intptr_t alloc_ssa_temp_index() { return current_ssa_temp_index_++; } |
69 | 70 |
70 // Operations on the flow graph. | 71 // Operations on the flow graph. |
71 void ComputeSSA(intptr_t next_virtual_register_number = 0); | 72 void ComputeSSA(intptr_t next_virtual_register_number = 0); |
72 void ComputeUseLists(); | 73 void ComputeUseLists(); |
73 | 74 |
74 void InlineCall(StaticCallInstr* call, FlowGraph* callee_graph); | 75 void InlineCall(BindInstr* caller_instr, |
| 76 StaticCallComp* caller_comp, |
| 77 FlowGraph* callee_graph); |
75 | 78 |
76 // TODO(zerny): Once the SSA is feature complete this should be removed. | 79 // TODO(zerny): Once the SSA is feature complete this should be removed. |
77 void Bailout(const char* reason) const; | 80 void Bailout(const char* reason) const; |
78 | 81 |
79 #ifdef DEBUG | 82 #ifdef DEBUG |
80 // Validation methods for debugging. | 83 // Validation methods for debugging. |
81 bool ResetUseLists(); | 84 bool ResetUseLists(); |
82 bool ValidateUseLists(); | 85 bool ValidateUseLists(); |
83 #endif // DEBUG | 86 #endif // DEBUG |
84 | 87 |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 GraphEntryInstr* graph_entry_; | 130 GraphEntryInstr* graph_entry_; |
128 GrowableArray<BlockEntryInstr*> preorder_; | 131 GrowableArray<BlockEntryInstr*> preorder_; |
129 GrowableArray<BlockEntryInstr*> postorder_; | 132 GrowableArray<BlockEntryInstr*> postorder_; |
130 GrowableArray<BlockEntryInstr*> reverse_postorder_; | 133 GrowableArray<BlockEntryInstr*> reverse_postorder_; |
131 ZoneGrowableArray<ReturnInstr*>* exits_; | 134 ZoneGrowableArray<ReturnInstr*>* exits_; |
132 }; | 135 }; |
133 | 136 |
134 } // namespace dart | 137 } // namespace dart |
135 | 138 |
136 #endif // VM_FLOW_GRAPH_H_ | 139 #endif // VM_FLOW_GRAPH_H_ |
OLD | NEW |