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" |
11 #include "vm/dart_entry.h" | 11 #include "vm/dart_entry.h" |
12 #include "vm/flow_graph_compiler.h" | 12 #include "vm/flow_graph_compiler.h" |
13 #include "vm/object.h" | 13 #include "vm/object.h" |
14 #include "vm/object_store.h" | 14 #include "vm/object_store.h" |
15 #include "vm/regexp_assembler.h" | 15 #include "vm/regexp_assembler.h" |
16 #include "vm/symbols.h" | 16 #include "vm/symbols.h" |
17 | 17 |
18 namespace dart { | 18 namespace dart { |
19 | 19 |
| 20 DECLARE_FLAG(bool, interpret_irregexp); |
| 21 |
20 // When entering intrinsics code: | 22 // When entering intrinsics code: |
21 // S5: IC Data | 23 // S5: IC Data |
22 // S4: Arguments descriptor | 24 // S4: Arguments descriptor |
23 // RA: Return address | 25 // RA: Return address |
24 // The S5, S4 registers can be destroyed only if there is no slow-path, i.e. | 26 // The S5, S4 registers can be destroyed only if there is no slow-path, i.e. |
25 // if the intrinsified method always executes a return. | 27 // if the intrinsified method always executes a return. |
26 // The FP register should not be modified, because it is used by the profiler. | 28 // The FP register should not be modified, because it is used by the profiler. |
27 | 29 |
28 #define __ assembler-> | 30 #define __ assembler-> |
29 | 31 |
(...skipping 2038 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2068 StringEquality(assembler, kOneByteStringCid); | 2070 StringEquality(assembler, kOneByteStringCid); |
2069 } | 2071 } |
2070 | 2072 |
2071 | 2073 |
2072 void Intrinsifier::TwoByteString_equality(Assembler* assembler) { | 2074 void Intrinsifier::TwoByteString_equality(Assembler* assembler) { |
2073 StringEquality(assembler, kTwoByteStringCid); | 2075 StringEquality(assembler, kTwoByteStringCid); |
2074 } | 2076 } |
2075 | 2077 |
2076 | 2078 |
2077 void Intrinsifier::JSRegExp_ExecuteMatch(Assembler* assembler) { | 2079 void Intrinsifier::JSRegExp_ExecuteMatch(Assembler* assembler) { |
| 2080 if (FLAG_interpret_irregexp) return; |
| 2081 |
2078 static const intptr_t kRegExpParamOffset = 2 * kWordSize; | 2082 static const intptr_t kRegExpParamOffset = 2 * kWordSize; |
2079 static const intptr_t kStringParamOffset = 1 * kWordSize; | 2083 static const intptr_t kStringParamOffset = 1 * kWordSize; |
2080 // start_index smi is located at 0. | 2084 // start_index smi is located at 0. |
2081 | 2085 |
2082 // Incoming registers: | 2086 // Incoming registers: |
2083 // T0: Function. (Will be reloaded with the specialized matcher function.) | 2087 // T0: Function. (Will be reloaded with the specialized matcher function.) |
2084 // S4: Arguments descriptor. (Will be preserved.) | 2088 // S4: Arguments descriptor. (Will be preserved.) |
2085 // S5: Unknown. (Must be GC safe on tail call.) | 2089 // S5: Unknown. (Must be GC safe on tail call.) |
2086 | 2090 |
2087 // Load the specialized function pointer into T0. Leverage the fact the | 2091 // Load the specialized function pointer into T0. Leverage the fact the |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2142 Isolate* isolate = Isolate::Current(); | 2146 Isolate* isolate = Isolate::Current(); |
2143 __ LoadImmediate(V0, reinterpret_cast<uword>(isolate)); | 2147 __ LoadImmediate(V0, reinterpret_cast<uword>(isolate)); |
2144 // Set return value. | 2148 // Set return value. |
2145 __ Ret(); | 2149 __ Ret(); |
2146 __ delay_slot()->lw(V0, Address(V0, Isolate::current_tag_offset())); | 2150 __ delay_slot()->lw(V0, Address(V0, Isolate::current_tag_offset())); |
2147 } | 2151 } |
2148 | 2152 |
2149 } // namespace dart | 2153 } // namespace dart |
2150 | 2154 |
2151 #endif // defined TARGET_ARCH_MIPS | 2155 #endif // defined TARGET_ARCH_MIPS |
OLD | NEW |