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_IA32) | 6 #if defined(TARGET_ARCH_IA32) |
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 1843 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1854 __ pushl(raw_null); // Room for result. | 1854 __ pushl(raw_null); // Room for result. |
1855 __ CallRuntime(kBreakpointRuntimeHandlerRuntimeEntry, 0); | 1855 __ CallRuntime(kBreakpointRuntimeHandlerRuntimeEntry, 0); |
1856 __ popl(EAX); // Address of original stub. | 1856 __ popl(EAX); // Address of original stub. |
1857 __ popl(EDX); // Restore arguments. | 1857 __ popl(EDX); // Restore arguments. |
1858 __ popl(ECX); | 1858 __ popl(ECX); |
1859 __ LeaveFrame(); | 1859 __ LeaveFrame(); |
1860 __ jmp(EAX); // Jump to original stub. | 1860 __ jmp(EAX); // Jump to original stub. |
1861 } | 1861 } |
1862 | 1862 |
1863 | 1863 |
1864 // ECX: ICData (unoptimized static call). | |
1865 // TOS(0): return address (Dart code). | |
1866 void StubCode::GenerateBreakpointStaticStub(Assembler* assembler) { | |
1867 // Create a stub frame as we are pushing some objects on the stack before | |
1868 // calling into the runtime. | |
1869 __ EnterStubFrame(); | |
1870 __ pushl(ECX); // Preserve ICData for unoptimized call. | |
1871 const Immediate& raw_null = | |
1872 Immediate(reinterpret_cast<intptr_t>(Object::null())); | |
1873 __ pushl(raw_null); // Room for result. | |
1874 __ CallRuntime(kBreakpointStaticHandlerRuntimeEntry, 0); | |
1875 __ popl(EAX); // Code object. | |
1876 __ popl(ECX); // Restore ICData. | |
1877 __ LeaveFrame(); | |
1878 | |
1879 // Load arguments descriptor into EDX. | |
1880 __ movl(EDX, FieldAddress(ECX, ICData::arguments_descriptor_offset())); | |
1881 // Now call the static function. The breakpoint handler function | |
1882 // ensures that the call target is compiled. | |
1883 // Note that we can't just jump to the CallStatic function stub | |
1884 // here since that stub would patch the call site with the | |
1885 // static function address. | |
1886 __ movl(ECX, FieldAddress(EAX, Code::instructions_offset())); | |
1887 __ addl(ECX, Immediate(Instructions::HeaderSize() - kHeapObjectTag)); | |
1888 __ jmp(ECX); | |
1889 } | |
1890 | |
1891 | |
1892 // ECX: Inline cache data array. | 1864 // ECX: Inline cache data array. |
1893 // TOS(0): return address (Dart code). | 1865 // TOS(0): return address (Dart code). |
1894 void StubCode::GenerateBreakpointDynamicStub(Assembler* assembler) { | 1866 void StubCode::GenerateBreakpointDynamicStub(Assembler* assembler) { |
1895 // Create a stub frame as we are pushing some objects on the stack before | 1867 // Create a stub frame as we are pushing some objects on the stack before |
1896 // calling into the runtime. | 1868 // calling into the runtime. |
1897 __ EnterStubFrame(); | 1869 __ EnterStubFrame(); |
1898 __ pushl(ECX); | 1870 __ pushl(ECX); |
1899 __ CallRuntime(kBreakpointDynamicHandlerRuntimeEntry, 0); | 1871 __ CallRuntime(kBreakpointDynamicHandlerRuntimeEntry, 0); |
1900 __ popl(ECX); | 1872 __ popl(ECX); |
1901 __ LeaveFrame(); | 1873 __ LeaveFrame(); |
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2208 const Register temp = ECX; | 2180 const Register temp = ECX; |
2209 __ movl(left, Address(ESP, 2 * kWordSize)); | 2181 __ movl(left, Address(ESP, 2 * kWordSize)); |
2210 __ movl(right, Address(ESP, 1 * kWordSize)); | 2182 __ movl(right, Address(ESP, 1 * kWordSize)); |
2211 GenerateIdenticalWithNumberCheckStub(assembler, left, right, temp); | 2183 GenerateIdenticalWithNumberCheckStub(assembler, left, right, temp); |
2212 __ ret(); | 2184 __ ret(); |
2213 } | 2185 } |
2214 | 2186 |
2215 } // namespace dart | 2187 } // namespace dart |
2216 | 2188 |
2217 #endif // defined TARGET_ARCH_IA32 | 2189 #endif // defined TARGET_ARCH_IA32 |
OLD | NEW |