| 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_ARM) | 6 #if defined(TARGET_ARCH_ARM) |
| 7 | 7 |
| 8 #include "vm/assembler.h" | 8 #include "vm/assembler.h" |
| 9 #include "vm/code_generator.h" | 9 #include "vm/code_generator.h" |
| 10 #include "vm/compiler.h" | 10 #include "vm/compiler.h" |
| (...skipping 1842 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1853 // Now call the static function. The breakpoint handler function | 1853 // Now call the static function. The breakpoint handler function |
| 1854 // ensures that the call target is compiled. | 1854 // ensures that the call target is compiled. |
| 1855 __ ldr(R0, FieldAddress(R0, Code::instructions_offset())); | 1855 __ ldr(R0, FieldAddress(R0, Code::instructions_offset())); |
| 1856 __ AddImmediate(R0, Instructions::HeaderSize() - kHeapObjectTag); | 1856 __ AddImmediate(R0, Instructions::HeaderSize() - kHeapObjectTag); |
| 1857 // Load arguments descriptor into R4. | 1857 // Load arguments descriptor into R4. |
| 1858 __ ldr(R4, FieldAddress(R5, ICData::arguments_descriptor_offset())); | 1858 __ ldr(R4, FieldAddress(R5, ICData::arguments_descriptor_offset())); |
| 1859 __ bx(R0); | 1859 __ bx(R0); |
| 1860 } | 1860 } |
| 1861 | 1861 |
| 1862 | 1862 |
| 1863 // R0: return value. | |
| 1864 void StubCode::GenerateBreakpointReturnStub(Assembler* assembler) { | |
| 1865 // Create a stub frame as we are pushing some objects on the stack before | |
| 1866 // calling into the runtime. | |
| 1867 __ EnterStubFrame(); | |
| 1868 __ Push(R0); | |
| 1869 __ CallRuntime(kBreakpointReturnHandlerRuntimeEntry, 0); | |
| 1870 __ Pop(R0); | |
| 1871 __ LeaveStubFrame(); | |
| 1872 | |
| 1873 // Instead of returning to the patched Dart function, emulate the | |
| 1874 // smashed return code pattern and return to the function's caller. | |
| 1875 __ LeaveDartFrame(); | |
| 1876 __ Ret(); | |
| 1877 } | |
| 1878 | |
| 1879 | |
| 1880 // LR: return address (Dart code). | 1863 // LR: return address (Dart code). |
| 1881 // R5: inline cache data array. | 1864 // R5: inline cache data array. |
| 1882 void StubCode::GenerateBreakpointDynamicStub(Assembler* assembler) { | 1865 void StubCode::GenerateBreakpointDynamicStub(Assembler* assembler) { |
| 1883 // Create a stub frame as we are pushing some objects on the stack before | 1866 // Create a stub frame as we are pushing some objects on the stack before |
| 1884 // calling into the runtime. | 1867 // calling into the runtime. |
| 1885 __ EnterStubFrame(); | 1868 __ EnterStubFrame(); |
| 1886 __ Push(R5); | 1869 __ Push(R5); |
| 1887 __ CallRuntime(kBreakpointDynamicHandlerRuntimeEntry, 0); | 1870 __ CallRuntime(kBreakpointDynamicHandlerRuntimeEntry, 0); |
| 1888 __ Pop(R5); | 1871 __ Pop(R5); |
| 1889 __ LeaveStubFrame(); | 1872 __ LeaveStubFrame(); |
| (...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2184 const Register right = R0; | 2167 const Register right = R0; |
| 2185 __ ldr(left, Address(SP, 1 * kWordSize)); | 2168 __ ldr(left, Address(SP, 1 * kWordSize)); |
| 2186 __ ldr(right, Address(SP, 0 * kWordSize)); | 2169 __ ldr(right, Address(SP, 0 * kWordSize)); |
| 2187 GenerateIdenticalWithNumberCheckStub(assembler, left, right, temp); | 2170 GenerateIdenticalWithNumberCheckStub(assembler, left, right, temp); |
| 2188 __ Ret(); | 2171 __ Ret(); |
| 2189 } | 2172 } |
| 2190 | 2173 |
| 2191 } // namespace dart | 2174 } // namespace dart |
| 2192 | 2175 |
| 2193 #endif // defined TARGET_ARCH_ARM | 2176 #endif // defined TARGET_ARCH_ARM |
| OLD | NEW |