| 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 1569 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1580 d2i_instr = new DoubleToIntegerInstr(new Value(input), call); | 1580 d2i_instr = new DoubleToIntegerInstr(new Value(input), call); |
| 1581 } else { | 1581 } else { |
| 1582 // Optimistically assume result fits into Smi. | 1582 // Optimistically assume result fits into Smi. |
| 1583 d2i_instr = new DoubleToSmiInstr(new Value(input), call); | 1583 d2i_instr = new DoubleToSmiInstr(new Value(input), call); |
| 1584 } | 1584 } |
| 1585 ReplaceCall(call, d2i_instr); | 1585 ReplaceCall(call, d2i_instr); |
| 1586 return true; | 1586 return true; |
| 1587 } | 1587 } |
| 1588 case MethodRecognizer::kDoubleMod: | 1588 case MethodRecognizer::kDoubleMod: |
| 1589 case MethodRecognizer::kDoublePow: | 1589 case MethodRecognizer::kDoublePow: |
| 1590 case MethodRecognizer::kDoubleRound: |
| 1590 ReplaceWithMathCFunction(call, recognized_kind); | 1591 ReplaceWithMathCFunction(call, recognized_kind); |
| 1591 return true; | 1592 return true; |
| 1592 case MethodRecognizer::kDoubleTruncate: | 1593 case MethodRecognizer::kDoubleTruncate: |
| 1593 case MethodRecognizer::kDoubleRound: | |
| 1594 case MethodRecognizer::kDoubleFloor: | 1594 case MethodRecognizer::kDoubleFloor: |
| 1595 case MethodRecognizer::kDoubleCeil: | 1595 case MethodRecognizer::kDoubleCeil: |
| 1596 if (!CPUFeatures::double_truncate_round_supported()) { | 1596 if (!CPUFeatures::double_truncate_round_supported()) { |
| 1597 ReplaceWithMathCFunction(call, recognized_kind); | 1597 ReplaceWithMathCFunction(call, recognized_kind); |
| 1598 } else { | 1598 } else { |
| 1599 AddReceiverCheck(call); | 1599 AddReceiverCheck(call); |
| 1600 DoubleToDoubleInstr* d2d_instr = | 1600 DoubleToDoubleInstr* d2d_instr = |
| 1601 new DoubleToDoubleInstr(new Value(call->ArgumentAt(0)), | 1601 new DoubleToDoubleInstr(new Value(call->ArgumentAt(0)), |
| 1602 call, | 1602 call, |
| 1603 recognized_kind); | 1603 recognized_kind); |
| (...skipping 2773 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4377 | 4377 |
| 4378 if (FLAG_trace_constant_propagation) { | 4378 if (FLAG_trace_constant_propagation) { |
| 4379 OS::Print("\n==== After constant propagation ====\n"); | 4379 OS::Print("\n==== After constant propagation ====\n"); |
| 4380 FlowGraphPrinter printer(*graph_); | 4380 FlowGraphPrinter printer(*graph_); |
| 4381 printer.PrintBlocks(); | 4381 printer.PrintBlocks(); |
| 4382 } | 4382 } |
| 4383 } | 4383 } |
| 4384 | 4384 |
| 4385 | 4385 |
| 4386 } // namespace dart | 4386 } // namespace dart |
| OLD | NEW |