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/intrinsifier.h" | 8 #include "vm/intrinsifier.h" |
9 | 9 |
10 #include "vm/assembler.h" | 10 #include "vm/assembler.h" |
(...skipping 1031 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1042 __ bic(R0, R0, Operand(kSmiTagMask)); // Remove inverted smi-tag. | 1042 __ bic(R0, R0, Operand(kSmiTagMask)); // Remove inverted smi-tag. |
1043 __ Ret(); | 1043 __ Ret(); |
1044 } | 1044 } |
1045 | 1045 |
1046 | 1046 |
1047 void Intrinsifier::Smi_bitLength(Assembler* assembler) { | 1047 void Intrinsifier::Smi_bitLength(Assembler* assembler) { |
1048 // TODO(sra): Implement as word-length - CLZ. | 1048 // TODO(sra): Implement as word-length - CLZ. |
1049 } | 1049 } |
1050 | 1050 |
1051 | 1051 |
| 1052 void Intrinsifier::Bigint_getNeg(Assembler* assembler) { |
| 1053 __ ldr(R0, Address(SP, 0 * kWordSize)); |
| 1054 __ ldr(R0, FieldAddress(R0, Bigint::neg_offset())); |
| 1055 __ Ret(); |
| 1056 } |
| 1057 |
| 1058 |
| 1059 void Intrinsifier::Bigint_setNeg(Assembler* assembler) { |
| 1060 __ ldr(R0, Address(SP, 0 * kWordSize)); |
| 1061 __ ldr(R1, Address(SP, 1 * kWordSize)); |
| 1062 __ StoreIntoObject(R1, FieldAddress(R1, Bigint::neg_offset()), R0, false); |
| 1063 __ Ret(); |
| 1064 } |
| 1065 |
| 1066 |
| 1067 void Intrinsifier::Bigint_getUsed(Assembler* assembler) { |
| 1068 __ ldr(R0, Address(SP, 0 * kWordSize)); |
| 1069 __ ldr(R0, FieldAddress(R0, Bigint::used_offset())); |
| 1070 __ Ret(); |
| 1071 } |
| 1072 |
| 1073 |
| 1074 void Intrinsifier::Bigint_setUsed(Assembler* assembler) { |
| 1075 __ ldr(R0, Address(SP, 0 * kWordSize)); |
| 1076 __ ldr(R1, Address(SP, 1 * kWordSize)); |
| 1077 __ StoreIntoObject(R1, FieldAddress(R1, Bigint::used_offset()), R0); |
| 1078 __ Ret(); |
| 1079 } |
| 1080 |
| 1081 |
| 1082 void Intrinsifier::Bigint_getDigits(Assembler* assembler) { |
| 1083 __ ldr(R0, Address(SP, 0 * kWordSize)); |
| 1084 __ ldr(R0, FieldAddress(R0, Bigint::digits_offset())); |
| 1085 __ Ret(); |
| 1086 } |
| 1087 |
| 1088 |
| 1089 void Intrinsifier::Bigint_setDigits(Assembler* assembler) { |
| 1090 __ ldr(R0, Address(SP, 0 * kWordSize)); |
| 1091 __ ldr(R1, Address(SP, 1 * kWordSize)); |
| 1092 __ StoreIntoObject(R1, FieldAddress(R1, Bigint::digits_offset()), R0, false); |
| 1093 __ Ret(); |
| 1094 } |
| 1095 |
| 1096 |
1052 // Check if the last argument is a double, jump to label 'is_smi' if smi | 1097 // Check if the last argument is a double, jump to label 'is_smi' if smi |
1053 // (easy to convert to double), otherwise jump to label 'not_double_smi', | 1098 // (easy to convert to double), otherwise jump to label 'not_double_smi', |
1054 // Returns the last argument in R0. | 1099 // Returns the last argument in R0. |
1055 static void TestLastArgumentIsDouble(Assembler* assembler, | 1100 static void TestLastArgumentIsDouble(Assembler* assembler, |
1056 Label* is_smi, | 1101 Label* is_smi, |
1057 Label* not_double_smi) { | 1102 Label* not_double_smi) { |
1058 __ ldr(R0, Address(SP, 0 * kWordSize)); | 1103 __ ldr(R0, Address(SP, 0 * kWordSize)); |
1059 __ tst(R0, Operand(kSmiTagMask)); | 1104 __ tst(R0, Operand(kSmiTagMask)); |
1060 __ b(is_smi, EQ); | 1105 __ b(is_smi, EQ); |
1061 __ CompareClassId(R0, kDoubleCid, R1); | 1106 __ CompareClassId(R0, kDoubleCid, R1); |
(...skipping 730 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1792 Isolate* isolate = Isolate::Current(); | 1837 Isolate* isolate = Isolate::Current(); |
1793 __ LoadImmediate(R1, reinterpret_cast<uword>(isolate)); | 1838 __ LoadImmediate(R1, reinterpret_cast<uword>(isolate)); |
1794 // Set return value to Isolate::current_tag_. | 1839 // Set return value to Isolate::current_tag_. |
1795 __ ldr(R0, Address(R1, Isolate::current_tag_offset())); | 1840 __ ldr(R0, Address(R1, Isolate::current_tag_offset())); |
1796 __ Ret(); | 1841 __ Ret(); |
1797 } | 1842 } |
1798 | 1843 |
1799 } // namespace dart | 1844 } // namespace dart |
1800 | 1845 |
1801 #endif // defined TARGET_ARCH_ARM | 1846 #endif // defined TARGET_ARCH_ARM |
OLD | NEW |