| OLD | NEW |
| 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 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 229 ConstantPropagator(FlowGraph* graph, | 229 ConstantPropagator(FlowGraph* graph, |
| 230 const GrowableArray<BlockEntryInstr*>& ignored); | 230 const GrowableArray<BlockEntryInstr*>& ignored); |
| 231 | 231 |
| 232 static void Optimize(FlowGraph* graph); | 232 static void Optimize(FlowGraph* graph); |
| 233 | 233 |
| 234 // Only visit branches to optimize away unreachable blocks discovered | 234 // Only visit branches to optimize away unreachable blocks discovered |
| 235 // by range analysis. | 235 // by range analysis. |
| 236 static void OptimizeBranches(FlowGraph* graph); | 236 static void OptimizeBranches(FlowGraph* graph); |
| 237 | 237 |
| 238 // Used to initialize the abstract value of definitions. | 238 // Used to initialize the abstract value of definitions. |
| 239 static RawObject* Unknown() { return Object::transition_sentinel().raw(); } | 239 static RawObject* Unknown() { return Object::unknown_constant().raw(); } |
| 240 | 240 |
| 241 private: | 241 private: |
| 242 void Analyze(); | 242 void Analyze(); |
| 243 void VisitBranches(); | 243 void VisitBranches(); |
| 244 void Transform(); | 244 void Transform(); |
| 245 | 245 |
| 246 void SetReachable(BlockEntryInstr* block); | 246 void SetReachable(BlockEntryInstr* block); |
| 247 void SetValue(Definition* definition, const Object& value); | 247 void SetValue(Definition* definition, const Object& value); |
| 248 | 248 |
| 249 // Assign the join (least upper bound) of a pair of abstract values to the | 249 // Assign the join (least upper bound) of a pair of abstract values to the |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 341 const ZoneGrowableArray<const Field*>& fields); | 341 const ZoneGrowableArray<const Field*>& fields); |
| 342 | 342 |
| 343 FlowGraph* flow_graph_; | 343 FlowGraph* flow_graph_; |
| 344 | 344 |
| 345 GrowableArray<MaterializeObjectInstr*> materializations_; | 345 GrowableArray<MaterializeObjectInstr*> materializations_; |
| 346 }; | 346 }; |
| 347 | 347 |
| 348 } // namespace dart | 348 } // namespace dart |
| 349 | 349 |
| 350 #endif // VM_FLOW_GRAPH_OPTIMIZER_H_ | 350 #endif // VM_FLOW_GRAPH_OPTIMIZER_H_ |
| OLD | NEW |