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 1648 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1659 DRegister value = EvenDRegisterOf(locs()->in(1).fpu_reg()); | 1659 DRegister value = EvenDRegisterOf(locs()->in(1).fpu_reg()); |
1660 Register temp = locs()->temp(0).reg(); | 1660 Register temp = locs()->temp(0).reg(); |
1661 Register temp2 = locs()->temp(1).reg(); | 1661 Register temp2 = locs()->temp(1).reg(); |
1662 | 1662 |
1663 if (is_initialization_) { | 1663 if (is_initialization_) { |
1664 StoreInstanceFieldSlowPath* slow_path = | 1664 StoreInstanceFieldSlowPath* slow_path = |
1665 new StoreInstanceFieldSlowPath(this); | 1665 new StoreInstanceFieldSlowPath(this); |
1666 compiler->AddSlowPathCode(slow_path); | 1666 compiler->AddSlowPathCode(slow_path); |
1667 __ TryAllocate(compiler->double_class(), | 1667 __ TryAllocate(compiler->double_class(), |
1668 slow_path->entry_label(), | 1668 slow_path->entry_label(), |
1669 temp); | 1669 temp, |
| 1670 temp2); |
1670 __ Bind(slow_path->exit_label()); | 1671 __ Bind(slow_path->exit_label()); |
1671 __ MoveRegister(temp2, temp); | 1672 __ MoveRegister(temp2, temp); |
1672 __ StoreIntoObject(instance_reg, | 1673 __ StoreIntoObject(instance_reg, |
1673 FieldAddress(instance_reg, field().Offset()), | 1674 FieldAddress(instance_reg, field().Offset()), |
1674 temp2); | 1675 temp2); |
1675 } else { | 1676 } else { |
1676 __ ldr(temp, FieldAddress(instance_reg, field().Offset())); | 1677 __ ldr(temp, FieldAddress(instance_reg, field().Offset())); |
1677 } | 1678 } |
1678 __ StoreDToOffset(value, temp, Double::value_offset() - kHeapObjectTag); | 1679 __ StoreDToOffset(value, temp, Double::value_offset() - kHeapObjectTag); |
1679 return; | 1680 return; |
(...skipping 26 matching lines...) Expand all Loading... |
1706 new StoreInstanceFieldSlowPath(this); | 1707 new StoreInstanceFieldSlowPath(this); |
1707 compiler->AddSlowPathCode(slow_path); | 1708 compiler->AddSlowPathCode(slow_path); |
1708 | 1709 |
1709 if (!compiler->is_optimizing()) { | 1710 if (!compiler->is_optimizing()) { |
1710 locs()->live_registers()->Add(locs()->in(0)); | 1711 locs()->live_registers()->Add(locs()->in(0)); |
1711 locs()->live_registers()->Add(locs()->in(1)); | 1712 locs()->live_registers()->Add(locs()->in(1)); |
1712 } | 1713 } |
1713 | 1714 |
1714 __ TryAllocate(compiler->double_class(), | 1715 __ TryAllocate(compiler->double_class(), |
1715 slow_path->entry_label(), | 1716 slow_path->entry_label(), |
1716 temp); | 1717 temp, |
| 1718 temp2); |
1717 __ Bind(slow_path->exit_label()); | 1719 __ Bind(slow_path->exit_label()); |
1718 __ MoveRegister(temp2, temp); | 1720 __ MoveRegister(temp2, temp); |
1719 __ StoreIntoObject(instance_reg, | 1721 __ StoreIntoObject(instance_reg, |
1720 FieldAddress(instance_reg, field().Offset()), | 1722 FieldAddress(instance_reg, field().Offset()), |
1721 temp2); | 1723 temp2); |
1722 __ Bind(©_payload); | 1724 __ Bind(©_payload); |
1723 __ LoadDFromOffset(fpu_temp, | 1725 __ LoadDFromOffset(fpu_temp, |
1724 value_reg, | 1726 value_reg, |
1725 Double::value_offset() - kHeapObjectTag); | 1727 Double::value_offset() - kHeapObjectTag); |
1726 __ StoreDToOffset(fpu_temp, temp, Double::value_offset() - kHeapObjectTag); | 1728 __ StoreDToOffset(fpu_temp, temp, Double::value_offset() - kHeapObjectTag); |
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1956 | 1958 |
1957 BoxDoubleSlowPath* slow_path = new BoxDoubleSlowPath(this); | 1959 BoxDoubleSlowPath* slow_path = new BoxDoubleSlowPath(this); |
1958 compiler->AddSlowPathCode(slow_path); | 1960 compiler->AddSlowPathCode(slow_path); |
1959 | 1961 |
1960 if (!compiler->is_optimizing()) { | 1962 if (!compiler->is_optimizing()) { |
1961 locs()->live_registers()->Add(locs()->in(0)); | 1963 locs()->live_registers()->Add(locs()->in(0)); |
1962 } | 1964 } |
1963 | 1965 |
1964 __ TryAllocate(compiler->double_class(), | 1966 __ TryAllocate(compiler->double_class(), |
1965 slow_path->entry_label(), | 1967 slow_path->entry_label(), |
1966 result_reg); | 1968 result_reg, |
| 1969 temp); |
1967 __ Bind(slow_path->exit_label()); | 1970 __ Bind(slow_path->exit_label()); |
1968 __ ldr(temp, FieldAddress(instance_reg, offset_in_bytes())); | 1971 __ ldr(temp, FieldAddress(instance_reg, offset_in_bytes())); |
1969 __ LoadDFromOffset(value, temp, Double::value_offset() - kHeapObjectTag); | 1972 __ LoadDFromOffset(value, temp, Double::value_offset() - kHeapObjectTag); |
1970 __ StoreDToOffset(value, | 1973 __ StoreDToOffset(value, |
1971 result_reg, | 1974 result_reg, |
1972 Double::value_offset() - kHeapObjectTag); | 1975 Double::value_offset() - kHeapObjectTag); |
1973 __ b(&done); | 1976 __ b(&done); |
1974 __ Bind(&load_pointer); | 1977 __ Bind(&load_pointer); |
1975 } | 1978 } |
1976 __ LoadFromOffset(kWord, result_reg, | 1979 __ LoadFromOffset(kWord, result_reg, |
(...skipping 795 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2772 } else { | 2775 } else { |
2773 __ orr(IP, left, ShifterOperand(right)); | 2776 __ orr(IP, left, ShifterOperand(right)); |
2774 __ tst(IP, ShifterOperand(kSmiTagMask)); | 2777 __ tst(IP, ShifterOperand(kSmiTagMask)); |
2775 } | 2778 } |
2776 __ b(deopt, EQ); | 2779 __ b(deopt, EQ); |
2777 } | 2780 } |
2778 | 2781 |
2779 | 2782 |
2780 LocationSummary* BoxDoubleInstr::MakeLocationSummary(bool opt) const { | 2783 LocationSummary* BoxDoubleInstr::MakeLocationSummary(bool opt) const { |
2781 const intptr_t kNumInputs = 1; | 2784 const intptr_t kNumInputs = 1; |
2782 const intptr_t kNumTemps = 0; | 2785 const intptr_t kNumTemps = 1; |
2783 LocationSummary* summary = | 2786 LocationSummary* summary = |
2784 new LocationSummary(kNumInputs, | 2787 new LocationSummary(kNumInputs, |
2785 kNumTemps, | 2788 kNumTemps, |
2786 LocationSummary::kCallOnSlowPath); | 2789 LocationSummary::kCallOnSlowPath); |
2787 summary->set_in(0, Location::RequiresFpuRegister()); | 2790 summary->set_in(0, Location::RequiresFpuRegister()); |
| 2791 summary->set_temp(0, Location::RequiresRegister()); |
2788 summary->set_out(Location::RequiresRegister()); | 2792 summary->set_out(Location::RequiresRegister()); |
2789 return summary; | 2793 return summary; |
2790 } | 2794 } |
2791 | 2795 |
2792 | 2796 |
2793 void BoxDoubleInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 2797 void BoxDoubleInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
2794 BoxDoubleSlowPath* slow_path = new BoxDoubleSlowPath(this); | 2798 BoxDoubleSlowPath* slow_path = new BoxDoubleSlowPath(this); |
2795 compiler->AddSlowPathCode(slow_path); | 2799 compiler->AddSlowPathCode(slow_path); |
2796 | 2800 |
2797 const Register out_reg = locs()->out().reg(); | 2801 const Register out_reg = locs()->out().reg(); |
2798 const DRegister value = EvenDRegisterOf(locs()->in(0).fpu_reg()); | 2802 const DRegister value = EvenDRegisterOf(locs()->in(0).fpu_reg()); |
2799 | 2803 |
2800 __ TryAllocate(compiler->double_class(), | 2804 __ TryAllocate(compiler->double_class(), |
2801 slow_path->entry_label(), | 2805 slow_path->entry_label(), |
2802 out_reg); | 2806 out_reg, |
| 2807 locs()->temp(0).reg()); |
2803 __ Bind(slow_path->exit_label()); | 2808 __ Bind(slow_path->exit_label()); |
2804 __ StoreDToOffset(value, out_reg, Double::value_offset() - kHeapObjectTag); | 2809 __ StoreDToOffset(value, out_reg, Double::value_offset() - kHeapObjectTag); |
2805 } | 2810 } |
2806 | 2811 |
2807 | 2812 |
2808 LocationSummary* UnboxDoubleInstr::MakeLocationSummary(bool opt) const { | 2813 LocationSummary* UnboxDoubleInstr::MakeLocationSummary(bool opt) const { |
2809 const intptr_t kNumInputs = 1; | 2814 const intptr_t kNumInputs = 1; |
2810 const intptr_t value_cid = value()->Type()->ToCid(); | 2815 const intptr_t value_cid = value()->Type()->ToCid(); |
2811 const bool needs_temp = ((value_cid != kSmiCid) && (value_cid != kDoubleCid)); | 2816 const bool needs_temp = ((value_cid != kSmiCid) && (value_cid != kDoubleCid)); |
2812 const bool needs_writable_input = (value_cid == kSmiCid); | 2817 const bool needs_writable_input = (value_cid == kSmiCid); |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2848 __ mov(IP, ShifterOperand(value, ASR, 1)); // Copy and untag. | 2853 __ mov(IP, ShifterOperand(value, ASR, 1)); // Copy and untag. |
2849 __ vmovsr(STMP, IP); | 2854 __ vmovsr(STMP, IP); |
2850 __ vcvtdi(result, STMP); | 2855 __ vcvtdi(result, STMP); |
2851 __ Bind(&done); | 2856 __ Bind(&done); |
2852 } | 2857 } |
2853 } | 2858 } |
2854 | 2859 |
2855 | 2860 |
2856 LocationSummary* BoxFloat32x4Instr::MakeLocationSummary(bool opt) const { | 2861 LocationSummary* BoxFloat32x4Instr::MakeLocationSummary(bool opt) const { |
2857 const intptr_t kNumInputs = 1; | 2862 const intptr_t kNumInputs = 1; |
2858 const intptr_t kNumTemps = 0; | 2863 const intptr_t kNumTemps = 1; |
2859 LocationSummary* summary = | 2864 LocationSummary* summary = |
2860 new LocationSummary(kNumInputs, | 2865 new LocationSummary(kNumInputs, |
2861 kNumTemps, | 2866 kNumTemps, |
2862 LocationSummary::kCallOnSlowPath); | 2867 LocationSummary::kCallOnSlowPath); |
2863 summary->set_in(0, Location::RequiresFpuRegister()); | 2868 summary->set_in(0, Location::RequiresFpuRegister()); |
| 2869 summary->set_temp(0, Location::RequiresRegister()); |
2864 summary->set_out(Location::RequiresRegister()); | 2870 summary->set_out(Location::RequiresRegister()); |
2865 return summary; | 2871 return summary; |
2866 } | 2872 } |
2867 | 2873 |
2868 | 2874 |
2869 class BoxFloat32x4SlowPath : public SlowPathCode { | 2875 class BoxFloat32x4SlowPath : public SlowPathCode { |
2870 public: | 2876 public: |
2871 explicit BoxFloat32x4SlowPath(BoxFloat32x4Instr* instruction) | 2877 explicit BoxFloat32x4SlowPath(BoxFloat32x4Instr* instruction) |
2872 : instruction_(instruction) { } | 2878 : instruction_(instruction) { } |
2873 | 2879 |
(...skipping 28 matching lines...) Expand all Loading... |
2902 BoxFloat32x4SlowPath* slow_path = new BoxFloat32x4SlowPath(this); | 2908 BoxFloat32x4SlowPath* slow_path = new BoxFloat32x4SlowPath(this); |
2903 compiler->AddSlowPathCode(slow_path); | 2909 compiler->AddSlowPathCode(slow_path); |
2904 | 2910 |
2905 Register out_reg = locs()->out().reg(); | 2911 Register out_reg = locs()->out().reg(); |
2906 QRegister value = locs()->in(0).fpu_reg(); | 2912 QRegister value = locs()->in(0).fpu_reg(); |
2907 DRegister value_even = EvenDRegisterOf(value); | 2913 DRegister value_even = EvenDRegisterOf(value); |
2908 DRegister value_odd = OddDRegisterOf(value); | 2914 DRegister value_odd = OddDRegisterOf(value); |
2909 | 2915 |
2910 __ TryAllocate(compiler->float32x4_class(), | 2916 __ TryAllocate(compiler->float32x4_class(), |
2911 slow_path->entry_label(), | 2917 slow_path->entry_label(), |
2912 out_reg); | 2918 out_reg, |
| 2919 locs()->temp(0).reg()); |
2913 __ Bind(slow_path->exit_label()); | 2920 __ Bind(slow_path->exit_label()); |
2914 | 2921 |
2915 __ StoreDToOffset(value_even, out_reg, | 2922 __ StoreDToOffset(value_even, out_reg, |
2916 Float32x4::value_offset() - kHeapObjectTag); | 2923 Float32x4::value_offset() - kHeapObjectTag); |
2917 __ StoreDToOffset(value_odd, out_reg, | 2924 __ StoreDToOffset(value_odd, out_reg, |
2918 Float32x4::value_offset() + 2*kWordSize - kHeapObjectTag); | 2925 Float32x4::value_offset() + 2*kWordSize - kHeapObjectTag); |
2919 } | 2926 } |
2920 | 2927 |
2921 | 2928 |
2922 LocationSummary* UnboxFloat32x4Instr::MakeLocationSummary(bool opt) const { | 2929 LocationSummary* UnboxFloat32x4Instr::MakeLocationSummary(bool opt) const { |
(...skipping 30 matching lines...) Expand all Loading... |
2953 const DRegister result_odd = OddDRegisterOf(result); | 2960 const DRegister result_odd = OddDRegisterOf(result); |
2954 __ LoadDFromOffset(result_even, value, | 2961 __ LoadDFromOffset(result_even, value, |
2955 Float32x4::value_offset() - kHeapObjectTag); | 2962 Float32x4::value_offset() - kHeapObjectTag); |
2956 __ LoadDFromOffset(result_odd, value, | 2963 __ LoadDFromOffset(result_odd, value, |
2957 Float32x4::value_offset() + 2*kWordSize - kHeapObjectTag); | 2964 Float32x4::value_offset() + 2*kWordSize - kHeapObjectTag); |
2958 } | 2965 } |
2959 | 2966 |
2960 | 2967 |
2961 LocationSummary* BoxInt32x4Instr::MakeLocationSummary(bool opt) const { | 2968 LocationSummary* BoxInt32x4Instr::MakeLocationSummary(bool opt) const { |
2962 const intptr_t kNumInputs = 1; | 2969 const intptr_t kNumInputs = 1; |
2963 const intptr_t kNumTemps = 0; | 2970 const intptr_t kNumTemps = 1; |
2964 LocationSummary* summary = | 2971 LocationSummary* summary = |
2965 new LocationSummary(kNumInputs, | 2972 new LocationSummary(kNumInputs, |
2966 kNumTemps, | 2973 kNumTemps, |
2967 LocationSummary::kCallOnSlowPath); | 2974 LocationSummary::kCallOnSlowPath); |
2968 summary->set_in(0, Location::RequiresFpuRegister()); | 2975 summary->set_in(0, Location::RequiresFpuRegister()); |
| 2976 summary->set_temp(0, Location::RequiresRegister()); |
2969 summary->set_out(Location::RequiresRegister()); | 2977 summary->set_out(Location::RequiresRegister()); |
2970 return summary; | 2978 return summary; |
2971 } | 2979 } |
2972 | 2980 |
2973 | 2981 |
2974 class BoxInt32x4SlowPath : public SlowPathCode { | 2982 class BoxInt32x4SlowPath : public SlowPathCode { |
2975 public: | 2983 public: |
2976 explicit BoxInt32x4SlowPath(BoxInt32x4Instr* instruction) | 2984 explicit BoxInt32x4SlowPath(BoxInt32x4Instr* instruction) |
2977 : instruction_(instruction) { } | 2985 : instruction_(instruction) { } |
2978 | 2986 |
(...skipping 28 matching lines...) Expand all Loading... |
3007 BoxInt32x4SlowPath* slow_path = new BoxInt32x4SlowPath(this); | 3015 BoxInt32x4SlowPath* slow_path = new BoxInt32x4SlowPath(this); |
3008 compiler->AddSlowPathCode(slow_path); | 3016 compiler->AddSlowPathCode(slow_path); |
3009 | 3017 |
3010 Register out_reg = locs()->out().reg(); | 3018 Register out_reg = locs()->out().reg(); |
3011 QRegister value = locs()->in(0).fpu_reg(); | 3019 QRegister value = locs()->in(0).fpu_reg(); |
3012 DRegister value_even = EvenDRegisterOf(value); | 3020 DRegister value_even = EvenDRegisterOf(value); |
3013 DRegister value_odd = OddDRegisterOf(value); | 3021 DRegister value_odd = OddDRegisterOf(value); |
3014 | 3022 |
3015 __ TryAllocate(compiler->int32x4_class(), | 3023 __ TryAllocate(compiler->int32x4_class(), |
3016 slow_path->entry_label(), | 3024 slow_path->entry_label(), |
3017 out_reg); | 3025 out_reg, |
| 3026 locs()->temp(0).reg()); |
3018 __ Bind(slow_path->exit_label()); | 3027 __ Bind(slow_path->exit_label()); |
3019 __ StoreDToOffset(value_even, out_reg, | 3028 __ StoreDToOffset(value_even, out_reg, |
3020 Int32x4::value_offset() - kHeapObjectTag); | 3029 Int32x4::value_offset() - kHeapObjectTag); |
3021 __ StoreDToOffset(value_odd, out_reg, | 3030 __ StoreDToOffset(value_odd, out_reg, |
3022 Int32x4::value_offset() + 2*kWordSize - kHeapObjectTag); | 3031 Int32x4::value_offset() + 2*kWordSize - kHeapObjectTag); |
3023 } | 3032 } |
3024 | 3033 |
3025 | 3034 |
3026 LocationSummary* UnboxInt32x4Instr::MakeLocationSummary(bool opt) const { | 3035 LocationSummary* UnboxInt32x4Instr::MakeLocationSummary(bool opt) const { |
3027 const intptr_t value_cid = value()->Type()->ToCid(); | 3036 const intptr_t value_cid = value()->Type()->ToCid(); |
(...skipping 1806 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4834 compiler->GenerateCall(token_pos(), | 4843 compiler->GenerateCall(token_pos(), |
4835 &label, | 4844 &label, |
4836 PcDescriptors::kOther, | 4845 PcDescriptors::kOther, |
4837 locs()); | 4846 locs()); |
4838 __ Drop(2); // Discard type arguments and receiver. | 4847 __ Drop(2); // Discard type arguments and receiver. |
4839 } | 4848 } |
4840 | 4849 |
4841 } // namespace dart | 4850 } // namespace dart |
4842 | 4851 |
4843 #endif // defined TARGET_ARCH_ARM | 4852 #endif // defined TARGET_ARCH_ARM |
OLD | NEW |