OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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_ARM64) | 6 #if defined(TARGET_ARCH_ARM64) |
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 27 matching lines...) Expand all Loading... |
38 void StubCode::GenerateCallToRuntimeStub(Assembler* assembler) { | 38 void StubCode::GenerateCallToRuntimeStub(Assembler* assembler) { |
39 const intptr_t isolate_offset = NativeArguments::isolate_offset(); | 39 const intptr_t isolate_offset = NativeArguments::isolate_offset(); |
40 const intptr_t argc_tag_offset = NativeArguments::argc_tag_offset(); | 40 const intptr_t argc_tag_offset = NativeArguments::argc_tag_offset(); |
41 const intptr_t argv_offset = NativeArguments::argv_offset(); | 41 const intptr_t argv_offset = NativeArguments::argv_offset(); |
42 const intptr_t retval_offset = NativeArguments::retval_offset(); | 42 const intptr_t retval_offset = NativeArguments::retval_offset(); |
43 const intptr_t exitframe_last_param_slot_from_fp = 1; | 43 const intptr_t exitframe_last_param_slot_from_fp = 1; |
44 | 44 |
45 __ SetPrologueOffset(); | 45 __ SetPrologueOffset(); |
46 __ Comment("CallToRuntimeStub"); | 46 __ Comment("CallToRuntimeStub"); |
47 __ EnterFrame(0); | 47 __ EnterFrame(0); |
48 __ SmiUntag(R4); | |
49 | 48 |
50 // Load current Isolate pointer from Context structure into R0. | 49 // Load current Isolate pointer from Context structure into R0. |
51 __ LoadFieldFromOffset(R0, CTX, Context::isolate_offset(), kNoPP); | 50 __ LoadFieldFromOffset(R0, CTX, Context::isolate_offset(), kNoPP); |
52 | 51 |
53 // Save exit frame information to enable stack walking as we are about | 52 // Save exit frame information to enable stack walking as we are about |
54 // to transition to Dart VM C++ code. | 53 // to transition to Dart VM C++ code. |
55 __ StoreToOffset(SP, R0, Isolate::top_exit_frame_info_offset(), kNoPP); | 54 __ StoreToOffset(SP, R0, Isolate::top_exit_frame_info_offset(), kNoPP); |
56 | 55 |
57 // Save current Context pointer into Isolate structure. | 56 // Save current Context pointer into Isolate structure. |
58 __ StoreToOffset(CTX, R0, Isolate::top_context_offset(), kNoPP); | 57 __ StoreToOffset(CTX, R0, Isolate::top_context_offset(), kNoPP); |
(...skipping 1575 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1634 __ Pop(R5); // Restore IC Data. | 1633 __ Pop(R5); // Restore IC Data. |
1635 __ LeaveStubFrame(); | 1634 __ LeaveStubFrame(); |
1636 | 1635 |
1637 __ LoadFieldFromOffset(R2, R0, Function::instructions_offset(), kNoPP); | 1636 __ LoadFieldFromOffset(R2, R0, Function::instructions_offset(), kNoPP); |
1638 __ AddImmediate( | 1637 __ AddImmediate( |
1639 R2, R2, Instructions::HeaderSize() - kHeapObjectTag, kNoPP); | 1638 R2, R2, Instructions::HeaderSize() - kHeapObjectTag, kNoPP); |
1640 __ br(R2); | 1639 __ br(R2); |
1641 } | 1640 } |
1642 | 1641 |
1643 | 1642 |
1644 void StubCode::GenerateBreakpointRuntimeStub(Assembler* assembler) { | 1643 // R5: Contains an ICData. |
| 1644 void StubCode::GenerateICCallBreakpointStub(Assembler* assembler) { |
1645 __ EnterStubFrame(); | 1645 __ EnterStubFrame(); |
1646 __ Push(R5); // Save IC Data. | 1646 __ Push(R5); |
1647 __ Push(R4); // Save arg. desc. | |
1648 __ PushObject(Object::null_object(), PP); // Space for result. | 1647 __ PushObject(Object::null_object(), PP); // Space for result. |
1649 __ CallRuntime(kBreakpointRuntimeHandlerRuntimeEntry, 0); | 1648 __ CallRuntime(kBreakpointRuntimeHandlerRuntimeEntry, 0); |
1650 __ Pop(R0); | 1649 __ Pop(R0); |
| 1650 __ Pop(R5); |
| 1651 __ LeaveStubFrame(); |
| 1652 __ br(R0); |
| 1653 } |
| 1654 |
| 1655 |
| 1656 // R5: Contains Smi 0 (need to preserve a GC-safe value for the lazy compile |
| 1657 // stub). |
| 1658 // R4: Contains an arguments descriptor. |
| 1659 void StubCode::GenerateClosureCallBreakpointStub(Assembler* assembler) { |
| 1660 __ EnterStubFrame(); |
| 1661 __ Push(R5); |
| 1662 __ Push(R4); |
| 1663 __ PushObject(Object::null_object(), PP); // Space for result. |
| 1664 __ CallRuntime(kBreakpointRuntimeHandlerRuntimeEntry, 0); |
| 1665 __ Pop(R0); |
1651 __ Pop(R4); | 1666 __ Pop(R4); |
1652 __ Pop(R5); | 1667 __ Pop(R5); |
1653 __ LeaveStubFrame(); | 1668 __ LeaveStubFrame(); |
1654 __ br(R0); | 1669 __ br(R0); |
1655 } | 1670 } |
1656 | 1671 |
1657 | 1672 |
| 1673 void StubCode::GenerateRuntimeCallBreakpointStub(Assembler* assembler) { |
| 1674 __ EnterStubFrame(); |
| 1675 __ PushObject(Object::null_object(), PP); // Space for result. |
| 1676 __ CallRuntime(kBreakpointRuntimeHandlerRuntimeEntry, 0); |
| 1677 __ Pop(R0); |
| 1678 __ LeaveStubFrame(); |
| 1679 __ br(R0); |
| 1680 } |
| 1681 |
1658 // Called only from unoptimized code. All relevant registers have been saved. | 1682 // Called only from unoptimized code. All relevant registers have been saved. |
1659 void StubCode::GenerateDebugStepCheckStub( | 1683 void StubCode::GenerateDebugStepCheckStub( |
1660 Assembler* assembler) { | 1684 Assembler* assembler) { |
1661 if (FLAG_enable_debugger) { | 1685 if (FLAG_enable_debugger) { |
1662 // Check single stepping. | 1686 // Check single stepping. |
1663 Label not_stepping; | 1687 Label not_stepping; |
1664 __ LoadFieldFromOffset(R1, CTX, Context::isolate_offset(), kNoPP); | 1688 __ LoadFieldFromOffset(R1, CTX, Context::isolate_offset(), kNoPP); |
1665 __ LoadFromOffset( | 1689 __ LoadFromOffset( |
1666 R1, R1, Isolate::single_step_offset(), kNoPP, kUnsignedByte); | 1690 R1, R1, Isolate::single_step_offset(), kNoPP, kUnsignedByte); |
1667 __ CompareImmediate(R1, 0, kNoPP); | 1691 __ CompareImmediate(R1, 0, kNoPP); |
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1937 const Register right = R0; | 1961 const Register right = R0; |
1938 __ LoadFromOffset(left, SP, 1 * kWordSize, kNoPP); | 1962 __ LoadFromOffset(left, SP, 1 * kWordSize, kNoPP); |
1939 __ LoadFromOffset(right, SP, 0 * kWordSize, kNoPP); | 1963 __ LoadFromOffset(right, SP, 0 * kWordSize, kNoPP); |
1940 GenerateIdenticalWithNumberCheckStub(assembler, left, right, temp); | 1964 GenerateIdenticalWithNumberCheckStub(assembler, left, right, temp); |
1941 __ ret(); | 1965 __ ret(); |
1942 } | 1966 } |
1943 | 1967 |
1944 } // namespace dart | 1968 } // namespace dart |
1945 | 1969 |
1946 #endif // defined TARGET_ARCH_ARM64 | 1970 #endif // defined TARGET_ARCH_ARM64 |
OLD | NEW |