| 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 1744 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1755 __ LoadObject(R12, Object::null_object(), PP); | 1755 __ LoadObject(R12, Object::null_object(), PP); |
| 1756 __ pushq(R12); // Room for result. | 1756 __ pushq(R12); // Room for result. |
| 1757 __ CallRuntime(kBreakpointRuntimeHandlerRuntimeEntry, 0); | 1757 __ CallRuntime(kBreakpointRuntimeHandlerRuntimeEntry, 0); |
| 1758 __ popq(RAX); // Address of original. | 1758 __ popq(RAX); // Address of original. |
| 1759 __ popq(RBX); // Restore IC data. | 1759 __ popq(RBX); // Restore IC data. |
| 1760 __ LeaveStubFrame(); | 1760 __ LeaveStubFrame(); |
| 1761 __ jmp(RAX); // Jump to original stub. | 1761 __ jmp(RAX); // Jump to original stub. |
| 1762 } | 1762 } |
| 1763 | 1763 |
| 1764 | 1764 |
| 1765 // RBX: Contains Smi 0 (need to preserve a GC-safe value for the lazy compile | |
| 1766 // stub). | |
| 1767 // R10: Contains an arguments descriptor. | |
| 1768 // TOS(0): return address (Dart code). | |
| 1769 void StubCode::GenerateClosureCallBreakpointStub(Assembler* assembler) { | |
| 1770 __ EnterStubFrame(); | |
| 1771 // Preserve runtime args. | |
| 1772 __ pushq(RBX); | |
| 1773 __ pushq(R10); | |
| 1774 // Room for result. Debugger stub returns address of the | |
| 1775 // unpatched runtime stub. | |
| 1776 __ LoadObject(R12, Object::null_object(), PP); | |
| 1777 __ pushq(R12); // Room for result. | |
| 1778 __ CallRuntime(kBreakpointRuntimeHandlerRuntimeEntry, 0); | |
| 1779 __ popq(RAX); // Address of original. | |
| 1780 __ popq(R10); // Restore arguments. | |
| 1781 __ popq(RBX); | |
| 1782 __ LeaveStubFrame(); | |
| 1783 __ jmp(RAX); // Jump to original stub. | |
| 1784 } | |
| 1785 | |
| 1786 | |
| 1787 // TOS(0): return address (Dart code). | 1765 // TOS(0): return address (Dart code). |
| 1788 void StubCode::GenerateRuntimeCallBreakpointStub(Assembler* assembler) { | 1766 void StubCode::GenerateRuntimeCallBreakpointStub(Assembler* assembler) { |
| 1789 __ EnterStubFrame(); | 1767 __ EnterStubFrame(); |
| 1790 // Room for result. Debugger stub returns address of the | 1768 // Room for result. Debugger stub returns address of the |
| 1791 // unpatched runtime stub. | 1769 // unpatched runtime stub. |
| 1792 __ LoadObject(R12, Object::null_object(), PP); | 1770 __ LoadObject(R12, Object::null_object(), PP); |
| 1793 __ pushq(R12); // Room for result. | 1771 __ pushq(R12); // Room for result. |
| 1794 __ CallRuntime(kBreakpointRuntimeHandlerRuntimeEntry, 0); | 1772 __ CallRuntime(kBreakpointRuntimeHandlerRuntimeEntry, 0); |
| 1795 __ popq(RAX); // Address of original. | 1773 __ popq(RAX); // Address of original. |
| 1796 __ LeaveStubFrame(); | 1774 __ LeaveStubFrame(); |
| (...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2161 // Result: | 2139 // Result: |
| 2162 // RCX: entry point. | 2140 // RCX: entry point. |
| 2163 void StubCode::GenerateMegamorphicLookupStub(Assembler* assembler) { | 2141 void StubCode::GenerateMegamorphicLookupStub(Assembler* assembler) { |
| 2164 EmitMegamorphicLookup(assembler, RDI, RBX, RCX); | 2142 EmitMegamorphicLookup(assembler, RDI, RBX, RCX); |
| 2165 __ ret(); | 2143 __ ret(); |
| 2166 } | 2144 } |
| 2167 | 2145 |
| 2168 } // namespace dart | 2146 } // namespace dart |
| 2169 | 2147 |
| 2170 #endif // defined TARGET_ARCH_X64 | 2148 #endif // defined TARGET_ARCH_X64 |
| OLD | NEW |