| 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 1831 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1842 __ pushq(R12); // Room for result. | 1842 __ pushq(R12); // Room for result. |
| 1843 __ CallRuntime(kBreakpointRuntimeHandlerRuntimeEntry, 0); | 1843 __ CallRuntime(kBreakpointRuntimeHandlerRuntimeEntry, 0); |
| 1844 __ popq(RAX); // Address of original. | 1844 __ popq(RAX); // Address of original. |
| 1845 __ popq(R10); // Restore arguments. | 1845 __ popq(R10); // Restore arguments. |
| 1846 __ popq(RBX); | 1846 __ popq(RBX); |
| 1847 __ LeaveStubFrame(); | 1847 __ LeaveStubFrame(); |
| 1848 __ jmp(RAX); // Jump to original stub. | 1848 __ jmp(RAX); // Jump to original stub. |
| 1849 } | 1849 } |
| 1850 | 1850 |
| 1851 | 1851 |
| 1852 // RBX: ICData (unoptimized static call) | |
| 1853 // TOS(0): return address (Dart code). | |
| 1854 void StubCode::GenerateBreakpointStaticStub(Assembler* assembler) { | |
| 1855 __ EnterStubFrame(); | |
| 1856 __ LoadObject(R12, Object::null_object(), PP); | |
| 1857 __ pushq(RBX); // Preserve IC data for unoptimized call. | |
| 1858 __ pushq(R12); // Room for result. | |
| 1859 __ CallRuntime(kBreakpointStaticHandlerRuntimeEntry, 0); | |
| 1860 __ popq(RAX); // Code object. | |
| 1861 __ popq(RBX); // Restore IC data. | |
| 1862 __ LeaveStubFrame(); | |
| 1863 | |
| 1864 // Load arguments descriptor into R10. | |
| 1865 __ movq(R10, FieldAddress(RBX, ICData::arguments_descriptor_offset())); | |
| 1866 // Now call the static function. The breakpoint handler function | |
| 1867 // ensures that the call target is compiled. | |
| 1868 __ movq(RBX, FieldAddress(RAX, Code::instructions_offset())); | |
| 1869 __ addq(RBX, Immediate(Instructions::HeaderSize() - kHeapObjectTag)); | |
| 1870 __ jmp(RBX); | |
| 1871 } | |
| 1872 | |
| 1873 | |
| 1874 // RBX: Inline cache data array. | 1852 // RBX: Inline cache data array. |
| 1875 // TOS(0): return address (Dart code). | 1853 // TOS(0): return address (Dart code). |
| 1876 void StubCode::GenerateBreakpointDynamicStub(Assembler* assembler) { | 1854 void StubCode::GenerateBreakpointDynamicStub(Assembler* assembler) { |
| 1877 __ EnterStubFrame(); | 1855 __ EnterStubFrame(); |
| 1878 __ pushq(RBX); | 1856 __ pushq(RBX); |
| 1879 __ CallRuntime(kBreakpointDynamicHandlerRuntimeEntry, 0); | 1857 __ CallRuntime(kBreakpointDynamicHandlerRuntimeEntry, 0); |
| 1880 __ popq(RBX); | 1858 __ popq(RBX); |
| 1881 __ LeaveStubFrame(); | 1859 __ LeaveStubFrame(); |
| 1882 | 1860 |
| 1883 // Find out which dispatch stub to call. | 1861 // Find out which dispatch stub to call. |
| (...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2179 | 2157 |
| 2180 __ movq(left, Address(RSP, 2 * kWordSize)); | 2158 __ movq(left, Address(RSP, 2 * kWordSize)); |
| 2181 __ movq(right, Address(RSP, 1 * kWordSize)); | 2159 __ movq(right, Address(RSP, 1 * kWordSize)); |
| 2182 GenerateIdenticalWithNumberCheckStub(assembler, left, right); | 2160 GenerateIdenticalWithNumberCheckStub(assembler, left, right); |
| 2183 __ ret(); | 2161 __ ret(); |
| 2184 } | 2162 } |
| 2185 | 2163 |
| 2186 } // namespace dart | 2164 } // namespace dart |
| 2187 | 2165 |
| 2188 #endif // defined TARGET_ARCH_X64 | 2166 #endif // defined TARGET_ARCH_X64 |
| OLD | NEW |