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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 Label fall_through; | 51 Label fall_through; |
52 | 52 |
53 if (Isolate::Current()->flags().type_checks()) { | 53 if (Isolate::Current()->flags().type_checks()) { |
54 const intptr_t type_args_field_offset = | 54 const intptr_t type_args_field_offset = |
55 ComputeObjectArrayTypeArgumentsOffset(); | 55 ComputeObjectArrayTypeArgumentsOffset(); |
56 // Inline simple tests (Smi, null), fallthrough if not positive. | 56 // Inline simple tests (Smi, null), fallthrough if not positive. |
57 Label checked_ok; | 57 Label checked_ok; |
58 __ lw(T2, Address(SP, 0 * kWordSize)); // Value. | 58 __ lw(T2, Address(SP, 0 * kWordSize)); // Value. |
59 | 59 |
60 // Null value is valid for any type. | 60 // Null value is valid for any type. |
61 __ LoadImmediate(T7, reinterpret_cast<int32_t>(Object::null())); | 61 __ LoadObject(T7, Object::null_object()); |
62 __ beq(T2, T7, &checked_ok); | 62 __ beq(T2, T7, &checked_ok); |
63 | 63 |
64 __ lw(T1, Address(SP, 2 * kWordSize)); // Array. | 64 __ lw(T1, Address(SP, 2 * kWordSize)); // Array. |
65 __ lw(T1, FieldAddress(T1, type_args_field_offset)); | 65 __ lw(T1, FieldAddress(T1, type_args_field_offset)); |
66 | 66 |
67 // T1: Type arguments of array. | 67 // T1: Type arguments of array. |
68 __ beq(T1, T7, &checked_ok); | 68 __ beq(T1, T7, &checked_ok); |
69 | 69 |
70 // Check if it's dynamic. | 70 // Check if it's dynamic. |
71 // Get type at index 0. | 71 // Get type at index 0. |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 // len = len + 1; | 162 // len = len + 1; |
163 __ addiu(T3, T1, Immediate(value_one)); | 163 __ addiu(T3, T1, Immediate(value_one)); |
164 __ sw(T3, FieldAddress(T0, GrowableObjectArray::length_offset())); | 164 __ sw(T3, FieldAddress(T0, GrowableObjectArray::length_offset())); |
165 __ lw(T0, Address(SP, 0 * kWordSize)); // Value. | 165 __ lw(T0, Address(SP, 0 * kWordSize)); // Value. |
166 ASSERT(kSmiTagShift == 1); | 166 ASSERT(kSmiTagShift == 1); |
167 __ sll(T1, T1, 1); | 167 __ sll(T1, T1, 1); |
168 __ addu(T1, T2, T1); | 168 __ addu(T1, T2, T1); |
169 __ StoreIntoObject(T2, | 169 __ StoreIntoObject(T2, |
170 FieldAddress(T1, Array::data_offset()), | 170 FieldAddress(T1, Array::data_offset()), |
171 T0); | 171 T0); |
172 __ LoadImmediate(T7, reinterpret_cast<int32_t>(Object::null())); | 172 __ LoadObject(T7, Object::null_object()); |
173 __ Ret(); | 173 __ Ret(); |
174 __ delay_slot()->mov(V0, T7); | 174 __ delay_slot()->mov(V0, T7); |
175 __ Bind(&fall_through); | 175 __ Bind(&fall_through); |
176 } | 176 } |
177 | 177 |
178 | 178 |
179 #define TYPED_ARRAY_ALLOCATION(type_name, cid, max_len, scale_shift) \ | 179 #define TYPED_ARRAY_ALLOCATION(type_name, cid, max_len, scale_shift) \ |
180 Label fall_through; \ | 180 Label fall_through; \ |
181 const intptr_t kArrayLengthStackOffset = 0 * kWordSize; \ | 181 const intptr_t kArrayLengthStackOffset = 0 * kWordSize; \ |
182 __ MaybeTraceAllocation(cid, T2, &fall_through, \ | 182 __ MaybeTraceAllocation(cid, T2, &fall_through, \ |
(...skipping 1975 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2158 | 2158 |
2159 void Intrinsifier::Profiler_getCurrentTag(Assembler* assembler) { | 2159 void Intrinsifier::Profiler_getCurrentTag(Assembler* assembler) { |
2160 __ LoadIsolate(V0); | 2160 __ LoadIsolate(V0); |
2161 __ Ret(); | 2161 __ Ret(); |
2162 __ delay_slot()->lw(V0, Address(V0, Isolate::current_tag_offset())); | 2162 __ delay_slot()->lw(V0, Address(V0, Isolate::current_tag_offset())); |
2163 } | 2163 } |
2164 | 2164 |
2165 } // namespace dart | 2165 } // namespace dart |
2166 | 2166 |
2167 #endif // defined TARGET_ARCH_MIPS | 2167 #endif // defined TARGET_ARCH_MIPS |
OLD | NEW |