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_AOT_OPTIMIZER_H_ | 5 #ifndef VM_AOT_OPTIMIZER_H_ |
6 #define VM_AOT_OPTIMIZER_H_ | 6 #define VM_AOT_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 30 matching lines...) Expand all Loading... |
41 // Use propagated class ids to optimize, replace or eliminate instructions. | 41 // Use propagated class ids to optimize, replace or eliminate instructions. |
42 void ApplyClassIds(); | 42 void ApplyClassIds(); |
43 | 43 |
44 // Optimize (a << b) & c pattern: if c is a positive Smi or zero, then the | 44 // Optimize (a << b) & c pattern: if c is a positive Smi or zero, then the |
45 // shift can be a truncating Smi shift-left and result is always Smi. | 45 // shift can be a truncating Smi shift-left and result is always Smi. |
46 // Merge instructions (only per basic-block). | 46 // Merge instructions (only per basic-block). |
47 void TryOptimizePatterns(); | 47 void TryOptimizePatterns(); |
48 | 48 |
49 virtual void VisitStaticCall(StaticCallInstr* instr); | 49 virtual void VisitStaticCall(StaticCallInstr* instr); |
50 virtual void VisitInstanceCall(InstanceCallInstr* instr); | 50 virtual void VisitInstanceCall(InstanceCallInstr* instr); |
51 virtual void VisitAllocateContext(AllocateContextInstr* instr); | |
52 virtual void VisitLoadCodeUnits(LoadCodeUnitsInstr* instr); | 51 virtual void VisitLoadCodeUnits(LoadCodeUnitsInstr* instr); |
53 | 52 |
54 void InsertBefore(Instruction* next, | 53 void InsertBefore(Instruction* next, |
55 Instruction* instr, | 54 Instruction* instr, |
56 Environment* env, | 55 Environment* env, |
57 FlowGraph::UseKind use_kind) { | 56 FlowGraph::UseKind use_kind) { |
58 flow_graph_->InsertBefore(next, instr, env, use_kind); | 57 flow_graph_->InsertBefore(next, instr, env, use_kind); |
59 } | 58 } |
60 | 59 |
61 private: | 60 private: |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 | 176 |
178 GrowableArray<intptr_t>* inlining_black_list_; | 177 GrowableArray<intptr_t>* inlining_black_list_; |
179 | 178 |
180 DISALLOW_COPY_AND_ASSIGN(AotOptimizer); | 179 DISALLOW_COPY_AND_ASSIGN(AotOptimizer); |
181 }; | 180 }; |
182 | 181 |
183 | 182 |
184 } // namespace dart | 183 } // namespace dart |
185 | 184 |
186 #endif // VM_AOT_OPTIMIZER_H_ | 185 #endif // VM_AOT_OPTIMIZER_H_ |
OLD | NEW |