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/globals.h" // Needed here to get TARGET_ARCH_ARM. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM. |
6 #if defined(TARGET_ARCH_ARM) | 6 #if defined(TARGET_ARCH_ARM) |
7 | 7 |
8 #include "vm/intermediate_language.h" | 8 #include "vm/intermediate_language.h" |
9 | 9 |
10 #include "vm/dart_entry.h" | 10 #include "vm/dart_entry.h" |
(...skipping 2590 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2601 } else { | 2601 } else { |
2602 __ orr(IP, left, ShifterOperand(right)); | 2602 __ orr(IP, left, ShifterOperand(right)); |
2603 __ tst(IP, ShifterOperand(kSmiTagMask)); | 2603 __ tst(IP, ShifterOperand(kSmiTagMask)); |
2604 } | 2604 } |
2605 __ b(deopt, EQ); | 2605 __ b(deopt, EQ); |
2606 } | 2606 } |
2607 | 2607 |
2608 | 2608 |
2609 LocationSummary* BoxDoubleInstr::MakeLocationSummary() const { | 2609 LocationSummary* BoxDoubleInstr::MakeLocationSummary() const { |
2610 const intptr_t kNumInputs = 1; | 2610 const intptr_t kNumInputs = 1; |
2611 const intptr_t kNumTemps = 0; | 2611 const intptr_t kNumTemps = 1; |
2612 LocationSummary* summary = | 2612 LocationSummary* summary = |
2613 new LocationSummary(kNumInputs, | 2613 new LocationSummary(kNumInputs, |
2614 kNumTemps, | 2614 kNumTemps, |
2615 LocationSummary::kCallOnSlowPath); | 2615 LocationSummary::kCallOnSlowPath); |
2616 summary->set_in(0, Location::RequiresFpuRegister()); | 2616 summary->set_in(0, Location::RequiresFpuRegister()); |
| 2617 summary->set_temp(0, Location::RequiresRegister()); |
2617 summary->set_out(Location::RequiresRegister()); | 2618 summary->set_out(Location::RequiresRegister()); |
2618 return summary; | 2619 return summary; |
2619 } | 2620 } |
2620 | 2621 |
2621 | 2622 |
2622 class BoxDoubleSlowPath : public SlowPathCode { | 2623 class BoxDoubleSlowPath : public SlowPathCode { |
2623 public: | 2624 public: |
2624 explicit BoxDoubleSlowPath(BoxDoubleInstr* instruction) | 2625 explicit BoxDoubleSlowPath(BoxDoubleInstr* instruction) |
2625 : instruction_(instruction) { } | 2626 : instruction_(instruction) { } |
2626 | 2627 |
(...skipping 26 matching lines...) Expand all Loading... |
2653 | 2654 |
2654 void BoxDoubleInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 2655 void BoxDoubleInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
2655 BoxDoubleSlowPath* slow_path = new BoxDoubleSlowPath(this); | 2656 BoxDoubleSlowPath* slow_path = new BoxDoubleSlowPath(this); |
2656 compiler->AddSlowPathCode(slow_path); | 2657 compiler->AddSlowPathCode(slow_path); |
2657 | 2658 |
2658 const Register out_reg = locs()->out().reg(); | 2659 const Register out_reg = locs()->out().reg(); |
2659 const DRegister value = EvenDRegisterOf(locs()->in(0).fpu_reg()); | 2660 const DRegister value = EvenDRegisterOf(locs()->in(0).fpu_reg()); |
2660 | 2661 |
2661 __ TryAllocate(compiler->double_class(), | 2662 __ TryAllocate(compiler->double_class(), |
2662 slow_path->entry_label(), | 2663 slow_path->entry_label(), |
2663 out_reg); | 2664 out_reg, |
| 2665 locs()->temp(0).reg()); |
2664 __ Bind(slow_path->exit_label()); | 2666 __ Bind(slow_path->exit_label()); |
2665 __ StoreDToOffset(value, out_reg, Double::value_offset() - kHeapObjectTag); | 2667 __ StoreDToOffset(value, out_reg, Double::value_offset() - kHeapObjectTag); |
2666 } | 2668 } |
2667 | 2669 |
2668 | 2670 |
2669 LocationSummary* UnboxDoubleInstr::MakeLocationSummary() const { | 2671 LocationSummary* UnboxDoubleInstr::MakeLocationSummary() const { |
2670 const intptr_t kNumInputs = 1; | 2672 const intptr_t kNumInputs = 1; |
2671 const intptr_t value_cid = value()->Type()->ToCid(); | 2673 const intptr_t value_cid = value()->Type()->ToCid(); |
2672 const bool needs_temp = ((value_cid != kSmiCid) && (value_cid != kDoubleCid)); | 2674 const bool needs_temp = ((value_cid != kSmiCid) && (value_cid != kDoubleCid)); |
2673 const bool needs_writable_input = (value_cid == kSmiCid); | 2675 const bool needs_writable_input = (value_cid == kSmiCid); |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2709 __ mov(IP, ShifterOperand(value, ASR, 1)); // Copy and untag. | 2711 __ mov(IP, ShifterOperand(value, ASR, 1)); // Copy and untag. |
2710 __ vmovsr(STMP, IP); | 2712 __ vmovsr(STMP, IP); |
2711 __ vcvtdi(result, STMP); | 2713 __ vcvtdi(result, STMP); |
2712 __ Bind(&done); | 2714 __ Bind(&done); |
2713 } | 2715 } |
2714 } | 2716 } |
2715 | 2717 |
2716 | 2718 |
2717 LocationSummary* BoxFloat32x4Instr::MakeLocationSummary() const { | 2719 LocationSummary* BoxFloat32x4Instr::MakeLocationSummary() const { |
2718 const intptr_t kNumInputs = 1; | 2720 const intptr_t kNumInputs = 1; |
2719 const intptr_t kNumTemps = 0; | 2721 const intptr_t kNumTemps = 1; |
2720 LocationSummary* summary = | 2722 LocationSummary* summary = |
2721 new LocationSummary(kNumInputs, | 2723 new LocationSummary(kNumInputs, |
2722 kNumTemps, | 2724 kNumTemps, |
2723 LocationSummary::kCallOnSlowPath); | 2725 LocationSummary::kCallOnSlowPath); |
2724 summary->set_in(0, Location::RequiresFpuRegister()); | 2726 summary->set_in(0, Location::RequiresFpuRegister()); |
| 2727 summary->set_temp(0, Location::RequiresRegister()); |
2725 summary->set_out(Location::RequiresRegister()); | 2728 summary->set_out(Location::RequiresRegister()); |
2726 return summary; | 2729 return summary; |
2727 } | 2730 } |
2728 | 2731 |
2729 | 2732 |
2730 class BoxFloat32x4SlowPath : public SlowPathCode { | 2733 class BoxFloat32x4SlowPath : public SlowPathCode { |
2731 public: | 2734 public: |
2732 explicit BoxFloat32x4SlowPath(BoxFloat32x4Instr* instruction) | 2735 explicit BoxFloat32x4SlowPath(BoxFloat32x4Instr* instruction) |
2733 : instruction_(instruction) { } | 2736 : instruction_(instruction) { } |
2734 | 2737 |
(...skipping 28 matching lines...) Expand all Loading... |
2763 BoxFloat32x4SlowPath* slow_path = new BoxFloat32x4SlowPath(this); | 2766 BoxFloat32x4SlowPath* slow_path = new BoxFloat32x4SlowPath(this); |
2764 compiler->AddSlowPathCode(slow_path); | 2767 compiler->AddSlowPathCode(slow_path); |
2765 | 2768 |
2766 Register out_reg = locs()->out().reg(); | 2769 Register out_reg = locs()->out().reg(); |
2767 QRegister value = locs()->in(0).fpu_reg(); | 2770 QRegister value = locs()->in(0).fpu_reg(); |
2768 DRegister value_even = EvenDRegisterOf(value); | 2771 DRegister value_even = EvenDRegisterOf(value); |
2769 DRegister value_odd = OddDRegisterOf(value); | 2772 DRegister value_odd = OddDRegisterOf(value); |
2770 | 2773 |
2771 __ TryAllocate(compiler->float32x4_class(), | 2774 __ TryAllocate(compiler->float32x4_class(), |
2772 slow_path->entry_label(), | 2775 slow_path->entry_label(), |
2773 out_reg); | 2776 out_reg, |
| 2777 locs()->temp(0).reg()); |
2774 __ Bind(slow_path->exit_label()); | 2778 __ Bind(slow_path->exit_label()); |
2775 | 2779 |
2776 __ StoreDToOffset(value_even, out_reg, | 2780 __ StoreDToOffset(value_even, out_reg, |
2777 Float32x4::value_offset() - kHeapObjectTag); | 2781 Float32x4::value_offset() - kHeapObjectTag); |
2778 __ StoreDToOffset(value_odd, out_reg, | 2782 __ StoreDToOffset(value_odd, out_reg, |
2779 Float32x4::value_offset() + 2*kWordSize - kHeapObjectTag); | 2783 Float32x4::value_offset() + 2*kWordSize - kHeapObjectTag); |
2780 } | 2784 } |
2781 | 2785 |
2782 | 2786 |
2783 LocationSummary* UnboxFloat32x4Instr::MakeLocationSummary() const { | 2787 LocationSummary* UnboxFloat32x4Instr::MakeLocationSummary() const { |
(...skipping 30 matching lines...) Expand all Loading... |
2814 const DRegister result_odd = OddDRegisterOf(result); | 2818 const DRegister result_odd = OddDRegisterOf(result); |
2815 __ LoadDFromOffset(result_even, value, | 2819 __ LoadDFromOffset(result_even, value, |
2816 Float32x4::value_offset() - kHeapObjectTag); | 2820 Float32x4::value_offset() - kHeapObjectTag); |
2817 __ LoadDFromOffset(result_odd, value, | 2821 __ LoadDFromOffset(result_odd, value, |
2818 Float32x4::value_offset() + 2*kWordSize - kHeapObjectTag); | 2822 Float32x4::value_offset() + 2*kWordSize - kHeapObjectTag); |
2819 } | 2823 } |
2820 | 2824 |
2821 | 2825 |
2822 LocationSummary* BoxInt32x4Instr::MakeLocationSummary() const { | 2826 LocationSummary* BoxInt32x4Instr::MakeLocationSummary() const { |
2823 const intptr_t kNumInputs = 1; | 2827 const intptr_t kNumInputs = 1; |
2824 const intptr_t kNumTemps = 0; | 2828 const intptr_t kNumTemps = 1; |
2825 LocationSummary* summary = | 2829 LocationSummary* summary = |
2826 new LocationSummary(kNumInputs, | 2830 new LocationSummary(kNumInputs, |
2827 kNumTemps, | 2831 kNumTemps, |
2828 LocationSummary::kCallOnSlowPath); | 2832 LocationSummary::kCallOnSlowPath); |
2829 summary->set_in(0, Location::RequiresFpuRegister()); | 2833 summary->set_in(0, Location::RequiresFpuRegister()); |
| 2834 summary->set_temp(0, Location::RequiresRegister()); |
2830 summary->set_out(Location::RequiresRegister()); | 2835 summary->set_out(Location::RequiresRegister()); |
2831 return summary; | 2836 return summary; |
2832 } | 2837 } |
2833 | 2838 |
2834 | 2839 |
2835 class BoxInt32x4SlowPath : public SlowPathCode { | 2840 class BoxInt32x4SlowPath : public SlowPathCode { |
2836 public: | 2841 public: |
2837 explicit BoxInt32x4SlowPath(BoxInt32x4Instr* instruction) | 2842 explicit BoxInt32x4SlowPath(BoxInt32x4Instr* instruction) |
2838 : instruction_(instruction) { } | 2843 : instruction_(instruction) { } |
2839 | 2844 |
(...skipping 28 matching lines...) Expand all Loading... |
2868 BoxInt32x4SlowPath* slow_path = new BoxInt32x4SlowPath(this); | 2873 BoxInt32x4SlowPath* slow_path = new BoxInt32x4SlowPath(this); |
2869 compiler->AddSlowPathCode(slow_path); | 2874 compiler->AddSlowPathCode(slow_path); |
2870 | 2875 |
2871 Register out_reg = locs()->out().reg(); | 2876 Register out_reg = locs()->out().reg(); |
2872 QRegister value = locs()->in(0).fpu_reg(); | 2877 QRegister value = locs()->in(0).fpu_reg(); |
2873 DRegister value_even = EvenDRegisterOf(value); | 2878 DRegister value_even = EvenDRegisterOf(value); |
2874 DRegister value_odd = OddDRegisterOf(value); | 2879 DRegister value_odd = OddDRegisterOf(value); |
2875 | 2880 |
2876 __ TryAllocate(compiler->int32x4_class(), | 2881 __ TryAllocate(compiler->int32x4_class(), |
2877 slow_path->entry_label(), | 2882 slow_path->entry_label(), |
2878 out_reg); | 2883 out_reg, |
| 2884 locs()->temp(0).reg()); |
2879 __ Bind(slow_path->exit_label()); | 2885 __ Bind(slow_path->exit_label()); |
2880 __ StoreDToOffset(value_even, out_reg, | 2886 __ StoreDToOffset(value_even, out_reg, |
2881 Int32x4::value_offset() - kHeapObjectTag); | 2887 Int32x4::value_offset() - kHeapObjectTag); |
2882 __ StoreDToOffset(value_odd, out_reg, | 2888 __ StoreDToOffset(value_odd, out_reg, |
2883 Int32x4::value_offset() + 2*kWordSize - kHeapObjectTag); | 2889 Int32x4::value_offset() + 2*kWordSize - kHeapObjectTag); |
2884 } | 2890 } |
2885 | 2891 |
2886 | 2892 |
2887 LocationSummary* UnboxInt32x4Instr::MakeLocationSummary() const { | 2893 LocationSummary* UnboxInt32x4Instr::MakeLocationSummary() const { |
2888 const intptr_t value_cid = value()->Type()->ToCid(); | 2894 const intptr_t value_cid = value()->Type()->ToCid(); |
(...skipping 1724 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4613 compiler->GenerateCall(token_pos(), | 4619 compiler->GenerateCall(token_pos(), |
4614 &label, | 4620 &label, |
4615 PcDescriptors::kOther, | 4621 PcDescriptors::kOther, |
4616 locs()); | 4622 locs()); |
4617 __ Drop(2); // Discard type arguments and receiver. | 4623 __ Drop(2); // Discard type arguments and receiver. |
4618 } | 4624 } |
4619 | 4625 |
4620 } // namespace dart | 4626 } // namespace dart |
4621 | 4627 |
4622 #endif // defined TARGET_ARCH_ARM | 4628 #endif // defined TARGET_ARCH_ARM |
OLD | NEW |