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 2259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2270 __ jr(T1); | 2270 __ jr(T1); |
2271 | 2271 |
2272 __ Bind(&miss); | 2272 __ Bind(&miss); |
2273 __ LoadIsolate(T2); | 2273 __ LoadIsolate(T2); |
2274 __ lw(CODE_REG, Address(T2, Isolate::ic_miss_code_offset())); | 2274 __ lw(CODE_REG, Address(T2, Isolate::ic_miss_code_offset())); |
2275 __ lw(T1, FieldAddress(CODE_REG, Code::entry_point_offset())); | 2275 __ lw(T1, FieldAddress(CODE_REG, Code::entry_point_offset())); |
2276 __ jr(T1); | 2276 __ jr(T1); |
2277 } | 2277 } |
2278 | 2278 |
2279 | 2279 |
| 2280 |
| 2281 // Called from switchable IC calls. |
| 2282 // T0: receiver |
| 2283 // S5: SingleTargetCache |
| 2284 // Passed to target: |
| 2285 // CODE_REG: target Code object |
| 2286 void StubCode::GenerateSingleTargetCallStub(Assembler* assembler) { |
| 2287 __ NoMonomorphicCheckedEntry(); |
| 2288 |
| 2289 Label miss; |
| 2290 |
| 2291 __ LoadClassIdMayBeSmi(T1, T0); |
| 2292 __ lhu(T2, FieldAddress(S5, SingleTargetCache::lower_limit_offset())); |
| 2293 __ lhu(T3, FieldAddress(S5, SingleTargetCache::upper_limit_offset())); |
| 2294 |
| 2295 __ BranchUnsignedLess(T1, T2, &miss); |
| 2296 __ BranchUnsignedGreater(T1, T3, &miss); |
| 2297 |
| 2298 __ lw(T1, FieldAddress(S5, SingleTargetCache::entry_point_offset())); |
| 2299 __ lw(CODE_REG, FieldAddress(S5, SingleTargetCache::target_offset())); |
| 2300 __ jr(T1); |
| 2301 |
| 2302 __ Bind(&miss); |
| 2303 __ EnterStubFrame(); |
| 2304 __ Push(T0); // Preserve receiver. |
| 2305 |
| 2306 __ PushObject(Object::null_object()); // Result. |
| 2307 __ Push(T0); // Arg0: Receiver |
| 2308 __ CallRuntime(kSingleTargetMissRuntimeEntry, 1); |
| 2309 __ Drop(1); |
| 2310 __ Pop(S5); // result = IC |
| 2311 |
| 2312 __ Pop(T0); // Restore receiver. |
| 2313 __ LeaveStubFrame(); |
| 2314 |
| 2315 __ lw(CODE_REG, Address(THR, Thread::ic_lookup_through_code_stub_offset())); |
| 2316 __ lw(T1, FieldAddress(CODE_REG, Code::checked_entry_point_offset())); |
| 2317 __ jr(T1); |
| 2318 } |
| 2319 |
| 2320 |
2280 // Called from the monomorphic checked entry. | 2321 // Called from the monomorphic checked entry. |
2281 // T0: receiver | 2322 // T0: receiver |
2282 void StubCode::GenerateMonomorphicMissStub(Assembler* assembler) { | 2323 void StubCode::GenerateMonomorphicMissStub(Assembler* assembler) { |
2283 __ EnterStubFrame(); | 2324 __ EnterStubFrame(); |
2284 __ Push(T0); // Preserve receiver. | 2325 __ Push(T0); // Preserve receiver. |
2285 | 2326 |
2286 __ PushObject(Object::null_object()); // Result. | 2327 __ PushObject(Object::null_object()); // Result. |
2287 __ Push(T0); // Arg0: Receiver | 2328 __ Push(T0); // Arg0: Receiver |
2288 __ CallRuntime(kMonomorphicMissRuntimeEntry, 1); | 2329 __ CallRuntime(kMonomorphicMissRuntimeEntry, 1); |
2289 __ Drop(1); | 2330 __ Drop(1); |
2290 __ Pop(S5); // result = IC | 2331 __ Pop(S5); // result = IC |
2291 | 2332 |
2292 __ Pop(T0); // Restore receiver. | 2333 __ Pop(T0); // Restore receiver. |
2293 __ LeaveStubFrame(); | 2334 __ LeaveStubFrame(); |
2294 | 2335 |
2295 __ lw(CODE_REG, Address(THR, Thread::ic_lookup_through_code_stub_offset())); | 2336 __ lw(CODE_REG, Address(THR, Thread::ic_lookup_through_code_stub_offset())); |
2296 __ lw(T1, FieldAddress(CODE_REG, Code::checked_entry_point_offset())); | 2337 __ lw(T1, FieldAddress(CODE_REG, Code::checked_entry_point_offset())); |
2297 __ jr(T1); | 2338 __ jr(T1); |
2298 } | 2339 } |
2299 | 2340 |
2300 | 2341 |
2301 void StubCode::GenerateFrameAwaitingMaterializationStub(Assembler* assembler) { | 2342 void StubCode::GenerateFrameAwaitingMaterializationStub(Assembler* assembler) { |
2302 __ break_(0); | 2343 __ break_(0); |
2303 } | 2344 } |
2304 | 2345 |
2305 } // namespace dart | 2346 } // namespace dart |
2306 | 2347 |
2307 #endif // defined TARGET_ARCH_MIPS | 2348 #endif // defined TARGET_ARCH_MIPS |
OLD | NEW |