| 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 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 MethodRecognizer::Kind recognized_kind); | 113 MethodRecognizer::Kind recognized_kind); |
| 114 bool TryInlineInt32x4Constructor(StaticCallInstr* call, | 114 bool TryInlineInt32x4Constructor(StaticCallInstr* call, |
| 115 MethodRecognizer::Kind recognized_kind); | 115 MethodRecognizer::Kind recognized_kind); |
| 116 bool TryInlineFloat32x4Method(InstanceCallInstr* call, | 116 bool TryInlineFloat32x4Method(InstanceCallInstr* call, |
| 117 MethodRecognizer::Kind recognized_kind); | 117 MethodRecognizer::Kind recognized_kind); |
| 118 bool TryInlineInt32x4Method(InstanceCallInstr* call, | 118 bool TryInlineInt32x4Method(InstanceCallInstr* call, |
| 119 MethodRecognizer::Kind recognized_kind); | 119 MethodRecognizer::Kind recognized_kind); |
| 120 void ReplaceWithInstanceOf(InstanceCallInstr* instr); | 120 void ReplaceWithInstanceOf(InstanceCallInstr* instr); |
| 121 void ReplaceWithTypeCast(InstanceCallInstr* instr); | 121 void ReplaceWithTypeCast(InstanceCallInstr* instr); |
| 122 | 122 |
| 123 LoadIndexedInstr* BuildStringCodeUnitAt(InstanceCallInstr* call, | 123 bool TryReplaceInstanceCallWithInline(InstanceCallInstr* call); |
| 124 intptr_t cid); | 124 |
| 125 Definition* PrepareInlineStringIndexOp(Instruction* call, |
| 126 intptr_t cid, |
| 127 Definition* str, |
| 128 Definition* index, |
| 129 Instruction* cursor); |
| 130 |
| 131 bool InlineStringCodeUnitAt(Instruction* call, |
| 132 intptr_t cid, |
| 133 TargetEntryInstr** entry, |
| 134 Definition** last); |
| 135 |
| 136 bool InlineStringBaseCharAt(Instruction* call, |
| 137 intptr_t cid, |
| 138 TargetEntryInstr** entry, |
| 139 Definition** last); |
| 125 | 140 |
| 126 bool InlineByteArrayViewLoad(Instruction* call, | 141 bool InlineByteArrayViewLoad(Instruction* call, |
| 127 Definition* receiver, | 142 Definition* receiver, |
| 128 intptr_t array_cid, | 143 intptr_t array_cid, |
| 129 intptr_t view_cid, | 144 intptr_t view_cid, |
| 130 const ICData& ic_data, | 145 const ICData& ic_data, |
| 131 TargetEntryInstr** entry, | 146 TargetEntryInstr** entry, |
| 132 Definition** last); | 147 Definition** last); |
| 133 | 148 |
| 134 bool InlineByteArrayViewStore(const Function& target, | 149 bool InlineByteArrayViewStore(const Function& target, |
| 135 Instruction* call, | 150 Instruction* call, |
| 136 Definition* receiver, | 151 Definition* receiver, |
| 137 intptr_t array_cid, | 152 intptr_t array_cid, |
| 138 intptr_t view_cid, | 153 intptr_t view_cid, |
| 139 const ICData& ic_data, | 154 const ICData& ic_data, |
| 140 TargetEntryInstr** entry, | 155 TargetEntryInstr** entry, |
| 141 Definition** last); | 156 Definition** last); |
| 142 | 157 |
| 143 intptr_t PrepareInlineByteArrayViewOp(Instruction* call, | 158 intptr_t PrepareInlineByteArrayViewOp(Instruction* call, |
| 144 intptr_t array_cid, | 159 intptr_t array_cid, |
| 145 intptr_t view_cid, | 160 intptr_t view_cid, |
| 146 Definition** array, | 161 Definition** array, |
| 147 Definition* index, | 162 Definition* index, |
| 148 Instruction** cursor); | 163 Instruction** cursor); |
| 149 | 164 |
| 150 bool BuildByteArrayViewLoad(InstanceCallInstr* call, | 165 bool BuildByteArrayViewLoad(InstanceCallInstr* call, |
| 151 intptr_t view_cid); | 166 intptr_t view_cid); |
| 152 bool BuildByteArrayViewStore(InstanceCallInstr* call, | 167 bool BuildByteArrayViewStore(InstanceCallInstr* call, |
| 153 intptr_t view_cid); | 168 intptr_t view_cid); |
| 154 void PrepareByteArrayViewOp(InstanceCallInstr* call, | |
| 155 intptr_t receiver_cid, | |
| 156 intptr_t view_cid, | |
| 157 Definition** array); | |
| 158 | 169 |
| 159 // Insert a check of 'to_check' determined by 'unary_checks'. If the | 170 // Insert a check of 'to_check' determined by 'unary_checks'. If the |
| 160 // check fails it will deoptimize to 'deopt_id' using the deoptimization | 171 // check fails it will deoptimize to 'deopt_id' using the deoptimization |
| 161 // environment 'deopt_environment'. The check is inserted immediately | 172 // environment 'deopt_environment'. The check is inserted immediately |
| 162 // before 'insert_before'. | 173 // before 'insert_before'. |
| 163 void AddCheckClass(Definition* to_check, | 174 void AddCheckClass(Definition* to_check, |
| 164 const ICData& unary_checks, | 175 const ICData& unary_checks, |
| 165 intptr_t deopt_id, | 176 intptr_t deopt_id, |
| 166 Environment* deopt_environment, | 177 Environment* deopt_environment, |
| 167 Instruction* insert_before); | 178 Instruction* insert_before); |
| (...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 398 // Optimize spill stores inside try-blocks by identifying values that always | 409 // Optimize spill stores inside try-blocks by identifying values that always |
| 399 // contain a single known constant at catch block entry. | 410 // contain a single known constant at catch block entry. |
| 400 class TryCatchAnalyzer : public AllStatic { | 411 class TryCatchAnalyzer : public AllStatic { |
| 401 public: | 412 public: |
| 402 static void Optimize(FlowGraph* flow_graph); | 413 static void Optimize(FlowGraph* flow_graph); |
| 403 }; | 414 }; |
| 404 | 415 |
| 405 } // namespace dart | 416 } // namespace dart |
| 406 | 417 |
| 407 #endif // VM_FLOW_GRAPH_OPTIMIZER_H_ | 418 #endif // VM_FLOW_GRAPH_OPTIMIZER_H_ |
| OLD | NEW |