| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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_ARM64. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM64. |
| 6 #if defined(TARGET_ARCH_ARM64) | 6 #if defined(TARGET_ARCH_ARM64) |
| 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 // R5: IC Data | 23 // R5: IC Data |
| 22 // R4: Arguments descriptor | 24 // R4: Arguments descriptor |
| 23 // LR: Return address | 25 // LR: Return address |
| 24 // The R5, R4 registers can be destroyed only if there is no slow-path, i.e. | 26 // The R5, R4 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 2006 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2036 StringEquality(assembler, kOneByteStringCid); | 2038 StringEquality(assembler, kOneByteStringCid); |
| 2037 } | 2039 } |
| 2038 | 2040 |
| 2039 | 2041 |
| 2040 void Intrinsifier::TwoByteString_equality(Assembler* assembler) { | 2042 void Intrinsifier::TwoByteString_equality(Assembler* assembler) { |
| 2041 StringEquality(assembler, kTwoByteStringCid); | 2043 StringEquality(assembler, kTwoByteStringCid); |
| 2042 } | 2044 } |
| 2043 | 2045 |
| 2044 | 2046 |
| 2045 void Intrinsifier::JSRegExp_ExecuteMatch(Assembler* assembler) { | 2047 void Intrinsifier::JSRegExp_ExecuteMatch(Assembler* assembler) { |
| 2048 if (FLAG_interpret_irregexp) return; |
| 2049 |
| 2046 static const intptr_t kRegExpParamOffset = 2 * kWordSize; | 2050 static const intptr_t kRegExpParamOffset = 2 * kWordSize; |
| 2047 static const intptr_t kStringParamOffset = 1 * kWordSize; | 2051 static const intptr_t kStringParamOffset = 1 * kWordSize; |
| 2048 // start_index smi is located at offset 0. | 2052 // start_index smi is located at offset 0. |
| 2049 | 2053 |
| 2050 // Incoming registers: | 2054 // Incoming registers: |
| 2051 // R0: Function. (Will be reloaded with the specialized matcher function.) | 2055 // R0: Function. (Will be reloaded with the specialized matcher function.) |
| 2052 // R4: Arguments descriptor. (Will be preserved.) | 2056 // R4: Arguments descriptor. (Will be preserved.) |
| 2053 // R5: Unknown. (Must be GC safe on tail call.) | 2057 // R5: Unknown. (Must be GC safe on tail call.) |
| 2054 | 2058 |
| 2055 // Load the specialized function pointer into R0. Leverage the fact the | 2059 // Load the specialized function pointer into R0. Leverage the fact the |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2109 Isolate* isolate = Isolate::Current(); | 2113 Isolate* isolate = Isolate::Current(); |
| 2110 __ LoadImmediate(R1, reinterpret_cast<uword>(isolate), kNoPP); | 2114 __ LoadImmediate(R1, reinterpret_cast<uword>(isolate), kNoPP); |
| 2111 // Set return value to Isolate::current_tag_. | 2115 // Set return value to Isolate::current_tag_. |
| 2112 __ ldr(R0, Address(R1, Isolate::current_tag_offset())); | 2116 __ ldr(R0, Address(R1, Isolate::current_tag_offset())); |
| 2113 __ ret(); | 2117 __ ret(); |
| 2114 } | 2118 } |
| 2115 | 2119 |
| 2116 } // namespace dart | 2120 } // namespace dart |
| 2117 | 2121 |
| 2118 #endif // defined TARGET_ARCH_ARM64 | 2122 #endif // defined TARGET_ARCH_ARM64 |
| OLD | NEW |