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 #if V8_TARGET_ARCH_ARM64 | 5 #if V8_TARGET_ARCH_ARM64 |
6 | 6 |
7 #include "src/arm64/frames-arm64.h" | 7 #include "src/arm64/frames-arm64.h" |
8 #include "src/codegen.h" | 8 #include "src/codegen.h" |
9 #include "src/debug/debug.h" | 9 #include "src/debug/debug.h" |
10 #include "src/deoptimizer.h" | 10 #include "src/deoptimizer.h" |
(...skipping 1751 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1762 | 1762 |
1763 | 1763 |
1764 // static | 1764 // static |
1765 void Builtins::Generate_InterpreterPushArgsAndCall(MacroAssembler* masm) { | 1765 void Builtins::Generate_InterpreterPushArgsAndCall(MacroAssembler* masm) { |
1766 // ----------- S t a t e ------------- | 1766 // ----------- S t a t e ------------- |
1767 // -- x0 : the number of arguments (not including the receiver) | 1767 // -- x0 : the number of arguments (not including the receiver) |
1768 // -- x2 : the address of the first argument to be pushed. Subsequent | 1768 // -- x2 : the address of the first argument to be pushed. Subsequent |
1769 // arguments should be consecutive above this, in the same order as | 1769 // arguments should be consecutive above this, in the same order as |
1770 // they are to be pushed onto the stack. | 1770 // they are to be pushed onto the stack. |
1771 // -- x1 : the target to call (can be any Object). | 1771 // -- x1 : the target to call (can be any Object). |
1772 // ----------------------------------- | |
1773 | 1772 |
1774 // Find the address of the last argument. | 1773 // Find the address of the last argument. |
1775 __ add(x3, x0, Operand(1)); // Add one for receiver. | 1774 __ add(x3, x0, Operand(1)); // Add one for receiver. |
1776 __ lsl(x3, x3, kPointerSizeLog2); | 1775 __ lsl(x3, x3, kPointerSizeLog2); |
1777 __ sub(x4, x2, x3); | 1776 __ sub(x4, x2, x3); |
1778 | 1777 |
1779 // Push the arguments. | 1778 // Push the arguments. |
1780 Label loop_header, loop_check; | 1779 Label loop_header, loop_check; |
1781 __ Mov(x5, jssp); | 1780 __ Mov(x5, jssp); |
1782 __ Claim(x3, 1); | 1781 __ Claim(x3, 1); |
1783 __ B(&loop_check); | 1782 __ B(&loop_check); |
1784 __ Bind(&loop_header); | 1783 __ Bind(&loop_header); |
1785 // TODO(rmcilroy): Push two at a time once we ensure we keep stack aligned. | 1784 // TODO(rmcilroy): Push two at a time once we ensure we keep stack aligned. |
1786 __ Ldr(x3, MemOperand(x2, -kPointerSize, PostIndex)); | 1785 __ Ldr(x3, MemOperand(x2, -kPointerSize, PostIndex)); |
1787 __ Str(x3, MemOperand(x5, -kPointerSize, PreIndex)); | 1786 __ Str(x3, MemOperand(x5, -kPointerSize, PreIndex)); |
1788 __ Bind(&loop_check); | 1787 __ Bind(&loop_check); |
1789 __ Cmp(x2, x4); | 1788 __ Cmp(x2, x4); |
1790 __ B(gt, &loop_header); | 1789 __ B(gt, &loop_header); |
1791 | 1790 |
1792 // Call the target. | 1791 // Call the target. |
1793 __ Jump(masm->isolate()->builtins()->Call(), RelocInfo::CODE_TARGET); | 1792 __ Jump(masm->isolate()->builtins()->Call(), RelocInfo::CODE_TARGET); |
1794 } | 1793 } |
1795 | 1794 |
1796 | 1795 |
1797 // static | |
1798 void Builtins::Generate_InterpreterPushArgsAndConstruct(MacroAssembler* masm) { | |
1799 // ----------- S t a t e ------------- | |
1800 // -- x0 : argument count (not including receiver) | |
1801 // -- x3 : original constructor | |
1802 // -- x1 : constructor to call | |
1803 // -- x2 : address of the first argument | |
1804 // ----------------------------------- | |
1805 | |
1806 // Find the address of the last argument. | |
1807 __ lsl(x5, x0, kPointerSizeLog2); | |
1808 __ sub(x4, x2, x5); | |
1809 | |
1810 // Push the arguments. | |
1811 Label loop_header, loop_check; | |
1812 __ Mov(x6, jssp); | |
1813 __ Claim(x5, 1); | |
1814 __ B(&loop_check); | |
1815 __ Bind(&loop_header); | |
1816 // TODO(rmcilroy): Push two at a time once we ensure we keep stack aligned. | |
1817 __ Ldr(x5, MemOperand(x2, -kPointerSize, PostIndex)); | |
1818 __ Str(x5, MemOperand(x6, -kPointerSize, PreIndex)); | |
1819 __ Bind(&loop_check); | |
1820 __ Cmp(x2, x4); | |
1821 __ B(gt, &loop_header); | |
1822 | |
1823 // Call the constructor with x0, x1, and x3 unmodified. | |
1824 __ Jump(masm->isolate()->builtins()->Construct(), RelocInfo::CONSTRUCT_CALL); | |
1825 } | |
1826 | |
1827 | |
1828 void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) { | 1796 void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) { |
1829 ASM_LOCATION("Builtins::Generate_ArgumentsAdaptorTrampoline"); | 1797 ASM_LOCATION("Builtins::Generate_ArgumentsAdaptorTrampoline"); |
1830 // ----------- S t a t e ------------- | 1798 // ----------- S t a t e ------------- |
1831 // -- x0 : actual number of arguments | 1799 // -- x0 : actual number of arguments |
1832 // -- x1 : function (passed through to callee) | 1800 // -- x1 : function (passed through to callee) |
1833 // -- x2 : expected number of arguments | 1801 // -- x2 : expected number of arguments |
1834 // ----------------------------------- | 1802 // ----------------------------------- |
1835 | 1803 |
1836 Label stack_overflow; | 1804 Label stack_overflow; |
1837 ArgumentAdaptorStackCheck(masm, &stack_overflow); | 1805 ArgumentAdaptorStackCheck(masm, &stack_overflow); |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1993 } | 1961 } |
1994 } | 1962 } |
1995 | 1963 |
1996 | 1964 |
1997 #undef __ | 1965 #undef __ |
1998 | 1966 |
1999 } // namespace internal | 1967 } // namespace internal |
2000 } // namespace v8 | 1968 } // namespace v8 |
2001 | 1969 |
2002 #endif // V8_TARGET_ARCH_ARM | 1970 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |