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

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

Issue 12335063: Add functions for setting an environment and rebinding a use. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rebased and incorportated review comments. Created 7 years, 10 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 | « runtime/vm/flow_graph_inliner.cc ('k') | runtime/vm/flow_graph_optimizer.cc » ('j') | no next file with comments »
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_OPTIMIZER_H_ 5 #ifndef VM_FLOW_GRAPH_OPTIMIZER_H_
6 #define VM_FLOW_GRAPH_OPTIMIZER_H_ 6 #define VM_FLOW_GRAPH_OPTIMIZER_H_
7 7
8 #include "vm/intermediate_language.h" 8 #include "vm/intermediate_language.h"
9 #include "vm/flow_graph.h" 9 #include "vm/flow_graph.h"
10 10
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 FlowGraph* flow_graph_; 155 FlowGraph* flow_graph_;
156 156
157 DISALLOW_COPY_AND_ASSIGN(FlowGraphOptimizer); 157 DISALLOW_COPY_AND_ASSIGN(FlowGraphOptimizer);
158 }; 158 };
159 159
160 160
161 class ParsedFunction; 161 class ParsedFunction;
162 162
163 163
164 // Loop invariant code motion. 164 // Loop invariant code motion.
165 class LICM : public AllStatic { 165 class LICM : public ValueObject {
166 public: 166 public:
167 static void Optimize(FlowGraph* flow_graph); 167 explicit LICM(FlowGraph* flow_graph);
168
169 void Optimize();
168 170
169 private: 171 private:
170 static void Hoist(ForwardInstructionIterator* it, 172 FlowGraph* flow_graph() const { return flow_graph_; }
171 BlockEntryInstr* pre_header,
172 Instruction* current);
173 173
174 static void TryHoistCheckSmiThroughPhi(ForwardInstructionIterator* it, 174 void Hoist(ForwardInstructionIterator* it,
175 BlockEntryInstr* header, 175 BlockEntryInstr* pre_header,
176 BlockEntryInstr* pre_header, 176 Instruction* current);
177 CheckSmiInstr* current); 177
178 void TryHoistCheckSmiThroughPhi(ForwardInstructionIterator* it,
179 BlockEntryInstr* header,
180 BlockEntryInstr* pre_header,
181 CheckSmiInstr* current);
182
183 FlowGraph* const flow_graph_;
178 }; 184 };
179 185
180 186
181 // A simple common subexpression elimination based 187 // A simple common subexpression elimination based
182 // on the dominator tree. 188 // on the dominator tree.
183 class DominatorBasedCSE : public AllStatic { 189 class DominatorBasedCSE : public AllStatic {
184 public: 190 public:
185 // Return true, if the optimization changed the flow graph. 191 // Return true, if the optimization changed the flow graph.
186 // False, if nothing changed. 192 // False, if nothing changed.
187 static bool Optimize(FlowGraph* graph); 193 static bool Optimize(FlowGraph* graph);
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
250 256
251 // Worklists of blocks and definitions. 257 // Worklists of blocks and definitions.
252 GrowableArray<BlockEntryInstr*> block_worklist_; 258 GrowableArray<BlockEntryInstr*> block_worklist_;
253 GrowableArray<Definition*> definition_worklist_; 259 GrowableArray<Definition*> definition_worklist_;
254 }; 260 };
255 261
256 262
257 } // namespace dart 263 } // namespace dart
258 264
259 #endif // VM_FLOW_GRAPH_OPTIMIZER_H_ 265 #endif // VM_FLOW_GRAPH_OPTIMIZER_H_
OLDNEW
« no previous file with comments | « runtime/vm/flow_graph_inliner.cc ('k') | runtime/vm/flow_graph_optimizer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698