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 1715 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1726 __ B(hi, ©_2_by_2); | 1726 __ B(hi, ©_2_by_2); |
1727 | 1727 |
1728 // Correct the space allocated for the extra slot. | 1728 // Correct the space allocated for the extra slot. |
1729 __ Drop(1); | 1729 __ Drop(1); |
1730 | 1730 |
1731 __ B(&invoke); | 1731 __ B(&invoke); |
1732 } | 1732 } |
1733 | 1733 |
1734 { // Too few parameters: Actual < expected | 1734 { // Too few parameters: Actual < expected |
1735 __ Bind(&too_few); | 1735 __ Bind(&too_few); |
1736 EnterArgumentsAdaptorFrame(masm); | |
1737 | 1736 |
1738 Register copy_from = x10; | 1737 Register copy_from = x10; |
1739 Register copy_end = x11; | 1738 Register copy_end = x11; |
1740 Register copy_to = x12; | 1739 Register copy_to = x12; |
1741 Register scratch1 = x13, scratch2 = x14; | 1740 Register scratch1 = x13, scratch2 = x14; |
1742 | 1741 |
| 1742 // If the function is strong we need to throw an error. |
| 1743 Label weak_function; |
| 1744 __ Ldr(scratch1, |
| 1745 FieldMemOperand(function, JSFunction::kSharedFunctionInfoOffset)); |
| 1746 __ Ldr(scratch2.W(), |
| 1747 FieldMemOperand(scratch1, SharedFunctionInfo::kCompilerHintsOffset)); |
| 1748 __ TestAndBranchIfAllClear(scratch2.W(), |
| 1749 (1 << SharedFunctionInfo::kStrongModeFunction), |
| 1750 &weak_function); |
| 1751 |
| 1752 { |
| 1753 FrameScope frame(masm, StackFrame::MANUAL); |
| 1754 EnterArgumentsAdaptorFrame(masm); |
| 1755 __ CallRuntime(Runtime::kThrowStrongModeTooFewArguments, 0); |
| 1756 } |
| 1757 |
| 1758 __ bind(&weak_function); |
| 1759 EnterArgumentsAdaptorFrame(masm); |
| 1760 |
1743 __ Lsl(argc_expected, argc_expected, kPointerSizeLog2); | 1761 __ Lsl(argc_expected, argc_expected, kPointerSizeLog2); |
1744 __ Lsl(argc_actual, argc_actual, kPointerSizeLog2); | 1762 __ Lsl(argc_actual, argc_actual, kPointerSizeLog2); |
1745 | 1763 |
1746 // Adjust for fp, lr, and the receiver. | 1764 // Adjust for fp, lr, and the receiver. |
1747 __ Add(copy_from, fp, 3 * kPointerSize); | 1765 __ Add(copy_from, fp, 3 * kPointerSize); |
1748 __ Add(copy_from, copy_from, argc_actual); | 1766 __ Add(copy_from, copy_from, argc_actual); |
1749 __ Mov(copy_to, jssp); | 1767 __ Mov(copy_to, jssp); |
1750 __ Sub(copy_end, copy_to, 1 * kPointerSize); // Adjust for the receiver. | 1768 __ Sub(copy_end, copy_to, 1 * kPointerSize); // Adjust for the receiver. |
1751 __ Sub(copy_end, copy_end, argc_actual); | 1769 __ Sub(copy_end, copy_end, argc_actual); |
1752 | 1770 |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1806 __ Unreachable(); | 1824 __ Unreachable(); |
1807 } | 1825 } |
1808 } | 1826 } |
1809 | 1827 |
1810 | 1828 |
1811 #undef __ | 1829 #undef __ |
1812 | 1830 |
1813 } } // namespace v8::internal | 1831 } } // namespace v8::internal |
1814 | 1832 |
1815 #endif // V8_TARGET_ARCH_ARM | 1833 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |