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_MIPS. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_MIPS. |
6 #if defined(TARGET_ARCH_MIPS) | 6 #if defined(TARGET_ARCH_MIPS) |
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 1734 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1745 DRegister value = locs()->in(1).fpu_reg(); | 1745 DRegister value = locs()->in(1).fpu_reg(); |
1746 Register temp = locs()->temp(0).reg(); | 1746 Register temp = locs()->temp(0).reg(); |
1747 Register temp2 = locs()->temp(1).reg(); | 1747 Register temp2 = locs()->temp(1).reg(); |
1748 | 1748 |
1749 if (is_initialization_) { | 1749 if (is_initialization_) { |
1750 StoreInstanceFieldSlowPath* slow_path = | 1750 StoreInstanceFieldSlowPath* slow_path = |
1751 new StoreInstanceFieldSlowPath(this); | 1751 new StoreInstanceFieldSlowPath(this); |
1752 compiler->AddSlowPathCode(slow_path); | 1752 compiler->AddSlowPathCode(slow_path); |
1753 __ TryAllocate(compiler->double_class(), | 1753 __ TryAllocate(compiler->double_class(), |
1754 slow_path->entry_label(), | 1754 slow_path->entry_label(), |
1755 temp); | 1755 temp, |
| 1756 temp2); |
1756 __ Bind(slow_path->exit_label()); | 1757 __ Bind(slow_path->exit_label()); |
1757 __ mov(temp2, temp); | 1758 __ mov(temp2, temp); |
1758 __ StoreIntoObject(instance_reg, | 1759 __ StoreIntoObject(instance_reg, |
1759 FieldAddress(instance_reg, field().Offset()), | 1760 FieldAddress(instance_reg, field().Offset()), |
1760 temp2); | 1761 temp2); |
1761 } else { | 1762 } else { |
1762 __ lw(temp, FieldAddress(instance_reg, field().Offset())); | 1763 __ lw(temp, FieldAddress(instance_reg, field().Offset())); |
1763 } | 1764 } |
1764 __ StoreDToOffset(value, temp, Double::value_offset() - kHeapObjectTag); | 1765 __ StoreDToOffset(value, temp, Double::value_offset() - kHeapObjectTag); |
1765 return; | 1766 return; |
(...skipping 23 matching lines...) Expand all Loading... |
1789 new StoreInstanceFieldSlowPath(this); | 1790 new StoreInstanceFieldSlowPath(this); |
1790 compiler->AddSlowPathCode(slow_path); | 1791 compiler->AddSlowPathCode(slow_path); |
1791 | 1792 |
1792 if (!compiler->is_optimizing()) { | 1793 if (!compiler->is_optimizing()) { |
1793 locs()->live_registers()->Add(locs()->in(0)); | 1794 locs()->live_registers()->Add(locs()->in(0)); |
1794 locs()->live_registers()->Add(locs()->in(1)); | 1795 locs()->live_registers()->Add(locs()->in(1)); |
1795 } | 1796 } |
1796 | 1797 |
1797 __ TryAllocate(compiler->double_class(), | 1798 __ TryAllocate(compiler->double_class(), |
1798 slow_path->entry_label(), | 1799 slow_path->entry_label(), |
1799 temp); | 1800 temp, |
| 1801 temp2); |
1800 __ Bind(slow_path->exit_label()); | 1802 __ Bind(slow_path->exit_label()); |
1801 __ mov(temp2, temp); | 1803 __ mov(temp2, temp); |
1802 __ StoreIntoObject(instance_reg, | 1804 __ StoreIntoObject(instance_reg, |
1803 FieldAddress(instance_reg, field().Offset()), | 1805 FieldAddress(instance_reg, field().Offset()), |
1804 temp2); | 1806 temp2); |
1805 | 1807 |
1806 __ Bind(©_payload); | 1808 __ Bind(©_payload); |
1807 __ LoadDFromOffset(fpu_temp, | 1809 __ LoadDFromOffset(fpu_temp, |
1808 value_reg, | 1810 value_reg, |
1809 Double::value_offset() - kHeapObjectTag); | 1811 Double::value_offset() - kHeapObjectTag); |
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2043 | 2045 |
2044 BoxDoubleSlowPath* slow_path = new BoxDoubleSlowPath(this); | 2046 BoxDoubleSlowPath* slow_path = new BoxDoubleSlowPath(this); |
2045 compiler->AddSlowPathCode(slow_path); | 2047 compiler->AddSlowPathCode(slow_path); |
2046 | 2048 |
2047 if (!compiler->is_optimizing()) { | 2049 if (!compiler->is_optimizing()) { |
2048 locs()->live_registers()->Add(locs()->in(0)); | 2050 locs()->live_registers()->Add(locs()->in(0)); |
2049 } | 2051 } |
2050 | 2052 |
2051 __ TryAllocate(compiler->double_class(), | 2053 __ TryAllocate(compiler->double_class(), |
2052 slow_path->entry_label(), | 2054 slow_path->entry_label(), |
2053 result_reg); | 2055 result_reg, |
| 2056 temp); |
2054 __ Bind(slow_path->exit_label()); | 2057 __ Bind(slow_path->exit_label()); |
2055 __ lw(temp, FieldAddress(instance_reg, offset_in_bytes())); | 2058 __ lw(temp, FieldAddress(instance_reg, offset_in_bytes())); |
2056 __ LoadDFromOffset(value, temp, Double::value_offset() - kHeapObjectTag); | 2059 __ LoadDFromOffset(value, temp, Double::value_offset() - kHeapObjectTag); |
2057 __ StoreDToOffset(value, | 2060 __ StoreDToOffset(value, |
2058 result_reg, | 2061 result_reg, |
2059 Double::value_offset() - kHeapObjectTag); | 2062 Double::value_offset() - kHeapObjectTag); |
2060 __ b(&done); | 2063 __ b(&done); |
2061 __ Bind(&load_pointer); | 2064 __ Bind(&load_pointer); |
2062 } | 2065 } |
2063 __ lw(result_reg, Address(instance_reg, offset_in_bytes() - kHeapObjectTag)); | 2066 __ lw(result_reg, Address(instance_reg, offset_in_bytes() - kHeapObjectTag)); |
(...skipping 837 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2901 } else { | 2904 } else { |
2902 __ or_(TMP, left, right); | 2905 __ or_(TMP, left, right); |
2903 __ andi(CMPRES1, TMP, Immediate(kSmiTagMask)); | 2906 __ andi(CMPRES1, TMP, Immediate(kSmiTagMask)); |
2904 } | 2907 } |
2905 __ beq(CMPRES1, ZR, deopt); | 2908 __ beq(CMPRES1, ZR, deopt); |
2906 } | 2909 } |
2907 | 2910 |
2908 | 2911 |
2909 LocationSummary* BoxDoubleInstr::MakeLocationSummary(bool opt) const { | 2912 LocationSummary* BoxDoubleInstr::MakeLocationSummary(bool opt) const { |
2910 const intptr_t kNumInputs = 1; | 2913 const intptr_t kNumInputs = 1; |
2911 const intptr_t kNumTemps = 0; | 2914 const intptr_t kNumTemps = 1; |
2912 LocationSummary* summary = | 2915 LocationSummary* summary = |
2913 new LocationSummary(kNumInputs, | 2916 new LocationSummary(kNumInputs, |
2914 kNumTemps, | 2917 kNumTemps, |
2915 LocationSummary::kCallOnSlowPath); | 2918 LocationSummary::kCallOnSlowPath); |
2916 summary->set_in(0, Location::RequiresFpuRegister()); | 2919 summary->set_in(0, Location::RequiresFpuRegister()); |
| 2920 summary->set_temp(0, Location::RequiresRegister()); |
2917 summary->set_out(Location::RequiresRegister()); | 2921 summary->set_out(Location::RequiresRegister()); |
2918 return summary; | 2922 return summary; |
2919 } | 2923 } |
2920 | 2924 |
2921 | 2925 |
2922 void BoxDoubleInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 2926 void BoxDoubleInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
2923 BoxDoubleSlowPath* slow_path = new BoxDoubleSlowPath(this); | 2927 BoxDoubleSlowPath* slow_path = new BoxDoubleSlowPath(this); |
2924 compiler->AddSlowPathCode(slow_path); | 2928 compiler->AddSlowPathCode(slow_path); |
2925 | 2929 |
2926 Register out_reg = locs()->out().reg(); | 2930 Register out_reg = locs()->out().reg(); |
2927 DRegister value = locs()->in(0).fpu_reg(); | 2931 DRegister value = locs()->in(0).fpu_reg(); |
2928 | 2932 |
2929 __ TryAllocate(compiler->double_class(), | 2933 __ TryAllocate(compiler->double_class(), |
2930 slow_path->entry_label(), | 2934 slow_path->entry_label(), |
2931 out_reg); | 2935 out_reg, |
| 2936 locs()->temp(0).reg()); |
2932 __ Bind(slow_path->exit_label()); | 2937 __ Bind(slow_path->exit_label()); |
2933 __ StoreDToOffset(value, out_reg, Double::value_offset() - kHeapObjectTag); | 2938 __ StoreDToOffset(value, out_reg, Double::value_offset() - kHeapObjectTag); |
2934 } | 2939 } |
2935 | 2940 |
2936 | 2941 |
2937 LocationSummary* UnboxDoubleInstr::MakeLocationSummary(bool opt) const { | 2942 LocationSummary* UnboxDoubleInstr::MakeLocationSummary(bool opt) const { |
2938 const intptr_t kNumInputs = 1; | 2943 const intptr_t kNumInputs = 1; |
2939 const intptr_t value_cid = value()->Type()->ToCid(); | 2944 const intptr_t value_cid = value()->Type()->ToCid(); |
2940 const bool needs_writable_input = (value_cid == kSmiCid); | 2945 const bool needs_writable_input = (value_cid == kSmiCid); |
2941 const intptr_t kNumTemps = 0; | 2946 const intptr_t kNumTemps = 0; |
(...skipping 1271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4213 compiler->GenerateCall(token_pos(), | 4218 compiler->GenerateCall(token_pos(), |
4214 &label, | 4219 &label, |
4215 PcDescriptors::kOther, | 4220 PcDescriptors::kOther, |
4216 locs()); | 4221 locs()); |
4217 __ Drop(2); // Discard type arguments and receiver. | 4222 __ Drop(2); // Discard type arguments and receiver. |
4218 } | 4223 } |
4219 | 4224 |
4220 } // namespace dart | 4225 } // namespace dart |
4221 | 4226 |
4222 #endif // defined TARGET_ARCH_MIPS | 4227 #endif // defined TARGET_ARCH_MIPS |
OLD | NEW |