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" | 5 #include "vm/globals.h" |
6 #if defined(TARGET_ARCH_MIPS) | 6 #if defined(TARGET_ARCH_MIPS) |
7 | 7 |
8 #include "vm/assembler.h" | 8 #include "vm/assembler.h" |
9 #include "vm/code_generator.h" | 9 #include "vm/code_generator.h" |
10 #include "vm/compiler.h" | 10 #include "vm/compiler.h" |
(...skipping 2260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2271 } | 2271 } |
2272 | 2272 |
2273 | 2273 |
2274 // Called from switchable IC calls. | 2274 // Called from switchable IC calls. |
2275 // T0: receiver | 2275 // T0: receiver |
2276 // S5: ICData (preserved) | 2276 // S5: ICData (preserved) |
2277 // Result: | 2277 // Result: |
2278 // T1: target entry point | 2278 // T1: target entry point |
2279 // CODE_REG: target Code object | 2279 // CODE_REG: target Code object |
2280 // S4: arguments descriptor | 2280 // S4: arguments descriptor |
2281 void StubCode::GenerateICLookupStub(Assembler* assembler) { | 2281 void StubCode::GenerateICLookupThroughFunctionStub(Assembler* assembler) { |
2282 Label loop, found, miss; | 2282 Label loop, found, miss; |
2283 __ lw(T6, FieldAddress(S5, ICData::ic_data_offset())); | 2283 __ lw(T6, FieldAddress(S5, ICData::ic_data_offset())); |
2284 __ lw(S4, FieldAddress(S5, ICData::arguments_descriptor_offset())); | 2284 __ lw(S4, FieldAddress(S5, ICData::arguments_descriptor_offset())); |
2285 __ AddImmediate(T6, T6, Array::data_offset() - kHeapObjectTag); | 2285 __ AddImmediate(T6, T6, Array::data_offset() - kHeapObjectTag); |
2286 // T6: first IC entry. | 2286 // T6: first IC entry. |
2287 __ LoadTaggedClassIdMayBeSmi(T1, T0); | 2287 __ LoadTaggedClassIdMayBeSmi(T1, T0); |
2288 // T1: receiver cid as Smi | 2288 // T1: receiver cid as Smi |
2289 | 2289 |
2290 __ Bind(&loop); | 2290 __ Bind(&loop); |
2291 __ lw(T2, Address(T6, 0)); | 2291 __ lw(T2, Address(T6, 0)); |
(...skipping 12 matching lines...) Expand all Loading... |
2304 __ lw(CODE_REG, FieldAddress(T0, Function::code_offset())); | 2304 __ lw(CODE_REG, FieldAddress(T0, Function::code_offset())); |
2305 __ Ret(); | 2305 __ Ret(); |
2306 | 2306 |
2307 __ Bind(&miss); | 2307 __ Bind(&miss); |
2308 __ LoadIsolate(T2); | 2308 __ LoadIsolate(T2); |
2309 __ lw(CODE_REG, Address(T2, Isolate::ic_miss_code_offset())); | 2309 __ lw(CODE_REG, Address(T2, Isolate::ic_miss_code_offset())); |
2310 __ lw(T1, FieldAddress(CODE_REG, Code::entry_point_offset())); | 2310 __ lw(T1, FieldAddress(CODE_REG, Code::entry_point_offset())); |
2311 __ Ret(); | 2311 __ Ret(); |
2312 } | 2312 } |
2313 | 2313 |
| 2314 |
| 2315 void StubCode::GenerateICLookupThroughCodeStub(Assembler* assembler) { |
| 2316 Label loop, found, miss; |
| 2317 __ lw(T6, FieldAddress(S5, ICData::ic_data_offset())); |
| 2318 __ lw(S4, FieldAddress(S5, ICData::arguments_descriptor_offset())); |
| 2319 __ AddImmediate(T6, T6, Array::data_offset() - kHeapObjectTag); |
| 2320 // T6: first IC entry. |
| 2321 __ LoadTaggedClassIdMayBeSmi(T1, T0); |
| 2322 // T1: receiver cid as Smi |
| 2323 |
| 2324 __ Bind(&loop); |
| 2325 __ lw(T2, Address(T6, 0)); |
| 2326 __ beq(T1, T2, &found); |
| 2327 ASSERT(Smi::RawValue(kIllegalCid) == 0); |
| 2328 __ beq(T2, ZR, &miss); |
| 2329 |
| 2330 const intptr_t entry_length = ICData::TestEntryLengthFor(1) * kWordSize; |
| 2331 __ AddImmediate(T6, entry_length); // Next entry. |
| 2332 __ b(&loop); |
| 2333 |
| 2334 __ Bind(&found); |
| 2335 const intptr_t code_offset = ICData::CodeIndexFor(1) * kWordSize; |
| 2336 const intptr_t entry_offset = ICData::EntryPointIndexFor(1) * kWordSize; |
| 2337 __ lw(T1, Address(T6, entry_offset)); |
| 2338 __ lw(CODE_REG, Address(T6, code_offset)); |
| 2339 __ Ret(); |
| 2340 |
| 2341 __ Bind(&miss); |
| 2342 __ LoadIsolate(T2); |
| 2343 __ lw(CODE_REG, Address(T2, Isolate::ic_miss_code_offset())); |
| 2344 __ lw(T1, FieldAddress(CODE_REG, Code::entry_point_offset())); |
| 2345 __ Ret(); |
| 2346 } |
| 2347 |
2314 } // namespace dart | 2348 } // namespace dart |
2315 | 2349 |
2316 #endif // defined TARGET_ARCH_MIPS | 2350 #endif // defined TARGET_ARCH_MIPS |
OLD | NEW |