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/cpu.h" | 10 #include "vm/cpu.h" |
(...skipping 28 matching lines...) Expand all Loading... |
39 void StubCode::GenerateCallToRuntimeStub(Assembler* assembler) { | 39 void StubCode::GenerateCallToRuntimeStub(Assembler* assembler) { |
40 const intptr_t isolate_offset = NativeArguments::isolate_offset(); | 40 const intptr_t isolate_offset = NativeArguments::isolate_offset(); |
41 const intptr_t argc_tag_offset = NativeArguments::argc_tag_offset(); | 41 const intptr_t argc_tag_offset = NativeArguments::argc_tag_offset(); |
42 const intptr_t argv_offset = NativeArguments::argv_offset(); | 42 const intptr_t argv_offset = NativeArguments::argv_offset(); |
43 const intptr_t retval_offset = NativeArguments::retval_offset(); | 43 const intptr_t retval_offset = NativeArguments::retval_offset(); |
44 const intptr_t exitframe_last_param_slot_from_fp = 2; | 44 const intptr_t exitframe_last_param_slot_from_fp = 2; |
45 | 45 |
46 __ mov(IP, Operand(0)); | 46 __ mov(IP, Operand(0)); |
47 __ Push(IP); // Push 0 for the PC marker. | 47 __ Push(IP); // Push 0 for the PC marker. |
48 __ EnterFrame((1 << FP) | (1 << LR), 0); | 48 __ EnterFrame((1 << FP) | (1 << LR), 0); |
49 __ SmiUntag(R4); | |
50 | 49 |
51 // Load current Isolate pointer from Context structure into R0. | 50 // Load current Isolate pointer from Context structure into R0. |
52 __ ldr(R0, FieldAddress(CTX, Context::isolate_offset())); | 51 __ ldr(R0, FieldAddress(CTX, Context::isolate_offset())); |
53 | 52 |
54 // Save exit frame information to enable stack walking as we are about | 53 // Save exit frame information to enable stack walking as we are about |
55 // to transition to Dart VM C++ code. | 54 // to transition to Dart VM C++ code. |
56 __ StoreToOffset(kWord, SP, R0, Isolate::top_exit_frame_info_offset()); | 55 __ StoreToOffset(kWord, SP, R0, Isolate::top_exit_frame_info_offset()); |
57 | 56 |
58 // Save current Context pointer into Isolate structure. | 57 // Save current Context pointer into Isolate structure. |
59 __ StoreToOffset(kWord, CTX, R0, Isolate::top_context_offset()); | 58 __ StoreToOffset(kWord, CTX, R0, Isolate::top_context_offset()); |
(...skipping 1469 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1529 __ Pop(R0); // Restore argument. | 1528 __ Pop(R0); // Restore argument. |
1530 __ PopList((1 << R4) | (1 << R5)); // Restore arg desc. and IC data. | 1529 __ PopList((1 << R4) | (1 << R5)); // Restore arg desc. and IC data. |
1531 __ LeaveStubFrame(); | 1530 __ LeaveStubFrame(); |
1532 | 1531 |
1533 __ ldr(R2, FieldAddress(R0, Function::instructions_offset())); | 1532 __ ldr(R2, FieldAddress(R0, Function::instructions_offset())); |
1534 __ AddImmediate(R2, Instructions::HeaderSize() - kHeapObjectTag); | 1533 __ AddImmediate(R2, Instructions::HeaderSize() - kHeapObjectTag); |
1535 __ bx(R2); | 1534 __ bx(R2); |
1536 } | 1535 } |
1537 | 1536 |
1538 | 1537 |
1539 void StubCode::GenerateBreakpointRuntimeStub(Assembler* assembler) { | 1538 // R5: Contains an ICData. |
| 1539 void StubCode::GenerateICCallBreakpointStub(Assembler* assembler) { |
1540 __ EnterStubFrame(); | 1540 __ EnterStubFrame(); |
1541 __ LoadImmediate(R0, reinterpret_cast<intptr_t>(Object::null())); | 1541 __ LoadImmediate(R0, reinterpret_cast<intptr_t>(Object::null())); |
1542 // Preserve arguments descriptor and make room for result. | 1542 // Preserve arguments descriptor and make room for result. |
| 1543 __ PushList((1 << R0) | (1 << R5)); |
| 1544 __ CallRuntime(kBreakpointRuntimeHandlerRuntimeEntry, 0); |
| 1545 __ PopList((1 << R0) | (1 << R5)); |
| 1546 __ LeaveStubFrame(); |
| 1547 __ bx(R0); |
| 1548 } |
| 1549 |
| 1550 |
| 1551 // R5: Contains Smi 0 (need to preserve a GC-safe value for the lazy compile |
| 1552 // stub). |
| 1553 // R4: Contains an arguments descriptor. |
| 1554 void StubCode::GenerateClosureCallBreakpointStub(Assembler* assembler) { |
| 1555 __ EnterStubFrame(); |
| 1556 __ LoadImmediate(R0, reinterpret_cast<intptr_t>(Object::null())); |
| 1557 // Preserve arguments descriptor and make room for result. |
1543 __ PushList((1 << R0) | (1 << R4) | (1 << R5)); | 1558 __ PushList((1 << R0) | (1 << R4) | (1 << R5)); |
1544 __ CallRuntime(kBreakpointRuntimeHandlerRuntimeEntry, 0); | 1559 __ CallRuntime(kBreakpointRuntimeHandlerRuntimeEntry, 0); |
1545 __ PopList((1 << R0) | (1 << R4) | (1 << R5)); | 1560 __ PopList((1 << R0) | (1 << R4) | (1 << R5)); |
1546 __ LeaveStubFrame(); | 1561 __ LeaveStubFrame(); |
1547 __ bx(R0); | 1562 __ bx(R0); |
1548 } | 1563 } |
1549 | 1564 |
1550 | 1565 |
| 1566 void StubCode::GenerateRuntimeCallBreakpointStub(Assembler* assembler) { |
| 1567 __ EnterStubFrame(); |
| 1568 __ LoadImmediate(R0, reinterpret_cast<intptr_t>(Object::null())); |
| 1569 // Make room for result. |
| 1570 __ PushList((1 << R0)); |
| 1571 __ CallRuntime(kBreakpointRuntimeHandlerRuntimeEntry, 0); |
| 1572 __ PopList((1 << R0)); |
| 1573 __ LeaveStubFrame(); |
| 1574 __ bx(R0); |
| 1575 } |
| 1576 |
| 1577 |
1551 // Called only from unoptimized code. All relevant registers have been saved. | 1578 // Called only from unoptimized code. All relevant registers have been saved. |
1552 void StubCode::GenerateDebugStepCheckStub( | 1579 void StubCode::GenerateDebugStepCheckStub( |
1553 Assembler* assembler) { | 1580 Assembler* assembler) { |
1554 if (FLAG_enable_debugger) { | 1581 if (FLAG_enable_debugger) { |
1555 // Check single stepping. | 1582 // Check single stepping. |
1556 Label not_stepping; | 1583 Label not_stepping; |
1557 __ ldr(R1, FieldAddress(CTX, Context::isolate_offset())); | 1584 __ ldr(R1, FieldAddress(CTX, Context::isolate_offset())); |
1558 __ ldrb(R1, Address(R1, Isolate::single_step_offset())); | 1585 __ ldrb(R1, Address(R1, Isolate::single_step_offset())); |
1559 __ CompareImmediate(R1, 0); | 1586 __ CompareImmediate(R1, 0); |
1560 __ b(¬_stepping, EQ); | 1587 __ b(¬_stepping, EQ); |
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1837 const Register right = R0; | 1864 const Register right = R0; |
1838 __ ldr(left, Address(SP, 1 * kWordSize)); | 1865 __ ldr(left, Address(SP, 1 * kWordSize)); |
1839 __ ldr(right, Address(SP, 0 * kWordSize)); | 1866 __ ldr(right, Address(SP, 0 * kWordSize)); |
1840 GenerateIdenticalWithNumberCheckStub(assembler, left, right, temp); | 1867 GenerateIdenticalWithNumberCheckStub(assembler, left, right, temp); |
1841 __ Ret(); | 1868 __ Ret(); |
1842 } | 1869 } |
1843 | 1870 |
1844 } // namespace dart | 1871 } // namespace dart |
1845 | 1872 |
1846 #endif // defined TARGET_ARCH_ARM | 1873 #endif // defined TARGET_ARCH_ARM |
OLD | NEW |