Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(230)

Side by Side Diff: runtime/vm/flow_graph.h

Issue 10967007: Inlining functions with control flow. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | runtime/vm/flow_graph.cc » ('j') | runtime/vm/flow_graph.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 22 matching lines...) Expand all
33 33
34 private: 34 private:
35 const GrowableArray<BlockEntryInstr*>& block_order_; 35 const GrowableArray<BlockEntryInstr*>& block_order_;
36 intptr_t current_; 36 intptr_t current_;
37 }; 37 };
38 38
39 39
40 // Class to incapsulate the construction and manipulation of the flow graph. 40 // Class to incapsulate the construction and manipulation of the flow graph.
41 class FlowGraph : public ZoneAllocated { 41 class FlowGraph : public ZoneAllocated {
42 public: 42 public:
43 FlowGraph(const FlowGraphBuilder& builder, GraphEntryInstr* graph_entry); 43 FlowGraph(const FlowGraphBuilder& builder,
44 GraphEntryInstr* graph_entry,
45 intptr_t max_block_id);
44 46
45 // Function properties. 47 // Function properties.
46 const ParsedFunction& parsed_function() const { 48 const ParsedFunction& parsed_function() const {
47 return parsed_function_; 49 return parsed_function_;
48 } 50 }
49 intptr_t parameter_count() const { 51 intptr_t parameter_count() const {
50 return num_copied_params_ + num_non_copied_params_; 52 return num_copied_params_ + num_non_copied_params_;
51 } 53 }
52 intptr_t variable_count() const { 54 intptr_t variable_count() const {
53 return parameter_count() + num_stack_locals_; 55 return parameter_count() + num_stack_locals_;
(...skipping 26 matching lines...) Expand all
80 BlockIterator postorder_iterator() const { 82 BlockIterator postorder_iterator() const {
81 return BlockIterator(postorder()); 83 return BlockIterator(postorder());
82 } 84 }
83 85
84 intptr_t current_ssa_temp_index() const { return current_ssa_temp_index_; } 86 intptr_t current_ssa_temp_index() const { return current_ssa_temp_index_; }
85 87
86 intptr_t max_virtual_register_number() const { 88 intptr_t max_virtual_register_number() const {
87 return current_ssa_temp_index(); 89 return current_ssa_temp_index();
88 } 90 }
89 91
92 intptr_t max_block_id() const {
93 return max_block_id_;
94 }
95
90 GraphEntryInstr* graph_entry() const { 96 GraphEntryInstr* graph_entry() const {
91 return graph_entry_; 97 return graph_entry_;
92 } 98 }
93 99
94 ZoneGrowableArray<ReturnInstr*>* exits() const { return exits_; } 100 ZoneGrowableArray<ReturnInstr*>* exits() const { return exits_; }
95 void set_exits(ZoneGrowableArray<ReturnInstr*>* exits) { exits_ = exits; } 101 void set_exits(ZoneGrowableArray<ReturnInstr*>* exits) { exits_ = exits; }
96 102
97 intptr_t alloc_ssa_temp_index() { return current_ssa_temp_index_++; } 103 intptr_t alloc_ssa_temp_index() { return current_ssa_temp_index_++; }
98 104
99 // Operations on the flow graph. 105 // Operations on the flow graph.
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 const GrowableArray<BitVector*>& dom_frontier); 147 const GrowableArray<BitVector*>& dom_frontier);
142 148
143 void MarkLivePhis(GrowableArray<PhiInstr*>* live_phis); 149 void MarkLivePhis(GrowableArray<PhiInstr*>* live_phis);
144 150
145 // DiscoverBlocks computes parent_ and assigned_vars_ which are then used 151 // DiscoverBlocks computes parent_ and assigned_vars_ which are then used
146 // if/when computing SSA. 152 // if/when computing SSA.
147 GrowableArray<intptr_t> parent_; 153 GrowableArray<intptr_t> parent_;
148 GrowableArray<BitVector*> assigned_vars_; 154 GrowableArray<BitVector*> assigned_vars_;
149 155
150 intptr_t current_ssa_temp_index_; 156 intptr_t current_ssa_temp_index_;
157 intptr_t max_block_id_;
151 158
152 // Flow graph fields. 159 // Flow graph fields.
153 const ParsedFunction& parsed_function_; 160 const ParsedFunction& parsed_function_;
154 const intptr_t num_copied_params_; 161 const intptr_t num_copied_params_;
155 const intptr_t num_non_copied_params_; 162 const intptr_t num_non_copied_params_;
156 const intptr_t num_stack_locals_; 163 const intptr_t num_stack_locals_;
157 GraphEntryInstr* graph_entry_; 164 GraphEntryInstr* graph_entry_;
158 GrowableArray<BlockEntryInstr*> preorder_; 165 GrowableArray<BlockEntryInstr*> preorder_;
159 GrowableArray<BlockEntryInstr*> postorder_; 166 GrowableArray<BlockEntryInstr*> postorder_;
160 GrowableArray<BlockEntryInstr*> reverse_postorder_; 167 GrowableArray<BlockEntryInstr*> reverse_postorder_;
161 ZoneGrowableArray<ReturnInstr*>* exits_; 168 ZoneGrowableArray<ReturnInstr*>* exits_;
162 }; 169 };
163 170
164 } // namespace dart 171 } // namespace dart
165 172
166 #endif // VM_FLOW_GRAPH_H_ 173 #endif // VM_FLOW_GRAPH_H_
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/flow_graph.cc » ('j') | runtime/vm/flow_graph.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698