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

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

Issue 10871040: Revert my last change r11227. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 4 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.h ('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
11 namespace dart { 11 namespace dart {
12 12
13 template <typename T> class GrowableArray; 13 template <typename T> class GrowableArray;
14 template <typename T> class DirectChainedHashMap;
15 14
16 class FlowGraphOptimizer : public FlowGraphVisitor { 15 class FlowGraphOptimizer : public FlowGraphVisitor {
17 public: 16 public:
18 explicit FlowGraphOptimizer(const FlowGraph& flow_graph) 17 explicit FlowGraphOptimizer(const FlowGraph& flow_graph)
19 : FlowGraphVisitor(flow_graph.reverse_postorder()) {} 18 : FlowGraphVisitor(flow_graph.reverse_postorder()) {}
20 virtual ~FlowGraphOptimizer() {} 19 virtual ~FlowGraphOptimizer() {}
21 20
22 void ApplyICData(); 21 void ApplyICData();
23 22
24 void OptimizeComputations(); 23 void OptimizeComputations();
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 virtual void VisitParameter(ParameterInstr* param); 98 virtual void VisitParameter(ParameterInstr* param);
100 virtual void VisitPushArgument(PushArgumentInstr* bind); 99 virtual void VisitPushArgument(PushArgumentInstr* bind);
101 100
102 private: 101 private:
103 const ParsedFunction& parsed_function_; 102 const ParsedFunction& parsed_function_;
104 bool still_changing_; 103 bool still_changing_;
105 DISALLOW_COPY_AND_ASSIGN(FlowGraphTypePropagator); 104 DISALLOW_COPY_AND_ASSIGN(FlowGraphTypePropagator);
106 }; 105 };
107 106
108 107
109 // A simple common subexpression elimination based 108 class LocalCSE : public ValueObject {
110 // on the dominator tree.
111 class DominatorBasedCSE : public AllStatic {
112 public: 109 public:
113 static void Optimize(BlockEntryInstr* graph_entry); 110 explicit LocalCSE(const FlowGraph& flow_graph)
111 : blocks_(flow_graph.reverse_postorder()) { }
112
113 void Optimize();
114 114
115 private: 115 private:
116 static void OptimizeRecursive( 116 const GrowableArray<BlockEntryInstr*>& blocks_;
117 BlockEntryInstr* entry, 117
118 DirectChainedHashMap<BindInstr*>* map); 118 DISALLOW_COPY_AND_ASSIGN(LocalCSE);
119 }; 119 };
120 120
121 121
122 } // namespace dart 122 } // namespace dart
123 123
124 #endif // VM_FLOW_GRAPH_OPTIMIZER_H_ 124 #endif // VM_FLOW_GRAPH_OPTIMIZER_H_
OLDNEW
« no previous file with comments | « runtime/vm/flow_graph.h ('k') | runtime/vm/flow_graph_optimizer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698