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 1861 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1872 | 1872 |
1873 | 1873 |
1874 // Jump to the exception or error handler. | 1874 // Jump to the exception or error handler. |
1875 // LR: return address. | 1875 // LR: return address. |
1876 // R0: program_counter. | 1876 // R0: program_counter. |
1877 // R1: stack_pointer. | 1877 // R1: stack_pointer. |
1878 // R2: frame_pointer. | 1878 // R2: frame_pointer. |
1879 // R3: error object. | 1879 // R3: error object. |
1880 // R4: address of stacktrace object. | 1880 // R4: address of stacktrace object. |
1881 // R5: thread. | 1881 // R5: thread. |
1882 // R6: pool pointer. | |
1883 // Does not return. | 1882 // Does not return. |
1884 void StubCode::GenerateJumpToExceptionHandlerStub(Assembler* assembler) { | 1883 void StubCode::GenerateJumpToExceptionHandlerStub(Assembler* assembler) { |
1885 ASSERT(kExceptionObjectReg == R0); | 1884 ASSERT(kExceptionObjectReg == R0); |
1886 ASSERT(kStackTraceObjectReg == R1); | 1885 ASSERT(kStackTraceObjectReg == R1); |
1887 __ mov(LR, R0); // Program counter. | 1886 __ mov(LR, R0); // Program counter. |
1888 __ mov(SP, R1); // Stack pointer. | 1887 __ mov(SP, R1); // Stack pointer. |
1889 __ mov(FP, R2); // Frame_pointer. | 1888 __ mov(FP, R2); // Frame_pointer. |
1890 __ mov(R0, R3); // Exception object. | 1889 __ mov(R0, R3); // Exception object. |
1891 __ mov(R1, R4); // StackTrace object. | 1890 __ mov(R1, R4); // StackTrace object. |
1892 __ mov(THR, R5); | 1891 __ mov(THR, R5); |
1893 // When in the PP register, the pool pointer is untagged. | |
1894 __ sub(PP, R6, Operand(kHeapObjectTag)); | |
1895 // Set the tag. | 1892 // Set the tag. |
1896 __ LoadImmediate(R2, VMTag::kDartTagId); | 1893 __ LoadImmediate(R2, VMTag::kDartTagId); |
1897 __ StoreToOffset(R2, THR, Thread::vm_tag_offset()); | 1894 __ StoreToOffset(R2, THR, Thread::vm_tag_offset()); |
1898 // Clear top exit frame. | 1895 // Clear top exit frame. |
1899 __ StoreToOffset(ZR, THR, Thread::top_exit_frame_info_offset()); | 1896 __ StoreToOffset(ZR, THR, Thread::top_exit_frame_info_offset()); |
| 1897 // Restore the pool pointer. |
| 1898 __ RestoreCodePointer(); |
| 1899 __ LoadPoolPointer(); |
1900 __ ret(); // Jump to the exception handler code. | 1900 __ ret(); // Jump to the exception handler code. |
1901 } | 1901 } |
1902 | 1902 |
1903 | 1903 |
1904 // Calls to the runtime to optimize the given function. | 1904 // Calls to the runtime to optimize the given function. |
1905 // R6: function to be re-optimized. | 1905 // R6: function to be re-optimized. |
1906 // R4: argument descriptor (preserved). | 1906 // R4: argument descriptor (preserved). |
1907 void StubCode::GenerateOptimizeFunctionStub(Assembler* assembler) { | 1907 void StubCode::GenerateOptimizeFunctionStub(Assembler* assembler) { |
1908 __ EnterStubFrame(); | 1908 __ EnterStubFrame(); |
1909 __ Push(R4); | 1909 __ Push(R4); |
(...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2275 } | 2275 } |
2276 | 2276 |
2277 | 2277 |
2278 void StubCode::GenerateFrameAwaitingMaterializationStub(Assembler* assembler) { | 2278 void StubCode::GenerateFrameAwaitingMaterializationStub(Assembler* assembler) { |
2279 __ brk(0); | 2279 __ brk(0); |
2280 } | 2280 } |
2281 | 2281 |
2282 } // namespace dart | 2282 } // namespace dart |
2283 | 2283 |
2284 #endif // defined TARGET_ARCH_ARM64 | 2284 #endif // defined TARGET_ARCH_ARM64 |
OLD | NEW |