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" | 5 #include "vm/globals.h" |
6 #if defined(TARGET_ARCH_ARM64) | 6 #if defined(TARGET_ARCH_ARM64) |
7 | 7 |
8 #include "vm/assembler.h" | 8 #include "vm/assembler.h" |
9 #include "vm/code_generator.h" | 9 #include "vm/code_generator.h" |
10 #include "vm/compiler.h" | 10 #include "vm/compiler.h" |
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
207 __ StoreToOffset(R3, SP, retval_offset); | 207 __ StoreToOffset(R3, SP, retval_offset); |
208 __ mov(R0, SP); // Pass the pointer to the NativeArguments. | 208 __ mov(R0, SP); // Pass the pointer to the NativeArguments. |
209 | 209 |
210 // We are entering runtime code, so the C stack pointer must be restored from | 210 // We are entering runtime code, so the C stack pointer must be restored from |
211 // the stack limit to the top of the stack. We cache the stack limit address | 211 // the stack limit to the top of the stack. We cache the stack limit address |
212 // in the Dart SP register, which is callee-saved in the C ABI. | 212 // in the Dart SP register, which is callee-saved in the C ABI. |
213 __ mov(R26, CSP); | 213 __ mov(R26, CSP); |
214 __ mov(CSP, SP); | 214 __ mov(CSP, SP); |
215 | 215 |
216 __ mov(R1, R5); // Pass the function entrypoint to call. | 216 __ mov(R1, R5); // Pass the function entrypoint to call. |
| 217 |
217 // Call native function invocation wrapper or redirection via simulator. | 218 // Call native function invocation wrapper or redirection via simulator. |
218 #if defined(USING_SIMULATOR) | 219 __ ldr(LR, Address(THR, Thread::native_call_wrapper_entry_point_offset())); |
219 uword entry = reinterpret_cast<uword>(NativeEntry::NativeCallWrapper); | 220 __ blr(LR); |
220 entry = Simulator::RedirectExternalReference( | |
221 entry, Simulator::kNativeCall, NativeEntry::kNumCallWrapperArguments); | |
222 __ LoadImmediate(R2, entry); | |
223 __ blr(R2); | |
224 #else | |
225 __ BranchLink(&NativeEntry::NativeCallWrapperLabel()); | |
226 #endif | |
227 | 221 |
228 // Restore SP and CSP. | 222 // Restore SP and CSP. |
229 __ mov(SP, CSP); | 223 __ mov(SP, CSP); |
230 __ mov(CSP, R26); | 224 __ mov(CSP, R26); |
231 | 225 |
232 // Mark that the isolate is executing Dart code. | 226 // Mark that the isolate is executing Dart code. |
233 __ LoadImmediate(R2, VMTag::kDartTagId); | 227 __ LoadImmediate(R2, VMTag::kDartTagId); |
234 __ StoreToOffset(R2, R28, Isolate::vm_tag_offset()); | 228 __ StoreToOffset(R2, R28, Isolate::vm_tag_offset()); |
235 | 229 |
236 // Reset exit frame information in Isolate structure. | 230 // Reset exit frame information in Isolate structure. |
(...skipping 1928 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2165 // Result: | 2159 // Result: |
2166 // R1: entry point. | 2160 // R1: entry point. |
2167 void StubCode::GenerateMegamorphicLookupStub(Assembler* assembler) { | 2161 void StubCode::GenerateMegamorphicLookupStub(Assembler* assembler) { |
2168 EmitMegamorphicLookup(assembler, R0, R1, R1); | 2162 EmitMegamorphicLookup(assembler, R0, R1, R1); |
2169 __ ret(); | 2163 __ ret(); |
2170 } | 2164 } |
2171 | 2165 |
2172 } // namespace dart | 2166 } // namespace dart |
2173 | 2167 |
2174 #endif // defined TARGET_ARCH_ARM64 | 2168 #endif // defined TARGET_ARCH_ARM64 |
OLD | NEW |