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/codegen.h" | 9 #include "src/codegen.h" |
10 #include "src/debug.h" | 10 #include "src/debug.h" |
(...skipping 1722 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1733 | 1733 |
1734 { // Too few parameters: Actual < expected | 1734 { // Too few parameters: Actual < expected |
1735 __ Bind(&too_few); | 1735 __ Bind(&too_few); |
1736 | 1736 |
1737 Register copy_from = x10; | 1737 Register copy_from = x10; |
1738 Register copy_end = x11; | 1738 Register copy_end = x11; |
1739 Register copy_to = x12; | 1739 Register copy_to = x12; |
1740 Register scratch1 = x13, scratch2 = x14; | 1740 Register scratch1 = x13, scratch2 = x14; |
1741 | 1741 |
1742 // If the function is strong we need to throw an error. | 1742 // If the function is strong we need to throw an error. |
1743 Label weak_function; | 1743 Label no_strong_error; |
1744 __ Ldr(scratch1, | 1744 __ Ldr(scratch1, |
1745 FieldMemOperand(function, JSFunction::kSharedFunctionInfoOffset)); | 1745 FieldMemOperand(function, JSFunction::kSharedFunctionInfoOffset)); |
1746 __ Ldr(scratch2.W(), | 1746 __ Ldr(scratch2.W(), |
1747 FieldMemOperand(scratch1, SharedFunctionInfo::kCompilerHintsOffset)); | 1747 FieldMemOperand(scratch1, SharedFunctionInfo::kCompilerHintsOffset)); |
1748 __ TestAndBranchIfAllClear(scratch2.W(), | 1748 __ TestAndBranchIfAllClear(scratch2.W(), |
1749 (1 << SharedFunctionInfo::kStrongModeFunction), | 1749 (1 << SharedFunctionInfo::kStrongModeFunction), |
1750 &weak_function); | 1750 &no_strong_error); |
| 1751 |
| 1752 // What we really care about is the required number of arguments. |
| 1753 DCHECK_EQ(kPointerSize, kInt64Size); |
| 1754 __ Ldr(scratch2.W(), |
| 1755 FieldMemOperand(scratch1, SharedFunctionInfo::kLengthOffset)); |
| 1756 __ Cmp(argc_actual, Operand(scratch2, LSR, 1)); |
| 1757 __ B(ge, &no_strong_error); |
1751 | 1758 |
1752 { | 1759 { |
1753 FrameScope frame(masm, StackFrame::MANUAL); | 1760 FrameScope frame(masm, StackFrame::MANUAL); |
1754 EnterArgumentsAdaptorFrame(masm); | 1761 EnterArgumentsAdaptorFrame(masm); |
1755 __ CallRuntime(Runtime::kThrowStrongModeTooFewArguments, 0); | 1762 __ CallRuntime(Runtime::kThrowStrongModeTooFewArguments, 0); |
1756 } | 1763 } |
1757 | 1764 |
1758 __ bind(&weak_function); | 1765 __ Bind(&no_strong_error); |
1759 EnterArgumentsAdaptorFrame(masm); | 1766 EnterArgumentsAdaptorFrame(masm); |
1760 | 1767 |
1761 __ Lsl(argc_expected, argc_expected, kPointerSizeLog2); | 1768 __ Lsl(argc_expected, argc_expected, kPointerSizeLog2); |
1762 __ Lsl(argc_actual, argc_actual, kPointerSizeLog2); | 1769 __ Lsl(argc_actual, argc_actual, kPointerSizeLog2); |
1763 | 1770 |
1764 // Adjust for fp, lr, and the receiver. | 1771 // Adjust for fp, lr, and the receiver. |
1765 __ Add(copy_from, fp, 3 * kPointerSize); | 1772 __ Add(copy_from, fp, 3 * kPointerSize); |
1766 __ Add(copy_from, copy_from, argc_actual); | 1773 __ Add(copy_from, copy_from, argc_actual); |
1767 __ Mov(copy_to, jssp); | 1774 __ Mov(copy_to, jssp); |
1768 __ Sub(copy_end, copy_to, 1 * kPointerSize); // Adjust for the receiver. | 1775 __ Sub(copy_end, copy_to, 1 * kPointerSize); // Adjust for the receiver. |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1824 __ Unreachable(); | 1831 __ Unreachable(); |
1825 } | 1832 } |
1826 } | 1833 } |
1827 | 1834 |
1828 | 1835 |
1829 #undef __ | 1836 #undef __ |
1830 | 1837 |
1831 } } // namespace v8::internal | 1838 } } // namespace v8::internal |
1832 | 1839 |
1833 #endif // V8_TARGET_ARCH_ARM | 1840 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |