| 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 2194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2205 const Register temp2 = T3; | 2205 const Register temp2 = T3; |
| 2206 const Register left = T1; | 2206 const Register left = T1; |
| 2207 const Register right = T0; | 2207 const Register right = T0; |
| 2208 __ lw(left, Address(SP, 1 * kWordSize)); | 2208 __ lw(left, Address(SP, 1 * kWordSize)); |
| 2209 __ lw(right, Address(SP, 0 * kWordSize)); | 2209 __ lw(right, Address(SP, 0 * kWordSize)); |
| 2210 GenerateIdenticalWithNumberCheckStub(assembler, left, right, temp1, temp2); | 2210 GenerateIdenticalWithNumberCheckStub(assembler, left, right, temp1, temp2); |
| 2211 __ Ret(); | 2211 __ Ret(); |
| 2212 } | 2212 } |
| 2213 | 2213 |
| 2214 | 2214 |
| 2215 void StubCode::EmitMegamorphicLookup(Assembler* assembler) { | 2215 // Called from megamorphic calls. |
| 2216 // T0: receiver |
| 2217 // S5: MegamorphicCache (preserved) |
| 2218 // Result: |
| 2219 // T1: target entry point |
| 2220 // CODE_REG: target Code |
| 2221 // S4: arguments descriptor |
| 2222 void StubCode::GenerateMegamorphicLookupStub(Assembler* assembler) { |
| 2216 __ LoadTaggedClassIdMayBeSmi(T0, T0); | 2223 __ LoadTaggedClassIdMayBeSmi(T0, T0); |
| 2217 // T0: class ID of the receiver (smi). | 2224 // T0: class ID of the receiver (smi). |
| 2218 __ lw(S4, FieldAddress(S5, MegamorphicCache::arguments_descriptor_offset())); | 2225 __ lw(S4, FieldAddress(S5, MegamorphicCache::arguments_descriptor_offset())); |
| 2219 __ lw(T2, FieldAddress(S5, MegamorphicCache::buckets_offset())); | 2226 __ lw(T2, FieldAddress(S5, MegamorphicCache::buckets_offset())); |
| 2220 __ lw(T1, FieldAddress(S5, MegamorphicCache::mask_offset())); | 2227 __ lw(T1, FieldAddress(S5, MegamorphicCache::mask_offset())); |
| 2221 // T2: cache buckets array. | 2228 // T2: cache buckets array. |
| 2222 // T1: mask. | 2229 // T1: mask. |
| 2223 __ LoadImmediate(TMP, MegamorphicCache::kSpreadFactor); | 2230 __ LoadImmediate(TMP, MegamorphicCache::kSpreadFactor); |
| 2224 __ mult(TMP, T0); | 2231 __ mult(TMP, T0); |
| 2225 __ mflo(T3); | 2232 __ mflo(T3); |
| (...skipping 20 matching lines...) Expand all Loading... |
| 2246 // Call the target found in the cache. For a class id match, this is a | 2253 // Call the target found in the cache. For a class id match, this is a |
| 2247 // proper target for the given name and arguments descriptor. If the | 2254 // proper target for the given name and arguments descriptor. If the |
| 2248 // illegal class id was found, the target is a cache miss handler that can | 2255 // illegal class id was found, the target is a cache miss handler that can |
| 2249 // be invoked as a normal Dart function. | 2256 // be invoked as a normal Dart function. |
| 2250 __ sll(T1, T3, 2); | 2257 __ sll(T1, T3, 2); |
| 2251 __ addu(T1, T2, T1); | 2258 __ addu(T1, T2, T1); |
| 2252 __ lw(T0, FieldAddress(T1, base + kWordSize)); | 2259 __ lw(T0, FieldAddress(T1, base + kWordSize)); |
| 2253 | 2260 |
| 2254 __ lw(T1, FieldAddress(T0, Function::entry_point_offset())); | 2261 __ lw(T1, FieldAddress(T0, Function::entry_point_offset())); |
| 2255 __ lw(CODE_REG, FieldAddress(T0, Function::code_offset())); | 2262 __ lw(CODE_REG, FieldAddress(T0, Function::code_offset())); |
| 2256 } | |
| 2257 | |
| 2258 | |
| 2259 // Called from megamorphic calls. | |
| 2260 // T0: receiver | |
| 2261 // S5: MegamorphicCache (preserved) | |
| 2262 // Result: | |
| 2263 // T1: target entry point | |
| 2264 // CODE_REG: target Code | |
| 2265 // S4: arguments descriptor | |
| 2266 void StubCode::GenerateMegamorphicLookupStub(Assembler* assembler) { | |
| 2267 EmitMegamorphicLookup(assembler); | |
| 2268 __ Ret(); | 2263 __ Ret(); |
| 2269 } | 2264 } |
| 2270 | 2265 |
| 2271 | 2266 |
| 2272 // Called from switchable IC calls. | 2267 // Called from switchable IC calls. |
| 2273 // T0: receiver | 2268 // T0: receiver |
| 2274 // S5: ICData (preserved) | 2269 // S5: ICData (preserved) |
| 2275 // Result: | 2270 // Result: |
| 2276 // T1: target entry point | 2271 // T1: target entry point |
| 2277 // CODE_REG: target Code object | 2272 // CODE_REG: target Code object |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2344 } | 2339 } |
| 2345 | 2340 |
| 2346 | 2341 |
| 2347 void StubCode::GenerateFrameAwaitingMaterializationStub(Assembler* assembler) { | 2342 void StubCode::GenerateFrameAwaitingMaterializationStub(Assembler* assembler) { |
| 2348 __ break_(0); | 2343 __ break_(0); |
| 2349 } | 2344 } |
| 2350 | 2345 |
| 2351 } // namespace dart | 2346 } // namespace dart |
| 2352 | 2347 |
| 2353 #endif // defined TARGET_ARCH_MIPS | 2348 #endif // defined TARGET_ARCH_MIPS |
| OLD | NEW |