Chromium Code Reviews| 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 #include "vm/flow_graph_optimizer.h" | 5 #include "vm/flow_graph_optimizer.h" |
| 6 | 6 |
| 7 #include "vm/bit_vector.h" | 7 #include "vm/bit_vector.h" |
| 8 #include "vm/cha.h" | 8 #include "vm/cha.h" |
| 9 #include "vm/flow_graph_builder.h" | 9 #include "vm/flow_graph_builder.h" |
| 10 #include "vm/flow_graph_compiler.h" | 10 #include "vm/flow_graph_compiler.h" |
| (...skipping 1293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1304 } else { | 1304 } else { |
| 1305 // Optimistically assume result fits into Smi. | 1305 // Optimistically assume result fits into Smi. |
| 1306 d2i_instr = new DoubleToSmiInstr(call->ArgumentAt(0)->value(), call); | 1306 d2i_instr = new DoubleToSmiInstr(call->ArgumentAt(0)->value(), call); |
| 1307 } | 1307 } |
| 1308 call->ReplaceWith(d2i_instr, current_iterator()); | 1308 call->ReplaceWith(d2i_instr, current_iterator()); |
| 1309 RemovePushArguments(call); | 1309 RemovePushArguments(call); |
| 1310 return true; | 1310 return true; |
| 1311 } | 1311 } |
| 1312 if ((recognized_kind == MethodRecognizer::kDoubleTruncate) || | 1312 if ((recognized_kind == MethodRecognizer::kDoubleTruncate) || |
| 1313 (recognized_kind == MethodRecognizer::kDoubleRound)) { | 1313 (recognized_kind == MethodRecognizer::kDoubleRound)) { |
| 1314 #if defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64) | |
|
srdjan
2013/01/16 19:06:30
Instead of ifdef, use a shared e.g., SuportsDoubl
regis
2013/01/16 23:14:42
As soon as we implement the arm version, there wil
srdjan
2013/01/16 23:57:56
I think that the optimizer will remain machine ind
regis
2013/01/17 01:02:07
Alright. I have added a double_truncate_round_supp
| |
| 1315 // TODO(regis): FlowGraphOptimizer should be architecture dependent. | |
| 1314 if (!CPUFeatures::sse4_1_supported()) { | 1316 if (!CPUFeatures::sse4_1_supported()) { |
| 1315 return false; | 1317 return false; |
| 1316 } | 1318 } |
| 1319 #else | |
| 1320 return false; | |
| 1321 #endif | |
| 1317 AddCheckClass(call, call->ArgumentAt(0)->value()->Copy()); | 1322 AddCheckClass(call, call->ArgumentAt(0)->value()->Copy()); |
| 1318 DoubleToDoubleInstr* d2d_instr = | 1323 DoubleToDoubleInstr* d2d_instr = |
| 1319 new DoubleToDoubleInstr(call->ArgumentAt(0)->value(), | 1324 new DoubleToDoubleInstr(call->ArgumentAt(0)->value(), |
| 1320 call, | 1325 call, |
| 1321 recognized_kind); | 1326 recognized_kind); |
| 1322 call->ReplaceWith(d2d_instr, current_iterator()); | 1327 call->ReplaceWith(d2d_instr, current_iterator()); |
| 1323 RemovePushArguments(call); | 1328 RemovePushArguments(call); |
| 1324 return true; | 1329 return true; |
| 1325 } | 1330 } |
| 1326 } | 1331 } |
| (...skipping 3172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4499 | 4504 |
| 4500 if (FLAG_trace_constant_propagation) { | 4505 if (FLAG_trace_constant_propagation) { |
| 4501 OS::Print("\n==== After constant propagation ====\n"); | 4506 OS::Print("\n==== After constant propagation ====\n"); |
| 4502 FlowGraphPrinter printer(*graph_); | 4507 FlowGraphPrinter printer(*graph_); |
| 4503 printer.PrintBlocks(); | 4508 printer.PrintBlocks(); |
| 4504 } | 4509 } |
| 4505 } | 4510 } |
| 4506 | 4511 |
| 4507 | 4512 |
| 4508 } // namespace dart | 4513 } // namespace dart |
| OLD | NEW |