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

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

Issue 13726023: Restore r20998 with a bug fix: add field to guarded_fields_ when it contains relevant cid. Was miss… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 8 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
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; 14 template <typename T> class DirectChainedHashMap;
15 template <typename T> class PointerKeyValueTrait; 15 template <typename T> class PointerKeyValueTrait;
16 16
17 class FlowGraphOptimizer : public FlowGraphVisitor { 17 class FlowGraphOptimizer : public FlowGraphVisitor {
18 public: 18 public:
19 explicit FlowGraphOptimizer(FlowGraph* flow_graph) 19 FlowGraphOptimizer(FlowGraph* flow_graph,
20 GrowableArray<Field*>* guarded_fields)
20 : FlowGraphVisitor(flow_graph->reverse_postorder()), 21 : FlowGraphVisitor(flow_graph->reverse_postorder()),
21 flow_graph_(flow_graph) { } 22 flow_graph_(flow_graph),
23 guarded_fields_(guarded_fields) { }
22 virtual ~FlowGraphOptimizer() {} 24 virtual ~FlowGraphOptimizer() {}
23 25
24 FlowGraph* flow_graph() const { return flow_graph_; } 26 FlowGraph* flow_graph() const { return flow_graph_; }
25 27
26 // Use ICData to optimize, replace or eliminate instructions. 28 // Use ICData to optimize, replace or eliminate instructions.
27 void ApplyICData(); 29 void ApplyICData();
28 30
29 // Use propagated class ids to optimize, replace or eliminate instructions. 31 // Use propagated class ids to optimize, replace or eliminate instructions.
30 void ApplyClassIds(); 32 void ApplyClassIds();
31 33
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 // Visit an equality compare. The current instruction can be the 152 // Visit an equality compare. The current instruction can be the
151 // comparison itself or a branch on the comparison. 153 // comparison itself or a branch on the comparison.
152 template <typename T> 154 template <typename T>
153 void HandleEqualityCompare(EqualityCompareInstr* comp, 155 void HandleEqualityCompare(EqualityCompareInstr* comp,
154 T current_instruction); 156 T current_instruction);
155 157
156 void OptimizeLeftShiftBitAndSmiOp(Definition* bit_and_instr, 158 void OptimizeLeftShiftBitAndSmiOp(Definition* bit_and_instr,
157 Definition* left_instr, 159 Definition* left_instr,
158 Definition* right_instr); 160 Definition* right_instr);
159 161
162 void AddToGuardedFields(Field* field);
163
160 FlowGraph* flow_graph_; 164 FlowGraph* flow_graph_;
165 GrowableArray<Field*>* guarded_fields_;
161 166
162 DISALLOW_COPY_AND_ASSIGN(FlowGraphOptimizer); 167 DISALLOW_COPY_AND_ASSIGN(FlowGraphOptimizer);
163 }; 168 };
164 169
165 170
166 class ParsedFunction; 171 class ParsedFunction;
167 172
168 173
169 // Loop invariant code motion. 174 // Loop invariant code motion.
170 class LICM : public ValueObject { 175 class LICM : public ValueObject {
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
295 // inputs. 300 // inputs.
296 static BranchInstr* CloneBranch(BranchInstr* branch, 301 static BranchInstr* CloneBranch(BranchInstr* branch,
297 Value* left, 302 Value* left,
298 Value* right); 303 Value* right);
299 }; 304 };
300 305
301 306
302 } // namespace dart 307 } // namespace dart
303 308
304 #endif // VM_FLOW_GRAPH_OPTIMIZER_H_ 309 #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