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 2321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2332 void Intrinsifier::OneByteString_equality(Assembler* assembler) { | 2332 void Intrinsifier::OneByteString_equality(Assembler* assembler) { |
2333 StringEquality(assembler, kOneByteStringCid); | 2333 StringEquality(assembler, kOneByteStringCid); |
2334 } | 2334 } |
2335 | 2335 |
2336 | 2336 |
2337 void Intrinsifier::TwoByteString_equality(Assembler* assembler) { | 2337 void Intrinsifier::TwoByteString_equality(Assembler* assembler) { |
2338 StringEquality(assembler, kTwoByteStringCid); | 2338 StringEquality(assembler, kTwoByteStringCid); |
2339 } | 2339 } |
2340 | 2340 |
2341 | 2341 |
2342 void Intrinsifier::RegExp_ExecuteMatch(Assembler* assembler) { | 2342 void Intrinsifier::IntrinsifyRegExpExecuteMatch(Assembler* assembler, |
| 2343 bool sticky) { |
2343 if (FLAG_interpret_irregexp) return; | 2344 if (FLAG_interpret_irregexp) return; |
2344 | 2345 |
2345 static const intptr_t kRegExpParamOffset = 2 * kWordSize; | 2346 static const intptr_t kRegExpParamOffset = 2 * kWordSize; |
2346 static const intptr_t kStringParamOffset = 1 * kWordSize; | 2347 static const intptr_t kStringParamOffset = 1 * kWordSize; |
2347 // start_index smi is located at 0. | 2348 // start_index smi is located at 0. |
2348 | 2349 |
2349 // Incoming registers: | 2350 // Incoming registers: |
2350 // T0: Function. (Will be reloaded with the specialized matcher function.) | 2351 // T0: Function. (Will be reloaded with the specialized matcher function.) |
2351 // S4: Arguments descriptor. (Will be preserved.) | 2352 // S4: Arguments descriptor. (Will be preserved.) |
2352 // S5: Unknown. (Must be GC safe on tail call.) | 2353 // S5: Unknown. (Must be GC safe on tail call.) |
2353 | 2354 |
2354 // Load the specialized function pointer into T0. Leverage the fact the | 2355 // Load the specialized function pointer into T0. Leverage the fact the |
2355 // string CIDs as well as stored function pointers are in sequence. | 2356 // string CIDs as well as stored function pointers are in sequence. |
2356 __ lw(T1, Address(SP, kRegExpParamOffset)); | 2357 __ lw(T1, Address(SP, kRegExpParamOffset)); |
2357 __ lw(T3, Address(SP, kStringParamOffset)); | 2358 __ lw(T3, Address(SP, kStringParamOffset)); |
2358 __ LoadClassId(T2, T3); | 2359 __ LoadClassId(T2, T3); |
2359 __ AddImmediate(T2, -kOneByteStringCid); | 2360 __ AddImmediate(T2, -kOneByteStringCid); |
2360 __ sll(T2, T2, kWordSizeLog2); | 2361 __ sll(T2, T2, kWordSizeLog2); |
2361 __ addu(T2, T2, T1); | 2362 __ addu(T2, T2, T1); |
2362 __ lw(T0, FieldAddress(T2, RegExp::function_offset(kOneByteStringCid))); | 2363 __ lw(T0, |
| 2364 FieldAddress(T2, RegExp::function_offset(kOneByteStringCid, sticky))); |
2363 | 2365 |
2364 // Registers are now set up for the lazy compile stub. It expects the function | 2366 // Registers are now set up for the lazy compile stub. It expects the function |
2365 // in T0, the argument descriptor in S4, and IC-Data in S5. | 2367 // in T0, the argument descriptor in S4, and IC-Data in S5. |
2366 __ mov(S5, ZR); | 2368 __ mov(S5, ZR); |
2367 | 2369 |
2368 // Tail-call the function. | 2370 // Tail-call the function. |
2369 __ lw(CODE_REG, FieldAddress(T0, Function::code_offset())); | 2371 __ lw(CODE_REG, FieldAddress(T0, Function::code_offset())); |
2370 __ lw(T3, FieldAddress(T0, Function::entry_point_offset())); | 2372 __ lw(T3, FieldAddress(T0, Function::entry_point_offset())); |
2371 __ jr(T3); | 2373 __ jr(T3); |
2372 } | 2374 } |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2417 __ lw(T0, Address(V0, TimelineStream::enabled_offset())); | 2419 __ lw(T0, Address(V0, TimelineStream::enabled_offset())); |
2418 __ LoadObject(V0, Bool::True()); | 2420 __ LoadObject(V0, Bool::True()); |
2419 __ LoadObject(V1, Bool::False()); | 2421 __ LoadObject(V1, Bool::False()); |
2420 __ Ret(); | 2422 __ Ret(); |
2421 __ delay_slot()->movz(V0, V1, T0); // V0 = (T0 == 0) ? V1 : V0. | 2423 __ delay_slot()->movz(V0, V1, T0); // V0 = (T0 == 0) ? V1 : V0. |
2422 } | 2424 } |
2423 | 2425 |
2424 } // namespace dart | 2426 } // namespace dart |
2425 | 2427 |
2426 #endif // defined TARGET_ARCH_MIPS | 2428 #endif // defined TARGET_ARCH_MIPS |
OLD | NEW |