| 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 24 matching lines...) Expand all Loading... |
| 35 // shift can be a truncating Smi shift-left and result is always Smi. | 35 // shift can be a truncating Smi shift-left and result is always Smi. |
| 36 void TryOptimizeLeftShiftWithBitAndPattern(); | 36 void TryOptimizeLeftShiftWithBitAndPattern(); |
| 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 UnboxPhis(); |
| 46 |
| 45 void InferSmiRanges(); | 47 void InferSmiRanges(); |
| 46 | 48 |
| 47 void AnalyzeTryCatch(); | 49 void AnalyzeTryCatch(); |
| 48 | 50 |
| 49 // Remove environments from the instructions which do not deoptimize. | 51 // Remove environments from the instructions which do not deoptimize. |
| 50 void EliminateEnvironments(); | 52 void EliminateEnvironments(); |
| 51 | 53 |
| 52 virtual void VisitStaticCall(StaticCallInstr* instr); | 54 virtual void VisitStaticCall(StaticCallInstr* instr); |
| 53 virtual void VisitInstanceCall(InstanceCallInstr* instr); | 55 virtual void VisitInstanceCall(InstanceCallInstr* instr); |
| 54 virtual void VisitRelationalOp(RelationalOpInstr* instr); | 56 virtual void VisitRelationalOp(RelationalOpInstr* instr); |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 | 128 |
| 127 // Add a class check for a call's first argument immediately before the | 129 // Add a class check for a call's first argument immediately before the |
| 128 // call, using the call's IC data to determine the check, and the call's | 130 // call, using the call's IC data to determine the check, and the call's |
| 129 // deopt ID and deoptimization environment if the check fails. | 131 // deopt ID and deoptimization environment if the check fails. |
| 130 void AddReceiverCheck(InstanceCallInstr* call); | 132 void AddReceiverCheck(InstanceCallInstr* call); |
| 131 | 133 |
| 132 void ReplaceCall(Definition* call, Definition* replacement); | 134 void ReplaceCall(Definition* call, Definition* replacement); |
| 133 | 135 |
| 134 void InsertConversionsFor(Definition* def); | 136 void InsertConversionsFor(Definition* def); |
| 135 | 137 |
| 138 void ConvertUse(Value* use, Representation from); |
| 139 |
| 136 void InsertConversion(Representation from, | 140 void InsertConversion(Representation from, |
| 137 Representation to, | 141 Representation to, |
| 138 Value* use, | 142 Value* use, |
| 139 Instruction* insert_before, | 143 Instruction* insert_before, |
| 140 Instruction* deopt_target); | 144 Instruction* deopt_target); |
| 141 | 145 |
| 142 bool InstanceCallNeedsClassCheck(InstanceCallInstr* call) const; | 146 bool InstanceCallNeedsClassCheck(InstanceCallInstr* call) const; |
| 143 bool MethodExtractorNeedsClassCheck(InstanceCallInstr* call) const; | 147 bool MethodExtractorNeedsClassCheck(InstanceCallInstr* call) const; |
| 144 | 148 |
| 145 bool InlineFloat32x4Getter(InstanceCallInstr* call, | 149 bool InlineFloat32x4Getter(InstanceCallInstr* call, |
| (...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 363 // Optimize spill stores inside try-blocks by identifying values that always | 367 // Optimize spill stores inside try-blocks by identifying values that always |
| 364 // contain a single known constant at catch block entry. | 368 // contain a single known constant at catch block entry. |
| 365 class TryCatchAnalyzer : public AllStatic { | 369 class TryCatchAnalyzer : public AllStatic { |
| 366 public: | 370 public: |
| 367 static void Optimize(FlowGraph* flow_graph); | 371 static void Optimize(FlowGraph* flow_graph); |
| 368 }; | 372 }; |
| 369 | 373 |
| 370 } // namespace dart | 374 } // namespace dart |
| 371 | 375 |
| 372 #endif // VM_FLOW_GRAPH_OPTIMIZER_H_ | 376 #endif // VM_FLOW_GRAPH_OPTIMIZER_H_ |
| OLD | NEW |