| 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/intermediate_language.h" | 5 #include "vm/intermediate_language.h" |
| 6 | 6 |
| 7 #include "vm/bit_vector.h" | 7 #include "vm/bit_vector.h" |
| 8 #include "vm/dart_entry.h" | 8 #include "vm/dart_entry.h" |
| 9 #include "vm/flow_graph_allocator.h" | 9 #include "vm/flow_graph_allocator.h" |
| 10 #include "vm/flow_graph_builder.h" | 10 #include "vm/flow_graph_builder.h" |
| (...skipping 1532 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1543 RawAbstractType* DoubleToSmiInstr::CompileType() const { | 1543 RawAbstractType* DoubleToSmiInstr::CompileType() const { |
| 1544 return Type::SmiType(); | 1544 return Type::SmiType(); |
| 1545 } | 1545 } |
| 1546 | 1546 |
| 1547 | 1547 |
| 1548 RawAbstractType* DoubleToDoubleInstr::CompileType() const { | 1548 RawAbstractType* DoubleToDoubleInstr::CompileType() const { |
| 1549 return Type::Double(); | 1549 return Type::Double(); |
| 1550 } | 1550 } |
| 1551 | 1551 |
| 1552 | 1552 |
| 1553 RawAbstractType* InvokeMathCFunctionInstr::CompileType() const { | |
| 1554 return Type::Double(); | |
| 1555 } | |
| 1556 | |
| 1557 | |
| 1558 RawAbstractType* CheckClassInstr::CompileType() const { | 1553 RawAbstractType* CheckClassInstr::CompileType() const { |
| 1559 return AbstractType::null(); | 1554 return AbstractType::null(); |
| 1560 } | 1555 } |
| 1561 | 1556 |
| 1562 | 1557 |
| 1563 RawAbstractType* CheckSmiInstr::CompileType() const { | 1558 RawAbstractType* CheckSmiInstr::CompileType() const { |
| 1564 return AbstractType::null(); | 1559 return AbstractType::null(); |
| 1565 } | 1560 } |
| 1566 | 1561 |
| 1567 | 1562 |
| (...skipping 1046 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2614 case kFloat64ArrayCid: | 2609 case kFloat64ArrayCid: |
| 2615 case kFloat32ArrayCid: | 2610 case kFloat32ArrayCid: |
| 2616 case kExternalUint8ArrayCid: | 2611 case kExternalUint8ArrayCid: |
| 2617 return ByteArray::length_offset(); | 2612 return ByteArray::length_offset(); |
| 2618 default: | 2613 default: |
| 2619 UNREACHABLE(); | 2614 UNREACHABLE(); |
| 2620 return -1; | 2615 return -1; |
| 2621 } | 2616 } |
| 2622 } | 2617 } |
| 2623 | 2618 |
| 2624 | |
| 2625 intptr_t InvokeMathCFunctionInstr::ArgumentCountFor( | |
| 2626 MethodRecognizer::Kind kind) { | |
| 2627 switch (kind) { | |
| 2628 case MethodRecognizer::kDoubleTruncate: | |
| 2629 case MethodRecognizer::kDoubleRound: | |
| 2630 case MethodRecognizer::kDoubleFloor: | |
| 2631 case MethodRecognizer::kDoubleCeil: { | |
| 2632 ASSERT(!CPUFeatures::double_truncate_round_supported()); | |
| 2633 return 1; | |
| 2634 } | |
| 2635 case MethodRecognizer::kDoublePow: | |
| 2636 return 2; | |
| 2637 default: | |
| 2638 UNREACHABLE(); | |
| 2639 } | |
| 2640 return 0; | |
| 2641 } | |
| 2642 | |
| 2643 | |
| 2644 extern const RuntimeEntry kPowRuntimeEntry( | |
| 2645 "libc_pow", reinterpret_cast<RuntimeFunction>(&pow), 0, true); | |
| 2646 | |
| 2647 extern const RuntimeEntry kFloorRuntimeEntry( | |
| 2648 "libc_floor", reinterpret_cast<RuntimeFunction>(&floor), 0, true); | |
| 2649 | |
| 2650 extern const RuntimeEntry kCeilRuntimeEntry( | |
| 2651 "libc_ceil", reinterpret_cast<RuntimeFunction>(&ceil), 0, true); | |
| 2652 | |
| 2653 extern const RuntimeEntry kTruncRuntimeEntry( | |
| 2654 "libc_trunc", reinterpret_cast<RuntimeFunction>(&trunc), 0, true); | |
| 2655 | |
| 2656 extern const RuntimeEntry kRoundRuntimeEntry( | |
| 2657 "libc_round", reinterpret_cast<RuntimeFunction>(&round), 0, true); | |
| 2658 | |
| 2659 | |
| 2660 const RuntimeEntry& InvokeMathCFunctionInstr::TargetFunction() const { | |
| 2661 switch (recognized_kind_) { | |
| 2662 case MethodRecognizer::kDoubleTruncate: | |
| 2663 return kTruncRuntimeEntry; | |
| 2664 case MethodRecognizer::kDoubleRound: | |
| 2665 return kRoundRuntimeEntry; | |
| 2666 case MethodRecognizer::kDoubleFloor: | |
| 2667 return kFloorRuntimeEntry; | |
| 2668 case MethodRecognizer::kDoubleCeil: | |
| 2669 return kCeilRuntimeEntry; | |
| 2670 case MethodRecognizer::kDoublePow: | |
| 2671 return kPowRuntimeEntry; | |
| 2672 default: | |
| 2673 UNREACHABLE(); | |
| 2674 } | |
| 2675 return kPowRuntimeEntry; | |
| 2676 } | |
| 2677 | |
| 2678 | |
| 2679 #undef __ | 2619 #undef __ |
| 2680 | 2620 |
| 2681 } // namespace dart | 2621 } // namespace dart |
| OLD | NEW |