| 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 26 matching lines...) Expand all Loading... |
| 37 | 37 |
| 38 // Returns true if any instructions were canonicalized away. | 38 // Returns true if any instructions were canonicalized away. |
| 39 bool Canonicalize(); | 39 bool Canonicalize(); |
| 40 | 40 |
| 41 void EliminateDeadPhis(); | 41 void EliminateDeadPhis(); |
| 42 | 42 |
| 43 void SelectRepresentations(); | 43 void SelectRepresentations(); |
| 44 | 44 |
| 45 void InferSmiRanges(); | 45 void InferSmiRanges(); |
| 46 | 46 |
| 47 void AnalyzeTryCatch(); |
| 48 |
| 47 // Remove environments from the instructions which do not deoptimize. | 49 // Remove environments from the instructions which do not deoptimize. |
| 48 void EliminateEnvironments(); | 50 void EliminateEnvironments(); |
| 49 | 51 |
| 50 virtual void VisitStaticCall(StaticCallInstr* instr); | 52 virtual void VisitStaticCall(StaticCallInstr* instr); |
| 51 virtual void VisitInstanceCall(InstanceCallInstr* instr); | 53 virtual void VisitInstanceCall(InstanceCallInstr* instr); |
| 52 virtual void VisitRelationalOp(RelationalOpInstr* instr); | 54 virtual void VisitRelationalOp(RelationalOpInstr* instr); |
| 53 virtual void VisitEqualityCompare(EqualityCompareInstr* instr); | 55 virtual void VisitEqualityCompare(EqualityCompareInstr* instr); |
| 54 virtual void VisitBranch(BranchInstr* instr); | 56 virtual void VisitBranch(BranchInstr* instr); |
| 55 virtual void VisitStrictCompare(StrictCompareInstr* instr); | 57 virtual void VisitStrictCompare(StrictCompareInstr* instr); |
| 56 | 58 |
| (...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 338 Instruction* exit, | 340 Instruction* exit, |
| 339 AllocateObjectInstr* alloc, | 341 AllocateObjectInstr* alloc, |
| 340 const Class& cls, | 342 const Class& cls, |
| 341 const ZoneGrowableArray<const Field*>& fields); | 343 const ZoneGrowableArray<const Field*>& fields); |
| 342 | 344 |
| 343 FlowGraph* flow_graph_; | 345 FlowGraph* flow_graph_; |
| 344 | 346 |
| 345 GrowableArray<MaterializeObjectInstr*> materializations_; | 347 GrowableArray<MaterializeObjectInstr*> materializations_; |
| 346 }; | 348 }; |
| 347 | 349 |
| 350 |
| 351 // Optimize spill stores inside try-blocks by identifying values that always |
| 352 // contain a single known constant at catch block entry. |
| 353 class TryCatchAnalyzer : public AllStatic { |
| 354 public: |
| 355 static void Optimize(FlowGraph* flow_graph); |
| 356 }; |
| 357 |
| 348 } // namespace dart | 358 } // namespace dart |
| 349 | 359 |
| 350 #endif // VM_FLOW_GRAPH_OPTIMIZER_H_ | 360 #endif // VM_FLOW_GRAPH_OPTIMIZER_H_ |
| OLD | NEW |