OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #if V8_TARGET_ARCH_ARM64 | 7 #if V8_TARGET_ARCH_ARM64 |
8 | 8 |
9 #include "src/bootstrapper.h" | 9 #include "src/bootstrapper.h" |
10 #include "src/code-stubs.h" | 10 #include "src/code-stubs.h" |
(...skipping 1667 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1678 // Reload true/false because they were clobbered in the builtin call. | 1678 // Reload true/false because they were clobbered in the builtin call. |
1679 __ LoadTrueFalseRoots(res_true, res_false); | 1679 __ LoadTrueFalseRoots(res_true, res_false); |
1680 __ Cmp(result, 0); | 1680 __ Cmp(result, 0); |
1681 __ Csel(result, res_true, res_false, eq); | 1681 __ Csel(result, res_true, res_false, eq); |
1682 } | 1682 } |
1683 __ Ret(); | 1683 __ Ret(); |
1684 } | 1684 } |
1685 | 1685 |
1686 | 1686 |
1687 void ArgumentsAccessStub::GenerateReadElement(MacroAssembler* masm) { | 1687 void ArgumentsAccessStub::GenerateReadElement(MacroAssembler* masm) { |
1688 CHECK(!has_new_target()); | |
1689 Register arg_count = ArgumentsAccessReadDescriptor::parameter_count(); | 1688 Register arg_count = ArgumentsAccessReadDescriptor::parameter_count(); |
1690 Register key = ArgumentsAccessReadDescriptor::index(); | 1689 Register key = ArgumentsAccessReadDescriptor::index(); |
1691 DCHECK(arg_count.is(x0)); | 1690 DCHECK(arg_count.is(x0)); |
1692 DCHECK(key.is(x1)); | 1691 DCHECK(key.is(x1)); |
1693 | 1692 |
1694 // The displacement is the offset of the last parameter (if any) relative | 1693 // The displacement is the offset of the last parameter (if any) relative |
1695 // to the frame pointer. | 1694 // to the frame pointer. |
1696 static const int kDisplacement = | 1695 static const int kDisplacement = |
1697 StandardFrameConstants::kCallerSPOffset - kPointerSize; | 1696 StandardFrameConstants::kCallerSPOffset - kPointerSize; |
1698 | 1697 |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1735 __ TailCallRuntime(Runtime::kGetArgumentsProperty, 1, 1); | 1734 __ TailCallRuntime(Runtime::kGetArgumentsProperty, 1, 1); |
1736 } | 1735 } |
1737 | 1736 |
1738 | 1737 |
1739 void ArgumentsAccessStub::GenerateNewSloppySlow(MacroAssembler* masm) { | 1738 void ArgumentsAccessStub::GenerateNewSloppySlow(MacroAssembler* masm) { |
1740 // Stack layout on entry. | 1739 // Stack layout on entry. |
1741 // jssp[0]: number of parameters (tagged) | 1740 // jssp[0]: number of parameters (tagged) |
1742 // jssp[8]: address of receiver argument | 1741 // jssp[8]: address of receiver argument |
1743 // jssp[16]: function | 1742 // jssp[16]: function |
1744 | 1743 |
1745 CHECK(!has_new_target()); | |
1746 | |
1747 // Check if the calling frame is an arguments adaptor frame. | 1744 // Check if the calling frame is an arguments adaptor frame. |
1748 Label runtime; | 1745 Label runtime; |
1749 Register caller_fp = x10; | 1746 Register caller_fp = x10; |
1750 __ Ldr(caller_fp, MemOperand(fp, StandardFrameConstants::kCallerFPOffset)); | 1747 __ Ldr(caller_fp, MemOperand(fp, StandardFrameConstants::kCallerFPOffset)); |
1751 // Load and untag the context. | 1748 // Load and untag the context. |
1752 __ Ldr(w11, UntagSmiMemOperand(caller_fp, | 1749 __ Ldr(w11, UntagSmiMemOperand(caller_fp, |
1753 StandardFrameConstants::kContextOffset)); | 1750 StandardFrameConstants::kContextOffset)); |
1754 __ Cmp(w11, StackFrame::ARGUMENTS_ADAPTOR); | 1751 __ Cmp(w11, StackFrame::ARGUMENTS_ADAPTOR); |
1755 __ B(ne, &runtime); | 1752 __ B(ne, &runtime); |
1756 | 1753 |
(...skipping 11 matching lines...) Expand all Loading... |
1768 | 1765 |
1769 | 1766 |
1770 void ArgumentsAccessStub::GenerateNewSloppyFast(MacroAssembler* masm) { | 1767 void ArgumentsAccessStub::GenerateNewSloppyFast(MacroAssembler* masm) { |
1771 // Stack layout on entry. | 1768 // Stack layout on entry. |
1772 // jssp[0]: number of parameters (tagged) | 1769 // jssp[0]: number of parameters (tagged) |
1773 // jssp[8]: address of receiver argument | 1770 // jssp[8]: address of receiver argument |
1774 // jssp[16]: function | 1771 // jssp[16]: function |
1775 // | 1772 // |
1776 // Returns pointer to result object in x0. | 1773 // Returns pointer to result object in x0. |
1777 | 1774 |
1778 CHECK(!has_new_target()); | |
1779 | |
1780 // Note: arg_count_smi is an alias of param_count_smi. | 1775 // Note: arg_count_smi is an alias of param_count_smi. |
1781 Register arg_count_smi = x3; | 1776 Register arg_count_smi = x3; |
1782 Register param_count_smi = x3; | 1777 Register param_count_smi = x3; |
1783 Register param_count = x7; | 1778 Register param_count = x7; |
1784 Register recv_arg = x14; | 1779 Register recv_arg = x14; |
1785 Register function = x4; | 1780 Register function = x4; |
1786 __ Pop(param_count_smi, recv_arg, function); | 1781 __ Pop(param_count_smi, recv_arg, function); |
1787 __ SmiUntag(param_count, param_count_smi); | 1782 __ SmiUntag(param_count, param_count_smi); |
1788 | 1783 |
1789 // Check if the calling frame is an arguments adaptor frame. | 1784 // Check if the calling frame is an arguments adaptor frame. |
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2096 // x2 params pointer to parameters | 2091 // x2 params pointer to parameters |
2097 // x3 function function pointer | 2092 // x3 function function pointer |
2098 // x11 caller_fp caller's frame pointer | 2093 // x11 caller_fp caller's frame pointer |
2099 // x13 param_count number of parameters passed to function | 2094 // x13 param_count number of parameters passed to function |
2100 | 2095 |
2101 // Patch the argument length and parameters pointer. | 2096 // Patch the argument length and parameters pointer. |
2102 __ Ldr(param_count_smi, | 2097 __ Ldr(param_count_smi, |
2103 MemOperand(caller_fp, | 2098 MemOperand(caller_fp, |
2104 ArgumentsAdaptorFrameConstants::kLengthOffset)); | 2099 ArgumentsAdaptorFrameConstants::kLengthOffset)); |
2105 __ SmiUntag(param_count, param_count_smi); | 2100 __ SmiUntag(param_count, param_count_smi); |
2106 if (has_new_target()) { | |
2107 __ Cmp(param_count, Operand(0)); | |
2108 Label skip_decrement; | |
2109 __ B(eq, &skip_decrement); | |
2110 // Skip new.target: it is not a part of arguments. | |
2111 __ Sub(param_count, param_count, Operand(1)); | |
2112 __ SmiTag(param_count_smi, param_count); | |
2113 __ Bind(&skip_decrement); | |
2114 } | |
2115 __ Add(x10, caller_fp, Operand(param_count, LSL, kPointerSizeLog2)); | 2101 __ Add(x10, caller_fp, Operand(param_count, LSL, kPointerSizeLog2)); |
2116 __ Add(params, x10, StandardFrameConstants::kCallerSPOffset); | 2102 __ Add(params, x10, StandardFrameConstants::kCallerSPOffset); |
2117 | 2103 |
2118 // Try the new space allocation. Start out with computing the size of the | 2104 // Try the new space allocation. Start out with computing the size of the |
2119 // arguments object and the elements array in words. | 2105 // arguments object and the elements array in words. |
2120 Register size = x10; | 2106 Register size = x10; |
2121 __ Bind(&try_allocate); | 2107 __ Bind(&try_allocate); |
2122 __ Add(size, param_count, FixedArray::kHeaderSize / kPointerSize); | 2108 __ Add(size, param_count, FixedArray::kHeaderSize / kPointerSize); |
2123 __ Cmp(param_count, 0); | 2109 __ Cmp(param_count, 0); |
2124 __ CzeroX(size, eq); | 2110 __ CzeroX(size, eq); |
(...skipping 3692 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5817 MemOperand(fp, 6 * kPointerSize), NULL); | 5803 MemOperand(fp, 6 * kPointerSize), NULL); |
5818 } | 5804 } |
5819 | 5805 |
5820 | 5806 |
5821 #undef __ | 5807 #undef __ |
5822 | 5808 |
5823 } // namespace internal | 5809 } // namespace internal |
5824 } // namespace v8 | 5810 } // namespace v8 |
5825 | 5811 |
5826 #endif // V8_TARGET_ARCH_ARM64 | 5812 #endif // V8_TARGET_ARCH_ARM64 |
OLD | NEW |