OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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_X64) | 6 #if defined(TARGET_ARCH_X64) |
7 | 7 |
8 #include "vm/assembler.h" | 8 #include "vm/assembler.h" |
9 #include "vm/compiler.h" | 9 #include "vm/compiler.h" |
10 #include "vm/dart_entry.h" | 10 #include "vm/dart_entry.h" |
(...skipping 1823 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1834 | 1834 |
1835 | 1835 |
1836 // Jump to the exception or error handler. | 1836 // Jump to the exception or error handler. |
1837 // TOS + 0: return address | 1837 // TOS + 0: return address |
1838 // Arg1: program counter | 1838 // Arg1: program counter |
1839 // Arg2: stack pointer | 1839 // Arg2: stack pointer |
1840 // Arg3: frame_pointer | 1840 // Arg3: frame_pointer |
1841 // Arg4: exception object | 1841 // Arg4: exception object |
1842 // Arg5: stacktrace object | 1842 // Arg5: stacktrace object |
1843 // Arg6: thread | 1843 // Arg6: thread |
| 1844 // Arg7: pool pointer |
1844 // No Result. | 1845 // No Result. |
1845 void StubCode::GenerateJumpToExceptionHandlerStub(Assembler* assembler) { | 1846 void StubCode::GenerateJumpToExceptionHandlerStub(Assembler* assembler) { |
1846 ASSERT(kExceptionObjectReg == RAX); | 1847 ASSERT(kExceptionObjectReg == RAX); |
1847 ASSERT(kStackTraceObjectReg == RDX); | 1848 ASSERT(kStackTraceObjectReg == RDX); |
1848 ASSERT(CallingConventions::kArg4Reg != kStackTraceObjectReg); | 1849 ASSERT(CallingConventions::kArg4Reg != kStackTraceObjectReg); |
1849 ASSERT(CallingConventions::kArg1Reg != kStackTraceObjectReg); | 1850 ASSERT(CallingConventions::kArg1Reg != kStackTraceObjectReg); |
1850 | 1851 |
1851 #if defined(_WIN64) | 1852 #if defined(_WIN64) |
1852 Register stacktrace_reg = RBX; | 1853 Register stacktrace_reg = RBX; |
1853 __ movq(stacktrace_reg, Address(RSP, 5 * kWordSize)); | 1854 __ movq(stacktrace_reg, Address(RSP, 5 * kWordSize)); |
1854 __ movq(THR, Address(RSP, 6 * kWordSize)); | 1855 __ movq(THR, Address(RSP, 6 * kWordSize)); |
| 1856 __ movq(PP, Address(RSP, 7 * kWordSize)); |
1855 #else | 1857 #else |
1856 Register stacktrace_reg = CallingConventions::kArg5Reg; | 1858 Register stacktrace_reg = CallingConventions::kArg5Reg; |
1857 __ movq(THR, CallingConventions::kArg6Reg); | 1859 __ movq(THR, CallingConventions::kArg6Reg); |
| 1860 __ movq(PP, Address(RSP, 1 * kWordSize)); |
1858 #endif | 1861 #endif |
1859 __ movq(RBP, CallingConventions::kArg3Reg); | 1862 __ movq(RBP, CallingConventions::kArg3Reg); |
1860 __ movq(RSP, CallingConventions::kArg2Reg); | 1863 __ movq(RSP, CallingConventions::kArg2Reg); |
1861 __ movq(kStackTraceObjectReg, stacktrace_reg); | 1864 __ movq(kStackTraceObjectReg, stacktrace_reg); |
1862 __ movq(kExceptionObjectReg, CallingConventions::kArg4Reg); | 1865 __ movq(kExceptionObjectReg, CallingConventions::kArg4Reg); |
1863 // Set the tag. | 1866 // Set the tag. |
1864 __ movq(Assembler::VMTagAddress(), Immediate(VMTag::kDartTagId)); | 1867 __ movq(Assembler::VMTagAddress(), Immediate(VMTag::kDartTagId)); |
1865 // Clear top exit frame. | 1868 // Clear top exit frame. |
1866 __ movq(Address(THR, Thread::top_exit_frame_info_offset()), | 1869 __ movq(Address(THR, Thread::top_exit_frame_info_offset()), |
1867 Immediate(0)); | 1870 Immediate(0)); |
1868 // Restore the pool pointer. | |
1869 __ RestoreCodePointer(); | |
1870 __ LoadPoolPointer(PP); | |
1871 __ jmp(CallingConventions::kArg1Reg); // Jump to the exception handler code. | 1871 __ jmp(CallingConventions::kArg1Reg); // Jump to the exception handler code. |
1872 } | 1872 } |
1873 | 1873 |
1874 | 1874 |
1875 // Calls to the runtime to optimize the given function. | 1875 // Calls to the runtime to optimize the given function. |
1876 // RDI: function to be reoptimized. | 1876 // RDI: function to be reoptimized. |
1877 // R10: argument descriptor (preserved). | 1877 // R10: argument descriptor (preserved). |
1878 void StubCode::GenerateOptimizeFunctionStub(Assembler* assembler) { | 1878 void StubCode::GenerateOptimizeFunctionStub(Assembler* assembler) { |
1879 __ EnterStubFrame(); | 1879 __ EnterStubFrame(); |
1880 __ pushq(R10); // Preserve args descriptor. | 1880 __ pushq(R10); // Preserve args descriptor. |
(...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2245 } | 2245 } |
2246 | 2246 |
2247 | 2247 |
2248 void StubCode::GenerateFrameAwaitingMaterializationStub(Assembler* assembler) { | 2248 void StubCode::GenerateFrameAwaitingMaterializationStub(Assembler* assembler) { |
2249 __ int3(); | 2249 __ int3(); |
2250 } | 2250 } |
2251 | 2251 |
2252 } // namespace dart | 2252 } // namespace dart |
2253 | 2253 |
2254 #endif // defined TARGET_ARCH_X64 | 2254 #endif // defined TARGET_ARCH_X64 |
OLD | NEW |