| 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 1871 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1882 // ensures that the call target is compiled. | 1882 // ensures that the call target is compiled. |
| 1883 // Note that we can't just jump to the CallStatic function stub | 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 | 1884 // here since that stub would patch the call site with the |
| 1885 // static function address. | 1885 // static function address. |
| 1886 __ movl(ECX, FieldAddress(EAX, Code::instructions_offset())); | 1886 __ movl(ECX, FieldAddress(EAX, Code::instructions_offset())); |
| 1887 __ addl(ECX, Immediate(Instructions::HeaderSize() - kHeapObjectTag)); | 1887 __ addl(ECX, Immediate(Instructions::HeaderSize() - kHeapObjectTag)); |
| 1888 __ jmp(ECX); | 1888 __ jmp(ECX); |
| 1889 } | 1889 } |
| 1890 | 1890 |
| 1891 | 1891 |
| 1892 // TOS(0): return address (Dart code). | |
| 1893 void StubCode::GenerateBreakpointReturnStub(Assembler* assembler) { | |
| 1894 // Create a stub frame as we are pushing some objects on the stack before | |
| 1895 // calling into the runtime. | |
| 1896 __ EnterStubFrame(); | |
| 1897 __ pushl(EAX); | |
| 1898 __ CallRuntime(kBreakpointReturnHandlerRuntimeEntry, 0); | |
| 1899 __ popl(EAX); | |
| 1900 __ LeaveFrame(); | |
| 1901 | |
| 1902 // Instead of returning to the patched Dart function, emulate the | |
| 1903 // smashed return code pattern and return to the function's caller. | |
| 1904 __ popl(ECX); // Discard return address to patched dart code. | |
| 1905 // Execute function epilog code that was smashed in the Dart code. | |
| 1906 __ LeaveFrame(); | |
| 1907 __ ret(); | |
| 1908 } | |
| 1909 | |
| 1910 | |
| 1911 // ECX: Inline cache data array. | 1892 // ECX: Inline cache data array. |
| 1912 // TOS(0): return address (Dart code). | 1893 // TOS(0): return address (Dart code). |
| 1913 void StubCode::GenerateBreakpointDynamicStub(Assembler* assembler) { | 1894 void StubCode::GenerateBreakpointDynamicStub(Assembler* assembler) { |
| 1914 // Create a stub frame as we are pushing some objects on the stack before | 1895 // Create a stub frame as we are pushing some objects on the stack before |
| 1915 // calling into the runtime. | 1896 // calling into the runtime. |
| 1916 __ EnterStubFrame(); | 1897 __ EnterStubFrame(); |
| 1917 __ pushl(ECX); | 1898 __ pushl(ECX); |
| 1918 __ CallRuntime(kBreakpointDynamicHandlerRuntimeEntry, 0); | 1899 __ CallRuntime(kBreakpointDynamicHandlerRuntimeEntry, 0); |
| 1919 __ popl(ECX); | 1900 __ popl(ECX); |
| 1920 __ LeaveFrame(); | 1901 __ LeaveFrame(); |
| (...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2227 const Register temp = ECX; | 2208 const Register temp = ECX; |
| 2228 __ movl(left, Address(ESP, 2 * kWordSize)); | 2209 __ movl(left, Address(ESP, 2 * kWordSize)); |
| 2229 __ movl(right, Address(ESP, 1 * kWordSize)); | 2210 __ movl(right, Address(ESP, 1 * kWordSize)); |
| 2230 GenerateIdenticalWithNumberCheckStub(assembler, left, right, temp); | 2211 GenerateIdenticalWithNumberCheckStub(assembler, left, right, temp); |
| 2231 __ ret(); | 2212 __ ret(); |
| 2232 } | 2213 } |
| 2233 | 2214 |
| 2234 } // namespace dart | 2215 } // namespace dart |
| 2235 | 2216 |
| 2236 #endif // defined TARGET_ARCH_IA32 | 2217 #endif // defined TARGET_ARCH_IA32 |
| OLD | NEW |