Chromium Code Reviews| 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 1700 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1711 } | 1711 } |
| 1712 | 1712 |
| 1713 | 1713 |
| 1714 // Jump to the exception or error handler. | 1714 // Jump to the exception or error handler. |
| 1715 // TOS + 0: return address | 1715 // TOS + 0: return address |
| 1716 // Arg1: program counter | 1716 // Arg1: program counter |
| 1717 // Arg2: stack pointer | 1717 // Arg2: stack pointer |
| 1718 // Arg3: frame_pointer | 1718 // Arg3: frame_pointer |
| 1719 // Arg4: exception object | 1719 // Arg4: exception object |
| 1720 // Arg5: stacktrace object | 1720 // Arg5: stacktrace object |
| 1721 // Arg6: isolate | |
| 1721 // No Result. | 1722 // No Result. |
| 1722 void StubCode::GenerateJumpToExceptionHandlerStub(Assembler* assembler) { | 1723 void StubCode::GenerateJumpToExceptionHandlerStub(Assembler* assembler) { |
| 1723 ASSERT(kExceptionObjectReg == RAX); | 1724 ASSERT(kExceptionObjectReg == RAX); |
| 1724 ASSERT(kStackTraceObjectReg == RDX); | 1725 ASSERT(kStackTraceObjectReg == RDX); |
| 1725 ASSERT(CallingConventions::kArg4Reg != kStackTraceObjectReg); | 1726 ASSERT(CallingConventions::kArg4Reg != kStackTraceObjectReg); |
| 1726 ASSERT(CallingConventions::kArg1Reg != kStackTraceObjectReg); | 1727 ASSERT(CallingConventions::kArg1Reg != kStackTraceObjectReg); |
| 1727 | 1728 |
| 1728 #if defined(_WIN64) | 1729 #if defined(_WIN64) |
| 1729 Register stacktrace_reg = RBX; | 1730 Register stacktrace_reg = RBX; |
| 1730 __ movq(stacktrace_reg, Address(RSP, 5 * kWordSize)); | 1731 __ movq(stacktrace_reg, Address(RSP, 5 * kWordSize)); |
| 1732 Register isolate_reg = CTX; | |
|
regis
2014/07/14 20:00:34
You could use RAX.
Cutch
2014/07/14 21:32:07
Can't use RAX because it's used by kExceptionObjec
| |
| 1733 __ movq(isolate_reg, Address(RSP, 6 * kWordSize)); | |
| 1731 #else | 1734 #else |
| 1732 Register stacktrace_reg = CallingConventions::kArg5Reg; | 1735 Register stacktrace_reg = CallingConventions::kArg5Reg; |
| 1736 Register isolate_reg = CallingConventions::kArg6Reg; | |
| 1733 #endif | 1737 #endif |
| 1734 | 1738 |
| 1735 __ movq(RBP, CallingConventions::kArg3Reg); | 1739 __ movq(RBP, CallingConventions::kArg3Reg); |
| 1736 __ movq(RSP, CallingConventions::kArg2Reg); | 1740 __ movq(RSP, CallingConventions::kArg2Reg); |
| 1737 __ movq(kStackTraceObjectReg, stacktrace_reg); | 1741 __ movq(kStackTraceObjectReg, stacktrace_reg); |
| 1738 __ movq(kExceptionObjectReg, CallingConventions::kArg4Reg); | 1742 __ movq(kExceptionObjectReg, CallingConventions::kArg4Reg); |
| 1743 // Set the tag. | |
| 1744 __ movq(Address(isolate_reg, Isolate::vm_tag_offset()), | |
| 1745 Immediate(VMTag::kScriptTagId)); | |
| 1746 // Clear top exit frame. | |
| 1747 __ movq(Address(isolate_reg, Isolate::top_exit_frame_info_offset()), | |
| 1748 Immediate(0)); | |
| 1739 __ jmp(CallingConventions::kArg1Reg); // Jump to the exception handler code. | 1749 __ jmp(CallingConventions::kArg1Reg); // Jump to the exception handler code. |
| 1740 } | 1750 } |
| 1741 | 1751 |
| 1742 | 1752 |
| 1743 // Calls to the runtime to optimize the given function. | 1753 // Calls to the runtime to optimize the given function. |
| 1744 // RDI: function to be reoptimized. | 1754 // RDI: function to be reoptimized. |
| 1745 // R10: argument descriptor (preserved). | 1755 // R10: argument descriptor (preserved). |
| 1746 void StubCode::GenerateOptimizeFunctionStub(Assembler* assembler) { | 1756 void StubCode::GenerateOptimizeFunctionStub(Assembler* assembler) { |
| 1747 __ EnterStubFrame(); | 1757 __ EnterStubFrame(); |
| 1748 __ LoadObject(R12, Object::null_object(), PP); | 1758 __ LoadObject(R12, Object::null_object(), PP); |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1868 | 1878 |
| 1869 __ movq(left, Address(RSP, 2 * kWordSize)); | 1879 __ movq(left, Address(RSP, 2 * kWordSize)); |
| 1870 __ movq(right, Address(RSP, 1 * kWordSize)); | 1880 __ movq(right, Address(RSP, 1 * kWordSize)); |
| 1871 GenerateIdenticalWithNumberCheckStub(assembler, left, right); | 1881 GenerateIdenticalWithNumberCheckStub(assembler, left, right); |
| 1872 __ ret(); | 1882 __ ret(); |
| 1873 } | 1883 } |
| 1874 | 1884 |
| 1875 } // namespace dart | 1885 } // namespace dart |
| 1876 | 1886 |
| 1877 #endif // defined TARGET_ARCH_X64 | 1887 #endif // defined TARGET_ARCH_X64 |
| OLD | NEW |