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 1733 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1744 } | 1744 } |
1745 | 1745 |
1746 | 1746 |
1747 // Jump to the exception or error handler. | 1747 // Jump to the exception or error handler. |
1748 // TOS + 0: return address | 1748 // TOS + 0: return address |
1749 // Arg1: program counter | 1749 // Arg1: program counter |
1750 // Arg2: stack pointer | 1750 // Arg2: stack pointer |
1751 // Arg3: frame_pointer | 1751 // Arg3: frame_pointer |
1752 // Arg4: exception object | 1752 // Arg4: exception object |
1753 // Arg5: stacktrace object | 1753 // Arg5: stacktrace object |
| 1754 // Arg6: isolate |
1754 // No Result. | 1755 // No Result. |
1755 void StubCode::GenerateJumpToExceptionHandlerStub(Assembler* assembler) { | 1756 void StubCode::GenerateJumpToExceptionHandlerStub(Assembler* assembler) { |
1756 ASSERT(kExceptionObjectReg == RAX); | 1757 ASSERT(kExceptionObjectReg == RAX); |
1757 ASSERT(kStackTraceObjectReg == RDX); | 1758 ASSERT(kStackTraceObjectReg == RDX); |
1758 ASSERT(CallingConventions::kArg4Reg != kStackTraceObjectReg); | 1759 ASSERT(CallingConventions::kArg4Reg != kStackTraceObjectReg); |
1759 ASSERT(CallingConventions::kArg1Reg != kStackTraceObjectReg); | 1760 ASSERT(CallingConventions::kArg1Reg != kStackTraceObjectReg); |
1760 | 1761 |
1761 #if defined(_WIN64) | 1762 #if defined(_WIN64) |
1762 Register stacktrace_reg = RBX; | 1763 Register stacktrace_reg = RBX; |
1763 __ movq(stacktrace_reg, Address(RSP, 5 * kWordSize)); | 1764 __ movq(stacktrace_reg, Address(RSP, 5 * kWordSize)); |
| 1765 Register isolate_reg = RDI; |
| 1766 __ movq(isolate_reg, Address(RSP, 6 * kWordSize)); |
1764 #else | 1767 #else |
1765 Register stacktrace_reg = CallingConventions::kArg5Reg; | 1768 Register stacktrace_reg = CallingConventions::kArg5Reg; |
| 1769 Register isolate_reg = CallingConventions::kArg6Reg; |
1766 #endif | 1770 #endif |
1767 | 1771 |
1768 __ movq(RBP, CallingConventions::kArg3Reg); | 1772 __ movq(RBP, CallingConventions::kArg3Reg); |
1769 __ movq(RSP, CallingConventions::kArg2Reg); | 1773 __ movq(RSP, CallingConventions::kArg2Reg); |
1770 __ movq(kStackTraceObjectReg, stacktrace_reg); | 1774 __ movq(kStackTraceObjectReg, stacktrace_reg); |
1771 __ movq(kExceptionObjectReg, CallingConventions::kArg4Reg); | 1775 __ movq(kExceptionObjectReg, CallingConventions::kArg4Reg); |
| 1776 // Set the tag. |
| 1777 __ movq(Address(isolate_reg, Isolate::vm_tag_offset()), |
| 1778 Immediate(VMTag::kScriptTagId)); |
| 1779 // Clear top exit frame. |
| 1780 __ movq(Address(isolate_reg, Isolate::top_exit_frame_info_offset()), |
| 1781 Immediate(0)); |
1772 __ jmp(CallingConventions::kArg1Reg); // Jump to the exception handler code. | 1782 __ jmp(CallingConventions::kArg1Reg); // Jump to the exception handler code. |
1773 } | 1783 } |
1774 | 1784 |
1775 | 1785 |
1776 // Calls to the runtime to optimize the given function. | 1786 // Calls to the runtime to optimize the given function. |
1777 // RDI: function to be reoptimized. | 1787 // RDI: function to be reoptimized. |
1778 // R10: argument descriptor (preserved). | 1788 // R10: argument descriptor (preserved). |
1779 void StubCode::GenerateOptimizeFunctionStub(Assembler* assembler) { | 1789 void StubCode::GenerateOptimizeFunctionStub(Assembler* assembler) { |
1780 __ EnterStubFrame(); | 1790 __ EnterStubFrame(); |
1781 __ LoadObject(R12, Object::null_object(), PP); | 1791 __ LoadObject(R12, Object::null_object(), PP); |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1901 | 1911 |
1902 __ movq(left, Address(RSP, 2 * kWordSize)); | 1912 __ movq(left, Address(RSP, 2 * kWordSize)); |
1903 __ movq(right, Address(RSP, 1 * kWordSize)); | 1913 __ movq(right, Address(RSP, 1 * kWordSize)); |
1904 GenerateIdenticalWithNumberCheckStub(assembler, left, right); | 1914 GenerateIdenticalWithNumberCheckStub(assembler, left, right); |
1905 __ ret(); | 1915 __ ret(); |
1906 } | 1916 } |
1907 | 1917 |
1908 } // namespace dart | 1918 } // namespace dart |
1909 | 1919 |
1910 #endif // defined TARGET_ARCH_X64 | 1920 #endif // defined TARGET_ARCH_X64 |
OLD | NEW |