OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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_ARM | 7 #if V8_TARGET_ARCH_ARM |
8 | 8 |
9 #include "src/codegen.h" | 9 #include "src/codegen.h" |
10 #include "src/debug.h" | 10 #include "src/debug.h" |
(...skipping 1704 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1715 __ push(ip); | 1715 __ push(ip); |
1716 __ cmp(r0, r2); // Compare before moving to next argument. | 1716 __ cmp(r0, r2); // Compare before moving to next argument. |
1717 __ sub(r0, r0, Operand(kPointerSize)); | 1717 __ sub(r0, r0, Operand(kPointerSize)); |
1718 __ b(ne, ©); | 1718 __ b(ne, ©); |
1719 | 1719 |
1720 __ b(&invoke); | 1720 __ b(&invoke); |
1721 } | 1721 } |
1722 | 1722 |
1723 { // Too few parameters: Actual < expected | 1723 { // Too few parameters: Actual < expected |
1724 __ bind(&too_few); | 1724 __ bind(&too_few); |
| 1725 |
| 1726 // If the function is strong we need to throw an error. |
| 1727 Label weak_function; |
| 1728 __ ldr(r4, FieldMemOperand(r1, JSFunction::kSharedFunctionInfoOffset)); |
| 1729 __ ldr(r4, FieldMemOperand(r4, SharedFunctionInfo::kCompilerHintsOffset)); |
| 1730 __ tst(r4, Operand(1 << (SharedFunctionInfo::kStrongModeFunction + |
| 1731 kSmiTagSize))); |
| 1732 __ b(eq, &weak_function); |
| 1733 |
| 1734 { |
| 1735 FrameScope frame(masm, StackFrame::MANUAL); |
| 1736 EnterArgumentsAdaptorFrame(masm); |
| 1737 __ CallRuntime(Runtime::kThrowStrongModeTooFewArguments, 0); |
| 1738 } |
| 1739 |
| 1740 __ bind(&weak_function); |
1725 EnterArgumentsAdaptorFrame(masm); | 1741 EnterArgumentsAdaptorFrame(masm); |
1726 | 1742 |
1727 // Calculate copy start address into r0 and copy end address is fp. | 1743 // Calculate copy start address into r0 and copy end address is fp. |
1728 // r0: actual number of arguments as a smi | 1744 // r0: actual number of arguments as a smi |
1729 // r1: function | 1745 // r1: function |
1730 // r2: expected number of arguments | 1746 // r2: expected number of arguments |
1731 // r3: code entry to call | 1747 // r3: code entry to call |
1732 __ add(r0, fp, Operand::PointerOffsetFromSmiKey(r0)); | 1748 __ add(r0, fp, Operand::PointerOffsetFromSmiKey(r0)); |
1733 | 1749 |
1734 // Copy the arguments (including the receiver) to the new stack frame. | 1750 // Copy the arguments (including the receiver) to the new stack frame. |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1788 __ bkpt(0); | 1804 __ bkpt(0); |
1789 } | 1805 } |
1790 } | 1806 } |
1791 | 1807 |
1792 | 1808 |
1793 #undef __ | 1809 #undef __ |
1794 | 1810 |
1795 } } // namespace v8::internal | 1811 } } // namespace v8::internal |
1796 | 1812 |
1797 #endif // V8_TARGET_ARCH_ARM | 1813 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |