| 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 2062 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2073 if (FLAG_use_jscre) { | 2073 if (FLAG_use_jscre) { |
| 2074 return; | 2074 return; |
| 2075 } | 2075 } |
| 2076 static const intptr_t kRegExpParamOffset = 2 * kWordSize; | 2076 static const intptr_t kRegExpParamOffset = 2 * kWordSize; |
| 2077 static const intptr_t kStringParamOffset = 1 * kWordSize; | 2077 static const intptr_t kStringParamOffset = 1 * kWordSize; |
| 2078 // start_index smi is located at 0. | 2078 // start_index smi is located at 0. |
| 2079 | 2079 |
| 2080 // Incoming registers: | 2080 // Incoming registers: |
| 2081 // T0: Function. (Will be reloaded with the specialized matcher function.) | 2081 // T0: Function. (Will be reloaded with the specialized matcher function.) |
| 2082 // S4: Arguments descriptor. (Will be preserved.) | 2082 // S4: Arguments descriptor. (Will be preserved.) |
| 2083 // S5: IC-Data. (Will be preserved.) | 2083 // S5: Unknown. (Must be GC safe on tail call.) |
| 2084 | 2084 |
| 2085 // Load the specialized function pointer into T0. Leverage the fact the | 2085 // Load the specialized function pointer into T0. Leverage the fact the |
| 2086 // string CIDs as well as stored function pointers are in sequence. | 2086 // string CIDs as well as stored function pointers are in sequence. |
| 2087 __ lw(T1, Address(SP, kRegExpParamOffset)); | 2087 __ lw(T1, Address(SP, kRegExpParamOffset)); |
| 2088 __ lw(T3, Address(SP, kStringParamOffset)); | 2088 __ lw(T3, Address(SP, kStringParamOffset)); |
| 2089 __ LoadClassId(T2, T3); | 2089 __ LoadClassId(T2, T3); |
| 2090 __ AddImmediate(T2, -kOneByteStringCid); | 2090 __ AddImmediate(T2, -kOneByteStringCid); |
| 2091 __ sll(T2, T2, kWordSizeLog2); | 2091 __ sll(T2, T2, kWordSizeLog2); |
| 2092 __ addu(T2, T2, T1); | 2092 __ addu(T2, T2, T1); |
| 2093 __ lw(T0, FieldAddress(T2, JSRegExp::function_offset(kOneByteStringCid))); | 2093 __ lw(T0, FieldAddress(T2, JSRegExp::function_offset(kOneByteStringCid))); |
| 2094 | 2094 |
| 2095 // Registers are now set up for the lazy compile stub. It expects the function | 2095 // Registers are now set up for the lazy compile stub. It expects the function |
| 2096 // in T0, the argument descriptor in S4, and IC-Data in S5. | 2096 // in T0, the argument descriptor in S4, and IC-Data in S5. |
| 2097 static const intptr_t arg_count = RegExpMacroAssembler::kParamCount; | 2097 static const intptr_t arg_count = RegExpMacroAssembler::kParamCount; |
| 2098 __ LoadObject(S4, Array::Handle(ArgumentsDescriptor::New(arg_count))); | 2098 __ LoadObject(S4, Array::Handle(ArgumentsDescriptor::New(arg_count))); |
| 2099 __ mov(S5, ZR); |
| 2099 | 2100 |
| 2100 // Tail-call the function. | 2101 // Tail-call the function. |
| 2101 __ lw(T3, FieldAddress(T0, Function::instructions_offset())); | 2102 __ lw(T3, FieldAddress(T0, Function::instructions_offset())); |
| 2102 __ AddImmediate(T3, Instructions::HeaderSize() - kHeapObjectTag); | 2103 __ AddImmediate(T3, Instructions::HeaderSize() - kHeapObjectTag); |
| 2103 __ jr(T3); | 2104 __ jr(T3); |
| 2104 } | 2105 } |
| 2105 | 2106 |
| 2106 | 2107 |
| 2107 // On stack: user tag (+0). | 2108 // On stack: user tag (+0). |
| 2108 void Intrinsifier::UserTag_makeCurrent(Assembler* assembler) { | 2109 void Intrinsifier::UserTag_makeCurrent(Assembler* assembler) { |
| (...skipping 30 matching lines...) Expand all Loading... |
| 2139 Isolate* isolate = Isolate::Current(); | 2140 Isolate* isolate = Isolate::Current(); |
| 2140 __ LoadImmediate(V0, reinterpret_cast<uword>(isolate)); | 2141 __ LoadImmediate(V0, reinterpret_cast<uword>(isolate)); |
| 2141 // Set return value. | 2142 // Set return value. |
| 2142 __ Ret(); | 2143 __ Ret(); |
| 2143 __ delay_slot()->lw(V0, Address(V0, Isolate::current_tag_offset())); | 2144 __ delay_slot()->lw(V0, Address(V0, Isolate::current_tag_offset())); |
| 2144 } | 2145 } |
| 2145 | 2146 |
| 2146 } // namespace dart | 2147 } // namespace dart |
| 2147 | 2148 |
| 2148 #endif // defined TARGET_ARCH_MIPS | 2149 #endif // defined TARGET_ARCH_MIPS |
| OLD | NEW |