| 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 12 matching lines...) Expand all Loading... |
| 23 void ApplyICData(); | 23 void ApplyICData(); |
| 24 | 24 |
| 25 void OptimizeComputations(); | 25 void OptimizeComputations(); |
| 26 | 26 |
| 27 void EliminateDeadPhis(); | 27 void EliminateDeadPhis(); |
| 28 | 28 |
| 29 void SelectRepresentations(); | 29 void SelectRepresentations(); |
| 30 | 30 |
| 31 void PropagateSminess(); | 31 void PropagateSminess(); |
| 32 | 32 |
| 33 void InferSmiRanges(); |
| 34 |
| 33 virtual void VisitStaticCall(StaticCallInstr* instr); | 35 virtual void VisitStaticCall(StaticCallInstr* instr); |
| 34 virtual void VisitInstanceCall(InstanceCallInstr* instr); | 36 virtual void VisitInstanceCall(InstanceCallInstr* instr); |
| 35 virtual void VisitRelationalOp(RelationalOpInstr* instr); | 37 virtual void VisitRelationalOp(RelationalOpInstr* instr); |
| 36 virtual void VisitEqualityCompare(EqualityCompareInstr* instr); | 38 virtual void VisitEqualityCompare(EqualityCompareInstr* instr); |
| 37 virtual void VisitBranch(BranchInstr* instr); | 39 virtual void VisitBranch(BranchInstr* instr); |
| 38 | 40 |
| 39 void InsertBefore(Instruction* next, | 41 void InsertBefore(Instruction* next, |
| 40 Instruction* instr, | 42 Instruction* instr, |
| 41 Environment* env, | 43 Environment* env, |
| 42 Definition::UseKind use_kind); | 44 Definition::UseKind use_kind); |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 static void Optimize(FlowGraph* flow_graph); | 132 static void Optimize(FlowGraph* flow_graph); |
| 131 | 133 |
| 132 private: | 134 private: |
| 133 static void Hoist(ForwardInstructionIterator* it, | 135 static void Hoist(ForwardInstructionIterator* it, |
| 134 BlockEntryInstr* pre_header, | 136 BlockEntryInstr* pre_header, |
| 135 Instruction* current); | 137 Instruction* current); |
| 136 | 138 |
| 137 static void TryHoistCheckSmiThroughPhi(ForwardInstructionIterator* it, | 139 static void TryHoistCheckSmiThroughPhi(ForwardInstructionIterator* it, |
| 138 BlockEntryInstr* header, | 140 BlockEntryInstr* header, |
| 139 BlockEntryInstr* pre_header, | 141 BlockEntryInstr* pre_header, |
| 140 Instruction* current); | 142 CheckSmiInstr* current); |
| 141 }; | 143 }; |
| 142 | 144 |
| 143 | 145 |
| 144 // A simple common subexpression elimination based | 146 // A simple common subexpression elimination based |
| 145 // on the dominator tree. | 147 // on the dominator tree. |
| 146 class DominatorBasedCSE : public AllStatic { | 148 class DominatorBasedCSE : public AllStatic { |
| 147 public: | 149 public: |
| 148 static void Optimize(FlowGraph* graph); | 150 static void Optimize(FlowGraph* graph); |
| 149 | 151 |
| 150 private: | 152 private: |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 210 | 212 |
| 211 // Worklists of blocks and definitions. | 213 // Worklists of blocks and definitions. |
| 212 GrowableArray<BlockEntryInstr*> block_worklist_; | 214 GrowableArray<BlockEntryInstr*> block_worklist_; |
| 213 GrowableArray<Definition*> definition_worklist_; | 215 GrowableArray<Definition*> definition_worklist_; |
| 214 }; | 216 }; |
| 215 | 217 |
| 216 | 218 |
| 217 } // namespace dart | 219 } // namespace dart |
| 218 | 220 |
| 219 #endif // VM_FLOW_GRAPH_OPTIMIZER_H_ | 221 #endif // VM_FLOW_GRAPH_OPTIMIZER_H_ |
| OLD | NEW |