| 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/intrinsifier.h" | 8 #include "vm/intrinsifier.h" |
| 9 | 9 |
| 10 #include "vm/assembler.h" | 10 #include "vm/assembler.h" |
| (...skipping 853 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 864 __ Ret(); | 864 __ Ret(); |
| 865 __ delay_slot()->addiu(V0, V0, Immediate(-1)); // Remove inverted smi-tag. | 865 __ delay_slot()->addiu(V0, V0, Immediate(-1)); // Remove inverted smi-tag. |
| 866 } | 866 } |
| 867 | 867 |
| 868 | 868 |
| 869 void Intrinsifier::Smi_bitLength(Assembler* assembler) { | 869 void Intrinsifier::Smi_bitLength(Assembler* assembler) { |
| 870 // TODO(sra): Implement. | 870 // TODO(sra): Implement. |
| 871 } | 871 } |
| 872 | 872 |
| 873 | 873 |
| 874 void Intrinsifier::Bigint_getNeg(Assembler* assembler) { | |
| 875 __ lw(V0, Address(SP, 0 * kWordSize)); | |
| 876 __ Ret(); | |
| 877 __ delay_slot()->lw(V0, FieldAddress(V0, Bigint::neg_offset())); | |
| 878 } | |
| 879 | |
| 880 | |
| 881 void Intrinsifier::Bigint_setNeg(Assembler* assembler) { | 874 void Intrinsifier::Bigint_setNeg(Assembler* assembler) { |
| 882 __ lw(T0, Address(SP, 0 * kWordSize)); | 875 __ lw(T0, Address(SP, 0 * kWordSize)); |
| 883 __ lw(T1, Address(SP, 1 * kWordSize)); | 876 __ lw(T1, Address(SP, 1 * kWordSize)); |
| 884 __ StoreIntoObject(T1, FieldAddress(T1, Bigint::neg_offset()), T0, false); | 877 __ StoreIntoObject(T1, FieldAddress(T1, Bigint::neg_offset()), T0, false); |
| 885 __ Ret(); | 878 __ Ret(); |
| 886 } | 879 } |
| 887 | 880 |
| 888 | 881 |
| 889 void Intrinsifier::Bigint_getUsed(Assembler* assembler) { | |
| 890 __ lw(V0, Address(SP, 0 * kWordSize)); | |
| 891 __ Ret(); | |
| 892 __ delay_slot()->lw(V0, FieldAddress(V0, Bigint::used_offset())); | |
| 893 } | |
| 894 | |
| 895 | |
| 896 void Intrinsifier::Bigint_setUsed(Assembler* assembler) { | 882 void Intrinsifier::Bigint_setUsed(Assembler* assembler) { |
| 897 __ lw(T0, Address(SP, 0 * kWordSize)); | 883 __ lw(T0, Address(SP, 0 * kWordSize)); |
| 898 __ lw(T1, Address(SP, 1 * kWordSize)); | 884 __ lw(T1, Address(SP, 1 * kWordSize)); |
| 899 __ StoreIntoObject(T1, FieldAddress(T1, Bigint::used_offset()), T0); | 885 __ StoreIntoObject(T1, FieldAddress(T1, Bigint::used_offset()), T0); |
| 900 __ Ret(); | 886 __ Ret(); |
| 901 } | 887 } |
| 902 | 888 |
| 903 | 889 |
| 904 void Intrinsifier::Bigint_getDigits(Assembler* assembler) { | |
| 905 __ lw(V0, Address(SP, 0 * kWordSize)); | |
| 906 __ Ret(); | |
| 907 __ delay_slot()->lw(V0, FieldAddress(V0, Bigint::digits_offset())); | |
| 908 } | |
| 909 | |
| 910 | |
| 911 void Intrinsifier::Bigint_setDigits(Assembler* assembler) { | 890 void Intrinsifier::Bigint_setDigits(Assembler* assembler) { |
| 912 __ lw(T0, Address(SP, 0 * kWordSize)); | 891 __ lw(T0, Address(SP, 0 * kWordSize)); |
| 913 __ lw(T1, Address(SP, 1 * kWordSize)); | 892 __ lw(T1, Address(SP, 1 * kWordSize)); |
| 914 __ StoreIntoObject(T1, FieldAddress(T1, Bigint::digits_offset()), T0, false); | 893 __ StoreIntoObject(T1, FieldAddress(T1, Bigint::digits_offset()), T0, false); |
| 915 __ Ret(); | 894 __ Ret(); |
| 916 } | 895 } |
| 917 | 896 |
| 918 | 897 |
| 919 // Check if the last argument is a double, jump to label 'is_smi' if smi | 898 // Check if the last argument is a double, jump to label 'is_smi' if smi |
| 920 // (easy to convert to double), otherwise jump to label 'not_double_smi', | 899 // (easy to convert to double), otherwise jump to label 'not_double_smi', |
| (...skipping 772 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1693 Isolate* isolate = Isolate::Current(); | 1672 Isolate* isolate = Isolate::Current(); |
| 1694 __ LoadImmediate(V0, reinterpret_cast<uword>(isolate)); | 1673 __ LoadImmediate(V0, reinterpret_cast<uword>(isolate)); |
| 1695 // Set return value. | 1674 // Set return value. |
| 1696 __ Ret(); | 1675 __ Ret(); |
| 1697 __ delay_slot()->lw(V0, Address(V0, Isolate::current_tag_offset())); | 1676 __ delay_slot()->lw(V0, Address(V0, Isolate::current_tag_offset())); |
| 1698 } | 1677 } |
| 1699 | 1678 |
| 1700 } // namespace dart | 1679 } // namespace dart |
| 1701 | 1680 |
| 1702 #endif // defined TARGET_ARCH_MIPS | 1681 #endif // defined TARGET_ARCH_MIPS |
| OLD | NEW |