| 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 21 matching lines...) Expand all Loading... |
| 32 // Optimize (a << b) & c pattern: if c is a positive Smi or zero, then the | 32 // Optimize (a << b) & c pattern: if c is a positive Smi or zero, then the |
| 33 // shift can be a truncating Smi shift-left and result is always Smi. | 33 // shift can be a truncating Smi shift-left and result is always Smi. |
| 34 void TryOptimizeLeftShiftWithBitAndPattern(); | 34 void TryOptimizeLeftShiftWithBitAndPattern(); |
| 35 | 35 |
| 36 void Canonicalize(); | 36 void Canonicalize(); |
| 37 | 37 |
| 38 void EliminateDeadPhis(); | 38 void EliminateDeadPhis(); |
| 39 | 39 |
| 40 void SelectRepresentations(); | 40 void SelectRepresentations(); |
| 41 | 41 |
| 42 void PropagateSminess(); | |
| 43 | |
| 44 void InferSmiRanges(); | 42 void InferSmiRanges(); |
| 45 | 43 |
| 46 virtual void VisitStaticCall(StaticCallInstr* instr); | 44 virtual void VisitStaticCall(StaticCallInstr* instr); |
| 47 virtual void VisitInstanceCall(InstanceCallInstr* instr); | 45 virtual void VisitInstanceCall(InstanceCallInstr* instr); |
| 48 virtual void VisitRelationalOp(RelationalOpInstr* instr); | 46 virtual void VisitRelationalOp(RelationalOpInstr* instr); |
| 49 virtual void VisitEqualityCompare(EqualityCompareInstr* instr); | 47 virtual void VisitEqualityCompare(EqualityCompareInstr* instr); |
| 50 virtual void VisitBranch(BranchInstr* instr); | 48 virtual void VisitBranch(BranchInstr* instr); |
| 51 virtual void VisitStrictCompare(StrictCompareInstr* instr); | 49 virtual void VisitStrictCompare(StrictCompareInstr* instr); |
| 50 virtual void VisitStoreInstanceField(StoreInstanceFieldInstr* instr); |
| 52 | 51 |
| 53 void InsertBefore(Instruction* next, | 52 void InsertBefore(Instruction* next, |
| 54 Instruction* instr, | 53 Instruction* instr, |
| 55 Environment* env, | 54 Environment* env, |
| 56 Definition::UseKind use_kind) { | 55 Definition::UseKind use_kind) { |
| 57 flow_graph_->InsertBefore(next, instr, env, use_kind); | 56 flow_graph_->InsertBefore(next, instr, env, use_kind); |
| 58 } | 57 } |
| 59 | 58 |
| 60 private: | 59 private: |
| 61 // Attempt to build ICData for call using propagated class-ids. | 60 // Attempt to build ICData for call using propagated class-ids. |
| (...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 291 // inputs. | 290 // inputs. |
| 292 static BranchInstr* CloneBranch(BranchInstr* branch, | 291 static BranchInstr* CloneBranch(BranchInstr* branch, |
| 293 Value* left, | 292 Value* left, |
| 294 Value* right); | 293 Value* right); |
| 295 }; | 294 }; |
| 296 | 295 |
| 297 | 296 |
| 298 } // namespace dart | 297 } // namespace dart |
| 299 | 298 |
| 300 #endif // VM_FLOW_GRAPH_OPTIMIZER_H_ | 299 #endif // VM_FLOW_GRAPH_OPTIMIZER_H_ |
| OLD | NEW |