| 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 1660 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1671 DRegister value = EvenDRegisterOf(locs()->in(1).fpu_reg()); | 1671 DRegister value = EvenDRegisterOf(locs()->in(1).fpu_reg()); |
| 1672 Register temp = locs()->temp(0).reg(); | 1672 Register temp = locs()->temp(0).reg(); |
| 1673 Register temp2 = locs()->temp(1).reg(); | 1673 Register temp2 = locs()->temp(1).reg(); |
| 1674 | 1674 |
| 1675 if (is_initialization_) { | 1675 if (is_initialization_) { |
| 1676 StoreInstanceFieldSlowPath* slow_path = | 1676 StoreInstanceFieldSlowPath* slow_path = |
| 1677 new StoreInstanceFieldSlowPath(this); | 1677 new StoreInstanceFieldSlowPath(this); |
| 1678 compiler->AddSlowPathCode(slow_path); | 1678 compiler->AddSlowPathCode(slow_path); |
| 1679 __ TryAllocate(compiler->double_class(), | 1679 __ TryAllocate(compiler->double_class(), |
| 1680 slow_path->entry_label(), | 1680 slow_path->entry_label(), |
| 1681 temp); | 1681 temp, |
| 1682 temp2); |
| 1682 __ Bind(slow_path->exit_label()); | 1683 __ Bind(slow_path->exit_label()); |
| 1683 __ MoveRegister(temp2, temp); | 1684 __ MoveRegister(temp2, temp); |
| 1684 __ StoreIntoObject(instance_reg, | 1685 __ StoreIntoObject(instance_reg, |
| 1685 FieldAddress(instance_reg, field().Offset()), | 1686 FieldAddress(instance_reg, field().Offset()), |
| 1686 temp2); | 1687 temp2); |
| 1687 } else { | 1688 } else { |
| 1688 __ ldr(temp, FieldAddress(instance_reg, field().Offset())); | 1689 __ ldr(temp, FieldAddress(instance_reg, field().Offset())); |
| 1689 } | 1690 } |
| 1690 __ StoreDToOffset(value, temp, Double::value_offset() - kHeapObjectTag); | 1691 __ StoreDToOffset(value, temp, Double::value_offset() - kHeapObjectTag); |
| 1691 return; | 1692 return; |
| (...skipping 26 matching lines...) Expand all Loading... |
| 1718 new StoreInstanceFieldSlowPath(this); | 1719 new StoreInstanceFieldSlowPath(this); |
| 1719 compiler->AddSlowPathCode(slow_path); | 1720 compiler->AddSlowPathCode(slow_path); |
| 1720 | 1721 |
| 1721 if (!compiler->is_optimizing()) { | 1722 if (!compiler->is_optimizing()) { |
| 1722 locs()->live_registers()->Add(locs()->in(0)); | 1723 locs()->live_registers()->Add(locs()->in(0)); |
| 1723 locs()->live_registers()->Add(locs()->in(1)); | 1724 locs()->live_registers()->Add(locs()->in(1)); |
| 1724 } | 1725 } |
| 1725 | 1726 |
| 1726 __ TryAllocate(compiler->double_class(), | 1727 __ TryAllocate(compiler->double_class(), |
| 1727 slow_path->entry_label(), | 1728 slow_path->entry_label(), |
| 1728 temp); | 1729 temp, |
| 1730 temp2); |
| 1729 __ Bind(slow_path->exit_label()); | 1731 __ Bind(slow_path->exit_label()); |
| 1730 __ MoveRegister(temp2, temp); | 1732 __ MoveRegister(temp2, temp); |
| 1731 __ StoreIntoObject(instance_reg, | 1733 __ StoreIntoObject(instance_reg, |
| 1732 FieldAddress(instance_reg, field().Offset()), | 1734 FieldAddress(instance_reg, field().Offset()), |
| 1733 temp2); | 1735 temp2); |
| 1734 __ Bind(©_payload); | 1736 __ Bind(©_payload); |
| 1735 __ LoadDFromOffset(fpu_temp, | 1737 __ LoadDFromOffset(fpu_temp, |
| 1736 value_reg, | 1738 value_reg, |
| 1737 Double::value_offset() - kHeapObjectTag); | 1739 Double::value_offset() - kHeapObjectTag); |
| 1738 __ StoreDToOffset(fpu_temp, temp, Double::value_offset() - kHeapObjectTag); | 1740 __ StoreDToOffset(fpu_temp, temp, Double::value_offset() - kHeapObjectTag); |
| (...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1968 | 1970 |
| 1969 BoxDoubleSlowPath* slow_path = new BoxDoubleSlowPath(this); | 1971 BoxDoubleSlowPath* slow_path = new BoxDoubleSlowPath(this); |
| 1970 compiler->AddSlowPathCode(slow_path); | 1972 compiler->AddSlowPathCode(slow_path); |
| 1971 | 1973 |
| 1972 if (!compiler->is_optimizing()) { | 1974 if (!compiler->is_optimizing()) { |
| 1973 locs()->live_registers()->Add(locs()->in(0)); | 1975 locs()->live_registers()->Add(locs()->in(0)); |
| 1974 } | 1976 } |
| 1975 | 1977 |
| 1976 __ TryAllocate(compiler->double_class(), | 1978 __ TryAllocate(compiler->double_class(), |
| 1977 slow_path->entry_label(), | 1979 slow_path->entry_label(), |
| 1978 result_reg); | 1980 result_reg, |
| 1981 temp); |
| 1979 __ Bind(slow_path->exit_label()); | 1982 __ Bind(slow_path->exit_label()); |
| 1980 __ ldr(temp, FieldAddress(instance_reg, offset_in_bytes())); | 1983 __ ldr(temp, FieldAddress(instance_reg, offset_in_bytes())); |
| 1981 __ LoadDFromOffset(value, temp, Double::value_offset() - kHeapObjectTag); | 1984 __ LoadDFromOffset(value, temp, Double::value_offset() - kHeapObjectTag); |
| 1982 __ StoreDToOffset(value, | 1985 __ StoreDToOffset(value, |
| 1983 result_reg, | 1986 result_reg, |
| 1984 Double::value_offset() - kHeapObjectTag); | 1987 Double::value_offset() - kHeapObjectTag); |
| 1985 __ b(&done); | 1988 __ b(&done); |
| 1986 __ Bind(&load_pointer); | 1989 __ Bind(&load_pointer); |
| 1987 } | 1990 } |
| 1988 __ LoadFromOffset(kWord, result_reg, | 1991 __ LoadFromOffset(kWord, result_reg, |
| (...skipping 795 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2784 } else { | 2787 } else { |
| 2785 __ orr(IP, left, ShifterOperand(right)); | 2788 __ orr(IP, left, ShifterOperand(right)); |
| 2786 __ tst(IP, ShifterOperand(kSmiTagMask)); | 2789 __ tst(IP, ShifterOperand(kSmiTagMask)); |
| 2787 } | 2790 } |
| 2788 __ b(deopt, EQ); | 2791 __ b(deopt, EQ); |
| 2789 } | 2792 } |
| 2790 | 2793 |
| 2791 | 2794 |
| 2792 LocationSummary* BoxDoubleInstr::MakeLocationSummary(bool opt) const { | 2795 LocationSummary* BoxDoubleInstr::MakeLocationSummary(bool opt) const { |
| 2793 const intptr_t kNumInputs = 1; | 2796 const intptr_t kNumInputs = 1; |
| 2794 const intptr_t kNumTemps = 0; | 2797 const intptr_t kNumTemps = 1; |
| 2795 LocationSummary* summary = | 2798 LocationSummary* summary = |
| 2796 new LocationSummary(kNumInputs, | 2799 new LocationSummary(kNumInputs, |
| 2797 kNumTemps, | 2800 kNumTemps, |
| 2798 LocationSummary::kCallOnSlowPath); | 2801 LocationSummary::kCallOnSlowPath); |
| 2799 summary->set_in(0, Location::RequiresFpuRegister()); | 2802 summary->set_in(0, Location::RequiresFpuRegister()); |
| 2803 summary->set_temp(0, Location::RequiresRegister()); |
| 2800 summary->set_out(Location::RequiresRegister()); | 2804 summary->set_out(Location::RequiresRegister()); |
| 2801 return summary; | 2805 return summary; |
| 2802 } | 2806 } |
| 2803 | 2807 |
| 2804 | 2808 |
| 2805 void BoxDoubleInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 2809 void BoxDoubleInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 2806 BoxDoubleSlowPath* slow_path = new BoxDoubleSlowPath(this); | 2810 BoxDoubleSlowPath* slow_path = new BoxDoubleSlowPath(this); |
| 2807 compiler->AddSlowPathCode(slow_path); | 2811 compiler->AddSlowPathCode(slow_path); |
| 2808 | 2812 |
| 2809 const Register out_reg = locs()->out().reg(); | 2813 const Register out_reg = locs()->out().reg(); |
| 2810 const DRegister value = EvenDRegisterOf(locs()->in(0).fpu_reg()); | 2814 const DRegister value = EvenDRegisterOf(locs()->in(0).fpu_reg()); |
| 2811 | 2815 |
| 2812 __ TryAllocate(compiler->double_class(), | 2816 __ TryAllocate(compiler->double_class(), |
| 2813 slow_path->entry_label(), | 2817 slow_path->entry_label(), |
| 2814 out_reg); | 2818 out_reg, |
| 2819 locs()->temp(0).reg()); |
| 2815 __ Bind(slow_path->exit_label()); | 2820 __ Bind(slow_path->exit_label()); |
| 2816 __ StoreDToOffset(value, out_reg, Double::value_offset() - kHeapObjectTag); | 2821 __ StoreDToOffset(value, out_reg, Double::value_offset() - kHeapObjectTag); |
| 2817 } | 2822 } |
| 2818 | 2823 |
| 2819 | 2824 |
| 2820 LocationSummary* UnboxDoubleInstr::MakeLocationSummary(bool opt) const { | 2825 LocationSummary* UnboxDoubleInstr::MakeLocationSummary(bool opt) const { |
| 2821 const intptr_t kNumInputs = 1; | 2826 const intptr_t kNumInputs = 1; |
| 2822 const intptr_t value_cid = value()->Type()->ToCid(); | 2827 const intptr_t value_cid = value()->Type()->ToCid(); |
| 2823 const bool needs_temp = ((value_cid != kSmiCid) && (value_cid != kDoubleCid)); | 2828 const bool needs_temp = ((value_cid != kSmiCid) && (value_cid != kDoubleCid)); |
| 2824 const bool needs_writable_input = (value_cid == kSmiCid); | 2829 const bool needs_writable_input = (value_cid == kSmiCid); |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2860 __ mov(IP, ShifterOperand(value, ASR, 1)); // Copy and untag. | 2865 __ mov(IP, ShifterOperand(value, ASR, 1)); // Copy and untag. |
| 2861 __ vmovsr(STMP, IP); | 2866 __ vmovsr(STMP, IP); |
| 2862 __ vcvtdi(result, STMP); | 2867 __ vcvtdi(result, STMP); |
| 2863 __ Bind(&done); | 2868 __ Bind(&done); |
| 2864 } | 2869 } |
| 2865 } | 2870 } |
| 2866 | 2871 |
| 2867 | 2872 |
| 2868 LocationSummary* BoxFloat32x4Instr::MakeLocationSummary(bool opt) const { | 2873 LocationSummary* BoxFloat32x4Instr::MakeLocationSummary(bool opt) const { |
| 2869 const intptr_t kNumInputs = 1; | 2874 const intptr_t kNumInputs = 1; |
| 2870 const intptr_t kNumTemps = 0; | 2875 const intptr_t kNumTemps = 1; |
| 2871 LocationSummary* summary = | 2876 LocationSummary* summary = |
| 2872 new LocationSummary(kNumInputs, | 2877 new LocationSummary(kNumInputs, |
| 2873 kNumTemps, | 2878 kNumTemps, |
| 2874 LocationSummary::kCallOnSlowPath); | 2879 LocationSummary::kCallOnSlowPath); |
| 2875 summary->set_in(0, Location::RequiresFpuRegister()); | 2880 summary->set_in(0, Location::RequiresFpuRegister()); |
| 2881 summary->set_temp(0, Location::RequiresRegister()); |
| 2876 summary->set_out(Location::RequiresRegister()); | 2882 summary->set_out(Location::RequiresRegister()); |
| 2877 return summary; | 2883 return summary; |
| 2878 } | 2884 } |
| 2879 | 2885 |
| 2880 | 2886 |
| 2881 class BoxFloat32x4SlowPath : public SlowPathCode { | 2887 class BoxFloat32x4SlowPath : public SlowPathCode { |
| 2882 public: | 2888 public: |
| 2883 explicit BoxFloat32x4SlowPath(BoxFloat32x4Instr* instruction) | 2889 explicit BoxFloat32x4SlowPath(BoxFloat32x4Instr* instruction) |
| 2884 : instruction_(instruction) { } | 2890 : instruction_(instruction) { } |
| 2885 | 2891 |
| (...skipping 28 matching lines...) Expand all Loading... |
| 2914 BoxFloat32x4SlowPath* slow_path = new BoxFloat32x4SlowPath(this); | 2920 BoxFloat32x4SlowPath* slow_path = new BoxFloat32x4SlowPath(this); |
| 2915 compiler->AddSlowPathCode(slow_path); | 2921 compiler->AddSlowPathCode(slow_path); |
| 2916 | 2922 |
| 2917 Register out_reg = locs()->out().reg(); | 2923 Register out_reg = locs()->out().reg(); |
| 2918 QRegister value = locs()->in(0).fpu_reg(); | 2924 QRegister value = locs()->in(0).fpu_reg(); |
| 2919 DRegister value_even = EvenDRegisterOf(value); | 2925 DRegister value_even = EvenDRegisterOf(value); |
| 2920 DRegister value_odd = OddDRegisterOf(value); | 2926 DRegister value_odd = OddDRegisterOf(value); |
| 2921 | 2927 |
| 2922 __ TryAllocate(compiler->float32x4_class(), | 2928 __ TryAllocate(compiler->float32x4_class(), |
| 2923 slow_path->entry_label(), | 2929 slow_path->entry_label(), |
| 2924 out_reg); | 2930 out_reg, |
| 2931 locs()->temp(0).reg()); |
| 2925 __ Bind(slow_path->exit_label()); | 2932 __ Bind(slow_path->exit_label()); |
| 2926 | 2933 |
| 2927 __ StoreDToOffset(value_even, out_reg, | 2934 __ StoreDToOffset(value_even, out_reg, |
| 2928 Float32x4::value_offset() - kHeapObjectTag); | 2935 Float32x4::value_offset() - kHeapObjectTag); |
| 2929 __ StoreDToOffset(value_odd, out_reg, | 2936 __ StoreDToOffset(value_odd, out_reg, |
| 2930 Float32x4::value_offset() + 2*kWordSize - kHeapObjectTag); | 2937 Float32x4::value_offset() + 2*kWordSize - kHeapObjectTag); |
| 2931 } | 2938 } |
| 2932 | 2939 |
| 2933 | 2940 |
| 2934 LocationSummary* UnboxFloat32x4Instr::MakeLocationSummary(bool opt) const { | 2941 LocationSummary* UnboxFloat32x4Instr::MakeLocationSummary(bool opt) const { |
| (...skipping 30 matching lines...) Expand all Loading... |
| 2965 const DRegister result_odd = OddDRegisterOf(result); | 2972 const DRegister result_odd = OddDRegisterOf(result); |
| 2966 __ LoadDFromOffset(result_even, value, | 2973 __ LoadDFromOffset(result_even, value, |
| 2967 Float32x4::value_offset() - kHeapObjectTag); | 2974 Float32x4::value_offset() - kHeapObjectTag); |
| 2968 __ LoadDFromOffset(result_odd, value, | 2975 __ LoadDFromOffset(result_odd, value, |
| 2969 Float32x4::value_offset() + 2*kWordSize - kHeapObjectTag); | 2976 Float32x4::value_offset() + 2*kWordSize - kHeapObjectTag); |
| 2970 } | 2977 } |
| 2971 | 2978 |
| 2972 | 2979 |
| 2973 LocationSummary* BoxInt32x4Instr::MakeLocationSummary(bool opt) const { | 2980 LocationSummary* BoxInt32x4Instr::MakeLocationSummary(bool opt) const { |
| 2974 const intptr_t kNumInputs = 1; | 2981 const intptr_t kNumInputs = 1; |
| 2975 const intptr_t kNumTemps = 0; | 2982 const intptr_t kNumTemps = 1; |
| 2976 LocationSummary* summary = | 2983 LocationSummary* summary = |
| 2977 new LocationSummary(kNumInputs, | 2984 new LocationSummary(kNumInputs, |
| 2978 kNumTemps, | 2985 kNumTemps, |
| 2979 LocationSummary::kCallOnSlowPath); | 2986 LocationSummary::kCallOnSlowPath); |
| 2980 summary->set_in(0, Location::RequiresFpuRegister()); | 2987 summary->set_in(0, Location::RequiresFpuRegister()); |
| 2988 summary->set_temp(0, Location::RequiresRegister()); |
| 2981 summary->set_out(Location::RequiresRegister()); | 2989 summary->set_out(Location::RequiresRegister()); |
| 2982 return summary; | 2990 return summary; |
| 2983 } | 2991 } |
| 2984 | 2992 |
| 2985 | 2993 |
| 2986 class BoxInt32x4SlowPath : public SlowPathCode { | 2994 class BoxInt32x4SlowPath : public SlowPathCode { |
| 2987 public: | 2995 public: |
| 2988 explicit BoxInt32x4SlowPath(BoxInt32x4Instr* instruction) | 2996 explicit BoxInt32x4SlowPath(BoxInt32x4Instr* instruction) |
| 2989 : instruction_(instruction) { } | 2997 : instruction_(instruction) { } |
| 2990 | 2998 |
| (...skipping 28 matching lines...) Expand all Loading... |
| 3019 BoxInt32x4SlowPath* slow_path = new BoxInt32x4SlowPath(this); | 3027 BoxInt32x4SlowPath* slow_path = new BoxInt32x4SlowPath(this); |
| 3020 compiler->AddSlowPathCode(slow_path); | 3028 compiler->AddSlowPathCode(slow_path); |
| 3021 | 3029 |
| 3022 Register out_reg = locs()->out().reg(); | 3030 Register out_reg = locs()->out().reg(); |
| 3023 QRegister value = locs()->in(0).fpu_reg(); | 3031 QRegister value = locs()->in(0).fpu_reg(); |
| 3024 DRegister value_even = EvenDRegisterOf(value); | 3032 DRegister value_even = EvenDRegisterOf(value); |
| 3025 DRegister value_odd = OddDRegisterOf(value); | 3033 DRegister value_odd = OddDRegisterOf(value); |
| 3026 | 3034 |
| 3027 __ TryAllocate(compiler->int32x4_class(), | 3035 __ TryAllocate(compiler->int32x4_class(), |
| 3028 slow_path->entry_label(), | 3036 slow_path->entry_label(), |
| 3029 out_reg); | 3037 out_reg, |
| 3038 locs()->temp(0).reg()); |
| 3030 __ Bind(slow_path->exit_label()); | 3039 __ Bind(slow_path->exit_label()); |
| 3031 __ StoreDToOffset(value_even, out_reg, | 3040 __ StoreDToOffset(value_even, out_reg, |
| 3032 Int32x4::value_offset() - kHeapObjectTag); | 3041 Int32x4::value_offset() - kHeapObjectTag); |
| 3033 __ StoreDToOffset(value_odd, out_reg, | 3042 __ StoreDToOffset(value_odd, out_reg, |
| 3034 Int32x4::value_offset() + 2*kWordSize - kHeapObjectTag); | 3043 Int32x4::value_offset() + 2*kWordSize - kHeapObjectTag); |
| 3035 } | 3044 } |
| 3036 | 3045 |
| 3037 | 3046 |
| 3038 LocationSummary* UnboxInt32x4Instr::MakeLocationSummary(bool opt) const { | 3047 LocationSummary* UnboxInt32x4Instr::MakeLocationSummary(bool opt) const { |
| 3039 const intptr_t value_cid = value()->Type()->ToCid(); | 3048 const intptr_t value_cid = value()->Type()->ToCid(); |
| (...skipping 1806 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4846 compiler->GenerateCall(token_pos(), | 4855 compiler->GenerateCall(token_pos(), |
| 4847 &label, | 4856 &label, |
| 4848 PcDescriptors::kOther, | 4857 PcDescriptors::kOther, |
| 4849 locs()); | 4858 locs()); |
| 4850 __ Drop(2); // Discard type arguments and receiver. | 4859 __ Drop(2); // Discard type arguments and receiver. |
| 4851 } | 4860 } |
| 4852 | 4861 |
| 4853 } // namespace dart | 4862 } // namespace dart |
| 4854 | 4863 |
| 4855 #endif // defined TARGET_ARCH_ARM | 4864 #endif // defined TARGET_ARCH_ARM |
| OLD | NEW |