| 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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 void InferIntRanges(); | 57 void InferIntRanges(); |
| 58 | 58 |
| 59 void SelectIntegerInstructions(); | 59 void SelectIntegerInstructions(); |
| 60 | 60 |
| 61 void AnalyzeTryCatch(); | 61 void AnalyzeTryCatch(); |
| 62 | 62 |
| 63 bool TryInlineRecognizedMethod(intptr_t receiver_cid, | 63 bool TryInlineRecognizedMethod(intptr_t receiver_cid, |
| 64 const Function& target, | 64 const Function& target, |
| 65 Instruction* call, | 65 Instruction* call, |
| 66 Definition* receiver, | 66 Definition* receiver, |
| 67 intptr_t token_pos, | 67 TokenDescriptor token_pos, |
| 68 const ICData& ic_data, | 68 const ICData& ic_data, |
| 69 TargetEntryInstr** entry, | 69 TargetEntryInstr** entry, |
| 70 Definition** last); | 70 Definition** last); |
| 71 | 71 |
| 72 // Remove environments from the instructions which do not deoptimize. | 72 // Remove environments from the instructions which do not deoptimize. |
| 73 void EliminateEnvironments(); | 73 void EliminateEnvironments(); |
| 74 | 74 |
| 75 virtual void VisitStaticCall(StaticCallInstr* instr); | 75 virtual void VisitStaticCall(StaticCallInstr* instr); |
| 76 virtual void VisitInstanceCall(InstanceCallInstr* instr); | 76 virtual void VisitInstanceCall(InstanceCallInstr* instr); |
| 77 virtual void VisitStoreInstanceField(StoreInstanceFieldInstr* instr); | 77 virtual void VisitStoreInstanceField(StoreInstanceFieldInstr* instr); |
| (...skipping 12 matching lines...) Expand all Loading... |
| 90 bool TryCreateICData(InstanceCallInstr* call); | 90 bool TryCreateICData(InstanceCallInstr* call); |
| 91 const ICData& TrySpecializeICData(const ICData& ic_data, intptr_t cid); | 91 const ICData& TrySpecializeICData(const ICData& ic_data, intptr_t cid); |
| 92 | 92 |
| 93 void SpecializePolymorphicInstanceCall(PolymorphicInstanceCallInstr* call); | 93 void SpecializePolymorphicInstanceCall(PolymorphicInstanceCallInstr* call); |
| 94 | 94 |
| 95 bool TryReplaceWithIndexedOp(InstanceCallInstr* call); | 95 bool TryReplaceWithIndexedOp(InstanceCallInstr* call); |
| 96 bool InlineSetIndexed(MethodRecognizer::Kind kind, | 96 bool InlineSetIndexed(MethodRecognizer::Kind kind, |
| 97 const Function& target, | 97 const Function& target, |
| 98 Instruction* call, | 98 Instruction* call, |
| 99 Definition* receiver, | 99 Definition* receiver, |
| 100 intptr_t token_pos, | 100 TokenDescriptor token_pos, |
| 101 const ICData& value_check, | 101 const ICData& value_check, |
| 102 TargetEntryInstr** entry, | 102 TargetEntryInstr** entry, |
| 103 Definition** last); | 103 Definition** last); |
| 104 bool InlineGetIndexed(MethodRecognizer::Kind kind, | 104 bool InlineGetIndexed(MethodRecognizer::Kind kind, |
| 105 Instruction* call, | 105 Instruction* call, |
| 106 Definition* receiver, | 106 Definition* receiver, |
| 107 TargetEntryInstr** entry, | 107 TargetEntryInstr** entry, |
| 108 Definition** last); | 108 Definition** last); |
| 109 intptr_t PrepareInlineIndexedOp(Instruction* call, | 109 intptr_t PrepareInlineIndexedOp(Instruction* call, |
| 110 intptr_t array_cid, | 110 intptr_t array_cid, |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 194 // environment 'deopt_environment'. The check is inserted immediately | 194 // environment 'deopt_environment'. The check is inserted immediately |
| 195 // before 'insert_before'. | 195 // before 'insert_before'. |
| 196 void AddCheckClass(Definition* to_check, | 196 void AddCheckClass(Definition* to_check, |
| 197 const ICData& unary_checks, | 197 const ICData& unary_checks, |
| 198 intptr_t deopt_id, | 198 intptr_t deopt_id, |
| 199 Environment* deopt_environment, | 199 Environment* deopt_environment, |
| 200 Instruction* insert_before); | 200 Instruction* insert_before); |
| 201 Instruction* GetCheckClass(Definition* to_check, | 201 Instruction* GetCheckClass(Definition* to_check, |
| 202 const ICData& unary_checks, | 202 const ICData& unary_checks, |
| 203 intptr_t deopt_id, | 203 intptr_t deopt_id, |
| 204 intptr_t token_pos); | 204 TokenDescriptor token_pos); |
| 205 | 205 |
| 206 // Insert a Smi check if needed. | 206 // Insert a Smi check if needed. |
| 207 void AddCheckSmi(Definition* to_check, | 207 void AddCheckSmi(Definition* to_check, |
| 208 intptr_t deopt_id, | 208 intptr_t deopt_id, |
| 209 Environment* deopt_environment, | 209 Environment* deopt_environment, |
| 210 Instruction* insert_before); | 210 Instruction* insert_before); |
| 211 | 211 |
| 212 // Add a class check for a call's first argument immediately before the | 212 // Add a class check for a call's first argument immediately before the |
| 213 // call, using the call's IC data to determine the check, and the call's | 213 // call, using the call's IC data to determine the check, and the call's |
| 214 // deopt ID and deoptimization environment if the check fails. | 214 // deopt ID and deoptimization environment if the check fails. |
| (...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 447 // Optimize spill stores inside try-blocks by identifying values that always | 447 // Optimize spill stores inside try-blocks by identifying values that always |
| 448 // contain a single known constant at catch block entry. | 448 // contain a single known constant at catch block entry. |
| 449 class TryCatchAnalyzer : public AllStatic { | 449 class TryCatchAnalyzer : public AllStatic { |
| 450 public: | 450 public: |
| 451 static void Optimize(FlowGraph* flow_graph); | 451 static void Optimize(FlowGraph* flow_graph); |
| 452 }; | 452 }; |
| 453 | 453 |
| 454 } // namespace dart | 454 } // namespace dart |
| 455 | 455 |
| 456 #endif // VM_FLOW_GRAPH_OPTIMIZER_H_ | 456 #endif // VM_FLOW_GRAPH_OPTIMIZER_H_ |
| OLD | NEW |