| 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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 | 94 |
| 95 __ StoreToOffset(R0, SP, thread_offset); | 95 __ StoreToOffset(R0, SP, thread_offset); |
| 96 __ StoreToOffset(R1, SP, argc_tag_offset); | 96 __ StoreToOffset(R1, SP, argc_tag_offset); |
| 97 __ StoreToOffset(R2, SP, argv_offset); | 97 __ StoreToOffset(R2, SP, argv_offset); |
| 98 __ StoreToOffset(R3, SP, retval_offset); | 98 __ StoreToOffset(R3, SP, retval_offset); |
| 99 __ mov(R0, SP); // Pass the pointer to the NativeArguments. | 99 __ mov(R0, SP); // Pass the pointer to the NativeArguments. |
| 100 | 100 |
| 101 // We are entering runtime code, so the C stack pointer must be restored from | 101 // We are entering runtime code, so the C stack pointer must be restored from |
| 102 // the stack limit to the top of the stack. We cache the stack limit address | 102 // the stack limit to the top of the stack. We cache the stack limit address |
| 103 // in a callee-saved register. | 103 // in a callee-saved register. |
| 104 __ mov(R26, CSP); | 104 __ mov(R25, CSP); |
| 105 __ mov(CSP, SP); | 105 __ mov(CSP, SP); |
| 106 | 106 |
| 107 __ blr(R5); | 107 __ blr(R5); |
| 108 __ Comment("CallToRuntimeStub return"); | 108 __ Comment("CallToRuntimeStub return"); |
| 109 | 109 |
| 110 // Restore SP and CSP. | 110 // Restore SP and CSP. |
| 111 __ mov(SP, CSP); | 111 __ mov(SP, CSP); |
| 112 __ mov(CSP, R26); | 112 __ mov(CSP, R25); |
| 113 | 113 |
| 114 // Retval is next to 1st argument. | 114 // Retval is next to 1st argument. |
| 115 // Mark that the thread is executing Dart code. | 115 // Mark that the thread is executing Dart code. |
| 116 __ LoadImmediate(R2, VMTag::kDartTagId); | 116 __ LoadImmediate(R2, VMTag::kDartTagId); |
| 117 __ StoreToOffset(R2, THR, Thread::vm_tag_offset()); | 117 __ StoreToOffset(R2, THR, Thread::vm_tag_offset()); |
| 118 | 118 |
| 119 // Reset exit frame information in Isolate structure. | 119 // Reset exit frame information in Isolate structure. |
| 120 __ StoreToOffset(ZR, THR, Thread::top_exit_frame_info_offset()); | 120 __ StoreToOffset(ZR, THR, Thread::top_exit_frame_info_offset()); |
| 121 | 121 |
| 122 __ LeaveStubFrame(); | 122 __ LeaveStubFrame(); |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 197 // For now, space is reserved on the stack and we pass a pointer to it. | 197 // For now, space is reserved on the stack and we pass a pointer to it. |
| 198 __ StoreToOffset(R0, SP, thread_offset); | 198 __ StoreToOffset(R0, SP, thread_offset); |
| 199 __ StoreToOffset(R1, SP, argc_tag_offset); | 199 __ StoreToOffset(R1, SP, argc_tag_offset); |
| 200 __ StoreToOffset(R2, SP, argv_offset); | 200 __ StoreToOffset(R2, SP, argv_offset); |
| 201 __ StoreToOffset(R3, SP, retval_offset); | 201 __ StoreToOffset(R3, SP, retval_offset); |
| 202 __ mov(R0, SP); // Pass the pointer to the NativeArguments. | 202 __ mov(R0, SP); // Pass the pointer to the NativeArguments. |
| 203 | 203 |
| 204 // We are entering runtime code, so the C stack pointer must be restored from | 204 // We are entering runtime code, so the C stack pointer must be restored from |
| 205 // the stack limit to the top of the stack. We cache the stack limit address | 205 // the stack limit to the top of the stack. We cache the stack limit address |
| 206 // in the Dart SP register, which is callee-saved in the C ABI. | 206 // in the Dart SP register, which is callee-saved in the C ABI. |
| 207 __ mov(R26, CSP); | 207 __ mov(R25, CSP); |
| 208 __ mov(CSP, SP); | 208 __ mov(CSP, SP); |
| 209 | 209 |
| 210 __ mov(R1, R5); // Pass the function entrypoint to call. | 210 __ mov(R1, R5); // Pass the function entrypoint to call. |
| 211 | 211 |
| 212 // Call native function invocation wrapper or redirection via simulator. | 212 // Call native function invocation wrapper or redirection via simulator. |
| 213 __ ldr(LR, Address(THR, Thread::native_call_wrapper_entry_point_offset())); | 213 __ ldr(LR, Address(THR, Thread::native_call_wrapper_entry_point_offset())); |
| 214 __ blr(LR); | 214 __ blr(LR); |
| 215 | 215 |
| 216 // Restore SP and CSP. | 216 // Restore SP and CSP. |
| 217 __ mov(SP, CSP); | 217 __ mov(SP, CSP); |
| 218 __ mov(CSP, R26); | 218 __ mov(CSP, R25); |
| 219 | 219 |
| 220 // Mark that the thread is executing Dart code. | 220 // Mark that the thread is executing Dart code. |
| 221 __ LoadImmediate(R2, VMTag::kDartTagId); | 221 __ LoadImmediate(R2, VMTag::kDartTagId); |
| 222 __ StoreToOffset(R2, THR, Thread::vm_tag_offset()); | 222 __ StoreToOffset(R2, THR, Thread::vm_tag_offset()); |
| 223 | 223 |
| 224 // Reset exit frame information in Isolate structure. | 224 // Reset exit frame information in Isolate structure. |
| 225 __ StoreToOffset(ZR, THR, Thread::top_exit_frame_info_offset()); | 225 __ StoreToOffset(ZR, THR, Thread::top_exit_frame_info_offset()); |
| 226 | 226 |
| 227 __ LeaveStubFrame(); | 227 __ LeaveStubFrame(); |
| 228 __ ret(); | 228 __ ret(); |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 290 // For now, space is reserved on the stack and we pass a pointer to it. | 290 // For now, space is reserved on the stack and we pass a pointer to it. |
| 291 __ StoreToOffset(R0, SP, thread_offset); | 291 __ StoreToOffset(R0, SP, thread_offset); |
| 292 __ StoreToOffset(R1, SP, argc_tag_offset); | 292 __ StoreToOffset(R1, SP, argc_tag_offset); |
| 293 __ StoreToOffset(R2, SP, argv_offset); | 293 __ StoreToOffset(R2, SP, argv_offset); |
| 294 __ StoreToOffset(R3, SP, retval_offset); | 294 __ StoreToOffset(R3, SP, retval_offset); |
| 295 __ mov(R0, SP); // Pass the pointer to the NativeArguments. | 295 __ mov(R0, SP); // Pass the pointer to the NativeArguments. |
| 296 | 296 |
| 297 // We are entering runtime code, so the C stack pointer must be restored from | 297 // We are entering runtime code, so the C stack pointer must be restored from |
| 298 // the stack limit to the top of the stack. We cache the stack limit address | 298 // the stack limit to the top of the stack. We cache the stack limit address |
| 299 // in the Dart SP register, which is callee-saved in the C ABI. | 299 // in the Dart SP register, which is callee-saved in the C ABI. |
| 300 __ mov(R26, CSP); | 300 __ mov(R25, CSP); |
| 301 __ mov(CSP, SP); | 301 __ mov(CSP, SP); |
| 302 | 302 |
| 303 // Call native function or redirection via simulator. | 303 // Call native function or redirection via simulator. |
| 304 __ blr(R5); | 304 __ blr(R5); |
| 305 | 305 |
| 306 // Restore SP and CSP. | 306 // Restore SP and CSP. |
| 307 __ mov(SP, CSP); | 307 __ mov(SP, CSP); |
| 308 __ mov(CSP, R26); | 308 __ mov(CSP, R25); |
| 309 | 309 |
| 310 // Mark that the thread is executing Dart code. | 310 // Mark that the thread is executing Dart code. |
| 311 __ LoadImmediate(R2, VMTag::kDartTagId); | 311 __ LoadImmediate(R2, VMTag::kDartTagId); |
| 312 __ StoreToOffset(R2, THR, Thread::vm_tag_offset()); | 312 __ StoreToOffset(R2, THR, Thread::vm_tag_offset()); |
| 313 | 313 |
| 314 // Reset exit frame information in Isolate structure. | 314 // Reset exit frame information in Isolate structure. |
| 315 __ StoreToOffset(ZR, THR, Thread::top_exit_frame_info_offset()); | 315 __ StoreToOffset(ZR, THR, Thread::top_exit_frame_info_offset()); |
| 316 | 316 |
| 317 __ LeaveStubFrame(); | 317 __ LeaveStubFrame(); |
| 318 __ ret(); | 318 __ ret(); |
| (...skipping 1870 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2189 __ Bind(&miss); | 2189 __ Bind(&miss); |
| 2190 __ LoadIsolate(R2); | 2190 __ LoadIsolate(R2); |
| 2191 __ ldr(CODE_REG, Address(R2, Isolate::ic_miss_code_offset())); | 2191 __ ldr(CODE_REG, Address(R2, Isolate::ic_miss_code_offset())); |
| 2192 __ ldr(R1, FieldAddress(CODE_REG, Code::entry_point_offset())); | 2192 __ ldr(R1, FieldAddress(CODE_REG, Code::entry_point_offset())); |
| 2193 __ ret(); | 2193 __ ret(); |
| 2194 } | 2194 } |
| 2195 | 2195 |
| 2196 } // namespace dart | 2196 } // namespace dart |
| 2197 | 2197 |
| 2198 #endif // defined TARGET_ARCH_ARM64 | 2198 #endif // defined TARGET_ARCH_ARM64 |
| OLD | NEW |