| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 1367 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1378 d2i_instr = new DoubleToIntegerInstr(call->ArgumentAt(0)->value(), | 1378 d2i_instr = new DoubleToIntegerInstr(call->ArgumentAt(0)->value(), |
| 1379 call); | 1379 call); |
| 1380 } else { | 1380 } else { |
| 1381 // Optimistically assume result fits into Smi. | 1381 // Optimistically assume result fits into Smi. |
| 1382 d2i_instr = new DoubleToSmiInstr(call->ArgumentAt(0)->value(), call); | 1382 d2i_instr = new DoubleToSmiInstr(call->ArgumentAt(0)->value(), call); |
| 1383 } | 1383 } |
| 1384 call->ReplaceWith(d2i_instr, current_iterator()); | 1384 call->ReplaceWith(d2i_instr, current_iterator()); |
| 1385 RemovePushArguments(call); | 1385 RemovePushArguments(call); |
| 1386 return true; | 1386 return true; |
| 1387 } | 1387 } |
| 1388 // TODO(srdjan): C's modulo does not correspond to Dart's modulo. | 1388 case MethodRecognizer::kDoubleMod: |
| 1389 // Additional checks are required. | |
| 1390 // case MethodRecognizer::kDoubleMod: | |
| 1391 case MethodRecognizer::kDoublePow: | 1389 case MethodRecognizer::kDoublePow: |
| 1392 ReplaceWithMathCFunction(call, recognized_kind); | 1390 ReplaceWithMathCFunction(call, recognized_kind); |
| 1393 return true; | 1391 return true; |
| 1394 case MethodRecognizer::kDoubleTruncate: | 1392 case MethodRecognizer::kDoubleTruncate: |
| 1395 case MethodRecognizer::kDoubleRound: | 1393 case MethodRecognizer::kDoubleRound: |
| 1396 case MethodRecognizer::kDoubleFloor: | 1394 case MethodRecognizer::kDoubleFloor: |
| 1397 case MethodRecognizer::kDoubleCeil: | 1395 case MethodRecognizer::kDoubleCeil: |
| 1398 if (!CPUFeatures::double_truncate_round_supported()) { | 1396 if (!CPUFeatures::double_truncate_round_supported()) { |
| 1399 ReplaceWithMathCFunction(call, recognized_kind); | 1397 ReplaceWithMathCFunction(call, recognized_kind); |
| 1400 } else { | 1398 } else { |
| (...skipping 3209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4610 | 4608 |
| 4611 if (FLAG_trace_constant_propagation) { | 4609 if (FLAG_trace_constant_propagation) { |
| 4612 OS::Print("\n==== After constant propagation ====\n"); | 4610 OS::Print("\n==== After constant propagation ====\n"); |
| 4613 FlowGraphPrinter printer(*graph_); | 4611 FlowGraphPrinter printer(*graph_); |
| 4614 printer.PrintBlocks(); | 4612 printer.PrintBlocks(); |
| 4615 } | 4613 } |
| 4616 } | 4614 } |
| 4617 | 4615 |
| 4618 | 4616 |
| 4619 } // namespace dart | 4617 } // namespace dart |
| OLD | NEW |