| 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: Inline cache data array. | |
| 1865 // TOS(0): return address (Dart code). | |
| 1866 void StubCode::GenerateBreakpointDynamicStub(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); | |
| 1871 __ CallRuntime(kBreakpointDynamicHandlerRuntimeEntry, 0); | |
| 1872 __ popl(ECX); | |
| 1873 __ LeaveFrame(); | |
| 1874 | |
| 1875 // Find out which dispatch stub to call. | |
| 1876 Label test_two, test_three, test_four; | |
| 1877 __ movl(EBX, FieldAddress(ECX, ICData::num_args_tested_offset())); | |
| 1878 __ cmpl(EBX, Immediate(1)); | |
| 1879 __ j(NOT_EQUAL, &test_two, Assembler::kNearJump); | |
| 1880 __ jmp(&StubCode::OneArgCheckInlineCacheLabel()); | |
| 1881 __ Bind(&test_two); | |
| 1882 __ cmpl(EBX, Immediate(2)); | |
| 1883 __ j(NOT_EQUAL, &test_three, Assembler::kNearJump); | |
| 1884 __ jmp(&StubCode::TwoArgsCheckInlineCacheLabel()); | |
| 1885 __ Bind(&test_three); | |
| 1886 __ cmpl(EBX, Immediate(3)); | |
| 1887 __ j(NOT_EQUAL, &test_four, Assembler::kNearJump); | |
| 1888 __ jmp(&StubCode::ThreeArgsCheckInlineCacheLabel()); | |
| 1889 __ Bind(&test_four); | |
| 1890 __ Stop("Unsupported number of arguments tested."); | |
| 1891 } | |
| 1892 | |
| 1893 | |
| 1894 // Called only from unoptimized code. | 1864 // Called only from unoptimized code. |
| 1895 void StubCode::GenerateDebugStepCheckStub(Assembler* assembler) { | 1865 void StubCode::GenerateDebugStepCheckStub(Assembler* assembler) { |
| 1896 // Check single stepping. | 1866 // Check single stepping. |
| 1897 Label not_stepping; | 1867 Label not_stepping; |
| 1898 __ movl(EAX, FieldAddress(CTX, Context::isolate_offset())); | 1868 __ movl(EAX, FieldAddress(CTX, Context::isolate_offset())); |
| 1899 __ movzxb(EAX, Address(EAX, Isolate::single_step_offset())); | 1869 __ movzxb(EAX, Address(EAX, Isolate::single_step_offset())); |
| 1900 __ cmpl(EAX, Immediate(0)); | 1870 __ cmpl(EAX, Immediate(0)); |
| 1901 __ j(EQUAL, ¬_stepping, Assembler::kNearJump); | 1871 __ j(EQUAL, ¬_stepping, Assembler::kNearJump); |
| 1902 | 1872 |
| 1903 __ EnterStubFrame(); | 1873 __ EnterStubFrame(); |
| (...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2180 const Register temp = ECX; | 2150 const Register temp = ECX; |
| 2181 __ movl(left, Address(ESP, 2 * kWordSize)); | 2151 __ movl(left, Address(ESP, 2 * kWordSize)); |
| 2182 __ movl(right, Address(ESP, 1 * kWordSize)); | 2152 __ movl(right, Address(ESP, 1 * kWordSize)); |
| 2183 GenerateIdenticalWithNumberCheckStub(assembler, left, right, temp); | 2153 GenerateIdenticalWithNumberCheckStub(assembler, left, right, temp); |
| 2184 __ ret(); | 2154 __ ret(); |
| 2185 } | 2155 } |
| 2186 | 2156 |
| 2187 } // namespace dart | 2157 } // namespace dart |
| 2188 | 2158 |
| 2189 #endif // defined TARGET_ARCH_IA32 | 2159 #endif // defined TARGET_ARCH_IA32 |
| OLD | NEW |