| 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 1568 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1627 __ Pop(R5); // Restore IC Data. | 1626 __ Pop(R5); // Restore IC Data. |
| 1628 __ LeaveStubFrame(); | 1627 __ LeaveStubFrame(); |
| 1629 | 1628 |
| 1630 __ LoadFieldFromOffset(R2, R0, Function::instructions_offset(), kNoPP); | 1629 __ LoadFieldFromOffset(R2, R0, Function::instructions_offset(), kNoPP); |
| 1631 __ AddImmediate( | 1630 __ AddImmediate( |
| 1632 R2, R2, Instructions::HeaderSize() - kHeapObjectTag, kNoPP); | 1631 R2, R2, Instructions::HeaderSize() - kHeapObjectTag, kNoPP); |
| 1633 __ br(R2); | 1632 __ br(R2); |
| 1634 } | 1633 } |
| 1635 | 1634 |
| 1636 | 1635 |
| 1637 void StubCode::GenerateBreakpointRuntimeStub(Assembler* assembler) { | 1636 // R5: Contains an ICData. |
| 1637 void StubCode::GenerateICCallBreakpointStub(Assembler* assembler) { |
| 1638 __ EnterStubFrame(); | 1638 __ EnterStubFrame(); |
| 1639 __ Push(R5); // Save IC Data. | 1639 __ Push(R5); |
| 1640 __ Push(R4); // Save arg. desc. | |
| 1641 __ PushObject(Object::null_object(), PP); // Space for result. | 1640 __ PushObject(Object::null_object(), PP); // Space for result. |
| 1642 __ CallRuntime(kBreakpointRuntimeHandlerRuntimeEntry, 0); | 1641 __ CallRuntime(kBreakpointRuntimeHandlerRuntimeEntry, 0); |
| 1643 __ Pop(R0); | 1642 __ Pop(R0); |
| 1643 __ Pop(R5); |
| 1644 __ LeaveStubFrame(); |
| 1645 __ br(R0); |
| 1646 } |
| 1647 |
| 1648 |
| 1649 // R5: Contains Smi 0 (need to preserve a GC-safe value for the lazy compile |
| 1650 // stub). |
| 1651 // R4: Contains an arguments descriptor. |
| 1652 void StubCode::GenerateClosureCallBreakpointStub(Assembler* assembler) { |
| 1653 __ EnterStubFrame(); |
| 1654 __ Push(R5); |
| 1655 __ Push(R4); |
| 1656 __ PushObject(Object::null_object(), PP); // Space for result. |
| 1657 __ CallRuntime(kBreakpointRuntimeHandlerRuntimeEntry, 0); |
| 1658 __ Pop(R0); |
| 1644 __ Pop(R4); | 1659 __ Pop(R4); |
| 1645 __ Pop(R5); | 1660 __ Pop(R5); |
| 1646 __ LeaveStubFrame(); | 1661 __ LeaveStubFrame(); |
| 1647 __ br(R0); | 1662 __ br(R0); |
| 1648 } | 1663 } |
| 1649 | 1664 |
| 1650 | 1665 |
| 1666 // R5: Garbage or function address. |
| 1667 // R4: Garbage or raw argument count. |
| 1668 void StubCode::GenerateRuntimeCallBreakpointStub(Assembler* assembler) { |
| 1669 __ EnterStubFrame(); |
| 1670 __ AndImmediate(R5, R5, ~kSmiTagMask, kNoPP); |
| 1671 __ Push(R5); |
| 1672 __ SmiTag(R4); |
| 1673 __ Push(R4); |
| 1674 __ PushObject(Object::null_object(), PP); // Space for result. |
| 1675 __ CallRuntime(kBreakpointRuntimeHandlerRuntimeEntry, 0); |
| 1676 __ Pop(R0); |
| 1677 __ Pop(R4); |
| 1678 __ SmiUntag(R4); |
| 1679 __ Pop(R5); |
| 1680 __ LeaveStubFrame(); |
| 1681 __ br(R0); |
| 1682 } |
| 1683 |
| 1651 // Called only from unoptimized code. All relevant registers have been saved. | 1684 // Called only from unoptimized code. All relevant registers have been saved. |
| 1652 void StubCode::GenerateDebugStepCheckStub( | 1685 void StubCode::GenerateDebugStepCheckStub( |
| 1653 Assembler* assembler) { | 1686 Assembler* assembler) { |
| 1654 if (FLAG_enable_debugger) { | 1687 if (FLAG_enable_debugger) { |
| 1655 // Check single stepping. | 1688 // Check single stepping. |
| 1656 Label not_stepping; | 1689 Label not_stepping; |
| 1657 __ LoadFieldFromOffset(R1, CTX, Context::isolate_offset(), kNoPP); | 1690 __ LoadFieldFromOffset(R1, CTX, Context::isolate_offset(), kNoPP); |
| 1658 __ LoadFromOffset( | 1691 __ LoadFromOffset( |
| 1659 R1, R1, Isolate::single_step_offset(), kNoPP, kUnsignedByte); | 1692 R1, R1, Isolate::single_step_offset(), kNoPP, kUnsignedByte); |
| 1660 __ CompareImmediate(R1, 0, kNoPP); | 1693 __ CompareImmediate(R1, 0, kNoPP); |
| (...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1930 const Register right = R0; | 1963 const Register right = R0; |
| 1931 __ LoadFromOffset(left, SP, 1 * kWordSize, kNoPP); | 1964 __ LoadFromOffset(left, SP, 1 * kWordSize, kNoPP); |
| 1932 __ LoadFromOffset(right, SP, 0 * kWordSize, kNoPP); | 1965 __ LoadFromOffset(right, SP, 0 * kWordSize, kNoPP); |
| 1933 GenerateIdenticalWithNumberCheckStub(assembler, left, right, temp); | 1966 GenerateIdenticalWithNumberCheckStub(assembler, left, right, temp); |
| 1934 __ ret(); | 1967 __ ret(); |
| 1935 } | 1968 } |
| 1936 | 1969 |
| 1937 } // namespace dart | 1970 } // namespace dart |
| 1938 | 1971 |
| 1939 #endif // defined TARGET_ARCH_ARM64 | 1972 #endif // defined TARGET_ARCH_ARM64 |
| OLD | NEW |