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_ARM. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM. |
6 #if defined(TARGET_ARCH_ARM) | 6 #if defined(TARGET_ARCH_ARM) |
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/cpu.h" | 11 #include "vm/cpu.h" |
12 #include "vm/dart_entry.h" | 12 #include "vm/dart_entry.h" |
13 #include "vm/flow_graph_compiler.h" | 13 #include "vm/flow_graph_compiler.h" |
14 #include "vm/object.h" | 14 #include "vm/object.h" |
15 #include "vm/object_store.h" | 15 #include "vm/object_store.h" |
16 #include "vm/regexp_assembler.h" | 16 #include "vm/regexp_assembler.h" |
17 #include "vm/symbols.h" | 17 #include "vm/symbols.h" |
18 | 18 |
19 namespace dart { | 19 namespace dart { |
20 | 20 |
| 21 DECLARE_FLAG(bool, interpret_irregexp); |
| 22 |
21 // When entering intrinsics code: | 23 // When entering intrinsics code: |
22 // R5: IC Data | 24 // R5: IC Data |
23 // R4: Arguments descriptor | 25 // R4: Arguments descriptor |
24 // LR: Return address | 26 // LR: Return address |
25 // The R5, R4 registers can be destroyed only if there is no slow-path, i.e. | 27 // The R5, R4 registers can be destroyed only if there is no slow-path, i.e. |
26 // if the intrinsified method always executes a return. | 28 // if the intrinsified method always executes a return. |
27 // The FP register should not be modified, because it is used by the profiler. | 29 // The FP register should not be modified, because it is used by the profiler. |
28 // The THR register (see constants_arm.h) must be preserved. | 30 // The THR register (see constants_arm.h) must be preserved. |
29 | 31 |
30 #define __ assembler-> | 32 #define __ assembler-> |
(...skipping 1924 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1955 StringEquality(assembler, kOneByteStringCid); | 1957 StringEquality(assembler, kOneByteStringCid); |
1956 } | 1958 } |
1957 | 1959 |
1958 | 1960 |
1959 void Intrinsifier::TwoByteString_equality(Assembler* assembler) { | 1961 void Intrinsifier::TwoByteString_equality(Assembler* assembler) { |
1960 StringEquality(assembler, kTwoByteStringCid); | 1962 StringEquality(assembler, kTwoByteStringCid); |
1961 } | 1963 } |
1962 | 1964 |
1963 | 1965 |
1964 void Intrinsifier::JSRegExp_ExecuteMatch(Assembler* assembler) { | 1966 void Intrinsifier::JSRegExp_ExecuteMatch(Assembler* assembler) { |
| 1967 if (FLAG_interpret_irregexp) return; |
| 1968 |
1965 static const intptr_t kRegExpParamOffset = 2 * kWordSize; | 1969 static const intptr_t kRegExpParamOffset = 2 * kWordSize; |
1966 static const intptr_t kStringParamOffset = 1 * kWordSize; | 1970 static const intptr_t kStringParamOffset = 1 * kWordSize; |
1967 // start_index smi is located at offset 0. | 1971 // start_index smi is located at offset 0. |
1968 | 1972 |
1969 // Incoming registers: | 1973 // Incoming registers: |
1970 // R0: Function. (Will be reloaded with the specialized matcher function.) | 1974 // R0: Function. (Will be reloaded with the specialized matcher function.) |
1971 // R4: Arguments descriptor. (Will be preserved.) | 1975 // R4: Arguments descriptor. (Will be preserved.) |
1972 // R5: Unknown. (Must be GC safe on tail call.) | 1976 // R5: Unknown. (Must be GC safe on tail call.) |
1973 | 1977 |
1974 // Load the specialized function pointer into R0. Leverage the fact the | 1978 // Load the specialized function pointer into R0. Leverage the fact the |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2027 Isolate* isolate = Isolate::Current(); | 2031 Isolate* isolate = Isolate::Current(); |
2028 __ LoadImmediate(R1, reinterpret_cast<uword>(isolate)); | 2032 __ LoadImmediate(R1, reinterpret_cast<uword>(isolate)); |
2029 // Set return value to Isolate::current_tag_. | 2033 // Set return value to Isolate::current_tag_. |
2030 __ ldr(R0, Address(R1, Isolate::current_tag_offset())); | 2034 __ ldr(R0, Address(R1, Isolate::current_tag_offset())); |
2031 __ Ret(); | 2035 __ Ret(); |
2032 } | 2036 } |
2033 | 2037 |
2034 } // namespace dart | 2038 } // namespace dart |
2035 | 2039 |
2036 #endif // defined TARGET_ARCH_ARM | 2040 #endif // defined TARGET_ARCH_ARM |
OLD | NEW |