| 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 762 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 773 // Input parameters: | 773 // Input parameters: |
| 774 // LR : points to return address. | 774 // LR : points to return address. |
| 775 // R0 : code object of the Dart function to call. | 775 // R0 : code object of the Dart function to call. |
| 776 // R1 : arguments descriptor array. | 776 // R1 : arguments descriptor array. |
| 777 // R2 : arguments array. | 777 // R2 : arguments array. |
| 778 // R3 : current thread. | 778 // R3 : current thread. |
| 779 void StubCode::GenerateInvokeDartCodeStub(Assembler* assembler) { | 779 void StubCode::GenerateInvokeDartCodeStub(Assembler* assembler) { |
| 780 __ Comment("InvokeDartCodeStub"); | 780 __ Comment("InvokeDartCodeStub"); |
| 781 | 781 |
| 782 // Copy the C stack pointer (R31) into the stack pointer we'll actually use | 782 // Copy the C stack pointer (R31) into the stack pointer we'll actually use |
| 783 // to access the stack, and put the C stack pointer at the stack limit. | 783 // to access the stack. |
| 784 __ SetupDartSP(OSThread::GetSpecifiedStackSize()); | 784 __ SetupDartSP(); |
| 785 __ EnterFrame(0); | 785 __ EnterFrame(0); |
| 786 | 786 |
| 787 // Push code object to PC marker slot. | 787 // Push code object to PC marker slot. |
| 788 __ ldr(TMP, Address(R3, Thread::invoke_dart_code_stub_offset())); | 788 __ ldr(TMP, Address(R3, Thread::invoke_dart_code_stub_offset())); |
| 789 __ Push(TMP); | 789 __ Push(TMP); |
| 790 | 790 |
| 791 // Save the callee-saved registers. | 791 // Save the callee-saved registers. |
| 792 for (int i = kAbiFirstPreservedCpuReg; i <= kAbiLastPreservedCpuReg; i++) { | 792 for (int i = kAbiFirstPreservedCpuReg; i <= kAbiLastPreservedCpuReg; i++) { |
| 793 const Register r = static_cast<Register>(i); | 793 const Register r = static_cast<Register>(i); |
| 794 // We use str instead of the Push macro because we will be pushing the PP | 794 // We use str instead of the Push macro because we will be pushing the PP |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 889 Register r = static_cast<Register>(i); | 889 Register r = static_cast<Register>(i); |
| 890 // We use ldr instead of the Pop macro because we will be popping the PP | 890 // We use ldr instead of the Pop macro because we will be popping the PP |
| 891 // register when it is not holding a pool-pointer since we are returning to | 891 // register when it is not holding a pool-pointer since we are returning to |
| 892 // C++ code. We also skip the dart stack pointer SP, since we are still | 892 // C++ code. We also skip the dart stack pointer SP, since we are still |
| 893 // using it as the stack pointer. | 893 // using it as the stack pointer. |
| 894 __ ldr(r, Address(SP, 1 * kWordSize, Address::PostIndex)); | 894 __ ldr(r, Address(SP, 1 * kWordSize, Address::PostIndex)); |
| 895 } | 895 } |
| 896 | 896 |
| 897 // Restore the frame pointer and C stack pointer and return. | 897 // Restore the frame pointer and C stack pointer and return. |
| 898 __ LeaveFrame(); | 898 __ LeaveFrame(); |
| 899 __ mov(CSP, SP); | 899 __ RestoreCSP(); |
| 900 __ ret(); | 900 __ ret(); |
| 901 } | 901 } |
| 902 | 902 |
| 903 | 903 |
| 904 // Called for inline allocation of contexts. | 904 // Called for inline allocation of contexts. |
| 905 // Input: | 905 // Input: |
| 906 // R1: number of context variables. | 906 // R1: number of context variables. |
| 907 // Output: | 907 // Output: |
| 908 // R0: new allocated RawContext object. | 908 // R0: new allocated RawContext object. |
| 909 void StubCode::GenerateAllocateContextStub(Assembler* assembler) { | 909 void StubCode::GenerateAllocateContextStub(Assembler* assembler) { |
| (...skipping 1320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2230 } | 2230 } |
| 2231 | 2231 |
| 2232 | 2232 |
| 2233 void StubCode::GenerateFrameAwaitingMaterializationStub(Assembler* assembler) { | 2233 void StubCode::GenerateFrameAwaitingMaterializationStub(Assembler* assembler) { |
| 2234 __ brk(0); | 2234 __ brk(0); |
| 2235 } | 2235 } |
| 2236 | 2236 |
| 2237 } // namespace dart | 2237 } // namespace dart |
| 2238 | 2238 |
| 2239 #endif // defined TARGET_ARCH_ARM64 | 2239 #endif // defined TARGET_ARCH_ARM64 |
| OLD | NEW |