| 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 28 matching lines...) Expand all Loading... |
| 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(); | 47 void AnalyzeTryCatch(); |
| 48 | 48 |
| 49 bool TryInlineRecognizedMethod(const Function& target, |
| 50 Instruction* call, |
| 51 const ICData& ic_data, |
| 52 TargetEntryInstr** entry, |
| 53 Definition** last); |
| 54 |
| 49 // Remove environments from the instructions which do not deoptimize. | 55 // Remove environments from the instructions which do not deoptimize. |
| 50 void EliminateEnvironments(); | 56 void EliminateEnvironments(); |
| 51 | 57 |
| 52 virtual void VisitStaticCall(StaticCallInstr* instr); | 58 virtual void VisitStaticCall(StaticCallInstr* instr); |
| 53 virtual void VisitInstanceCall(InstanceCallInstr* instr); | 59 virtual void VisitInstanceCall(InstanceCallInstr* instr); |
| 54 virtual void VisitEqualityCompare(EqualityCompareInstr* instr); | 60 virtual void VisitEqualityCompare(EqualityCompareInstr* instr); |
| 55 virtual void VisitBranch(BranchInstr* instr); | 61 virtual void VisitBranch(BranchInstr* instr); |
| 56 virtual void VisitStrictCompare(StrictCompareInstr* instr); | 62 virtual void VisitStrictCompare(StrictCompareInstr* instr); |
| 57 | 63 |
| 58 void InsertBefore(Instruction* next, | 64 void InsertBefore(Instruction* next, |
| (...skipping 11 matching lines...) Expand all Loading... |
| 70 | 76 |
| 71 intptr_t PrepareIndexedOp(InstanceCallInstr* call, | 77 intptr_t PrepareIndexedOp(InstanceCallInstr* call, |
| 72 intptr_t class_id, | 78 intptr_t class_id, |
| 73 Definition** array, | 79 Definition** array, |
| 74 Definition** index); | 80 Definition** index); |
| 75 bool TryReplaceWithStoreIndexed(InstanceCallInstr* call); | 81 bool TryReplaceWithStoreIndexed(InstanceCallInstr* call); |
| 76 void BuildStoreIndexed(InstanceCallInstr* call, | 82 void BuildStoreIndexed(InstanceCallInstr* call, |
| 77 const ICData& value_check, | 83 const ICData& value_check, |
| 78 intptr_t class_id); | 84 intptr_t class_id); |
| 79 bool TryReplaceWithLoadIndexed(InstanceCallInstr* call); | 85 bool TryReplaceWithLoadIndexed(InstanceCallInstr* call); |
| 86 bool TryInlineGetIndexed(MethodRecognizer::Kind kind, |
| 87 Instruction* call, |
| 88 const ICData& ic_data, |
| 89 TargetEntryInstr** entry, |
| 90 Definition** last); |
| 80 | 91 |
| 81 bool TryReplaceWithBinaryOp(InstanceCallInstr* call, Token::Kind op_kind); | 92 bool TryReplaceWithBinaryOp(InstanceCallInstr* call, Token::Kind op_kind); |
| 82 bool TryReplaceWithUnaryOp(InstanceCallInstr* call, Token::Kind op_kind); | 93 bool TryReplaceWithUnaryOp(InstanceCallInstr* call, Token::Kind op_kind); |
| 83 | 94 |
| 84 bool TryReplaceWithRelationalOp(InstanceCallInstr* call, Token::Kind op_kind); | 95 bool TryReplaceWithRelationalOp(InstanceCallInstr* call, Token::Kind op_kind); |
| 85 | 96 |
| 86 bool TryInlineInstanceGetter(InstanceCallInstr* call); | 97 bool TryInlineInstanceGetter(InstanceCallInstr* call); |
| 87 bool TryInlineInstanceSetter(InstanceCallInstr* call, | 98 bool TryInlineInstanceSetter(InstanceCallInstr* call, |
| 88 const ICData& unary_ic_data); | 99 const ICData& unary_ic_data); |
| 89 | 100 |
| (...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 365 // Optimize spill stores inside try-blocks by identifying values that always | 376 // Optimize spill stores inside try-blocks by identifying values that always |
| 366 // contain a single known constant at catch block entry. | 377 // contain a single known constant at catch block entry. |
| 367 class TryCatchAnalyzer : public AllStatic { | 378 class TryCatchAnalyzer : public AllStatic { |
| 368 public: | 379 public: |
| 369 static void Optimize(FlowGraph* flow_graph); | 380 static void Optimize(FlowGraph* flow_graph); |
| 370 }; | 381 }; |
| 371 | 382 |
| 372 } // namespace dart | 383 } // namespace dart |
| 373 | 384 |
| 374 #endif // VM_FLOW_GRAPH_OPTIMIZER_H_ | 385 #endif // VM_FLOW_GRAPH_OPTIMIZER_H_ |
| OLD | NEW |