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

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

Issue 12221139: Revert "Remove SminessPropagator and FlowGraphTypePropagator and all associated infrastructure and … (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 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_compiler_x64.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 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 114
115 FlowGraph* flow_graph_; 115 FlowGraph* flow_graph_;
116 116
117 DISALLOW_COPY_AND_ASSIGN(FlowGraphOptimizer); 117 DISALLOW_COPY_AND_ASSIGN(FlowGraphOptimizer);
118 }; 118 };
119 119
120 120
121 class ParsedFunction; 121 class ParsedFunction;
122 122
123 123
124 class FlowGraphTypePropagator : public FlowGraphVisitor {
125 public:
126 explicit FlowGraphTypePropagator(FlowGraph* flow_graph)
127 : FlowGraphVisitor(flow_graph->reverse_postorder()),
128 parsed_function_(flow_graph->parsed_function()),
129 flow_graph_(flow_graph),
130 still_changing_(false) { }
131 virtual ~FlowGraphTypePropagator() { }
132
133 const ParsedFunction& parsed_function() const { return parsed_function_; }
134
135 void PropagateTypes();
136
137 private:
138 virtual void VisitBlocks();
139
140 virtual void VisitAssertAssignable(AssertAssignableInstr* instr);
141 virtual void VisitAssertBoolean(AssertBooleanInstr* instr);
142 virtual void VisitInstanceOf(InstanceOfInstr* instr);
143
144 virtual void VisitGraphEntry(GraphEntryInstr* graph_entry);
145 virtual void VisitJoinEntry(JoinEntryInstr* join_entry);
146 virtual void VisitPhi(PhiInstr* phi);
147 virtual void VisitParameter(ParameterInstr* param);
148 virtual void VisitPushArgument(PushArgumentInstr* bind);
149
150 const ParsedFunction& parsed_function_;
151 FlowGraph* flow_graph_;
152 bool still_changing_;
153 DISALLOW_COPY_AND_ASSIGN(FlowGraphTypePropagator);
154 };
155
156
124 // Loop invariant code motion. 157 // Loop invariant code motion.
125 class LICM : public AllStatic { 158 class LICM : public AllStatic {
126 public: 159 public:
127 static void Optimize(FlowGraph* flow_graph); 160 static void Optimize(FlowGraph* flow_graph);
128 161
129 private: 162 private:
130 static void Hoist(ForwardInstructionIterator* it, 163 static void Hoist(ForwardInstructionIterator* it,
131 BlockEntryInstr* pre_header, 164 BlockEntryInstr* pre_header,
132 Instruction* current); 165 Instruction* current);
133 166
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
210 243
211 // Worklists of blocks and definitions. 244 // Worklists of blocks and definitions.
212 GrowableArray<BlockEntryInstr*> block_worklist_; 245 GrowableArray<BlockEntryInstr*> block_worklist_;
213 GrowableArray<Definition*> definition_worklist_; 246 GrowableArray<Definition*> definition_worklist_;
214 }; 247 };
215 248
216 249
217 } // namespace dart 250 } // namespace dart
218 251
219 #endif // VM_FLOW_GRAPH_OPTIMIZER_H_ 252 #endif // VM_FLOW_GRAPH_OPTIMIZER_H_
OLDNEW
« no previous file with comments | « runtime/vm/flow_graph_compiler_x64.cc ('k') | runtime/vm/flow_graph_optimizer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698