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 1706 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 | 1725 |
1726 // If the function is strong we need to throw an error. | 1726 // If the function is strong we need to throw an error. |
1727 Label weak_function; | 1727 Label no_strong_error; |
1728 __ ldr(r4, FieldMemOperand(r1, JSFunction::kSharedFunctionInfoOffset)); | 1728 __ ldr(r4, FieldMemOperand(r1, JSFunction::kSharedFunctionInfoOffset)); |
1729 __ ldr(r4, FieldMemOperand(r4, SharedFunctionInfo::kCompilerHintsOffset)); | 1729 __ ldr(r5, FieldMemOperand(r4, SharedFunctionInfo::kCompilerHintsOffset)); |
1730 __ tst(r4, Operand(1 << (SharedFunctionInfo::kStrongModeFunction + | 1730 __ tst(r5, Operand(1 << (SharedFunctionInfo::kStrongModeFunction + |
1731 kSmiTagSize))); | 1731 kSmiTagSize))); |
1732 __ b(eq, &weak_function); | 1732 __ b(eq, &no_strong_error); |
| 1733 |
| 1734 // What we really care about is the required number of arguments. |
| 1735 __ ldr(r4, FieldMemOperand(r4, SharedFunctionInfo::kLengthOffset)); |
| 1736 __ cmp(r0, Operand::SmiUntag(r4)); |
| 1737 __ b(ge, &no_strong_error); |
1733 | 1738 |
1734 { | 1739 { |
1735 FrameScope frame(masm, StackFrame::MANUAL); | 1740 FrameScope frame(masm, StackFrame::MANUAL); |
1736 EnterArgumentsAdaptorFrame(masm); | 1741 EnterArgumentsAdaptorFrame(masm); |
1737 __ CallRuntime(Runtime::kThrowStrongModeTooFewArguments, 0); | 1742 __ CallRuntime(Runtime::kThrowStrongModeTooFewArguments, 0); |
1738 } | 1743 } |
1739 | 1744 |
1740 __ bind(&weak_function); | 1745 __ bind(&no_strong_error); |
1741 EnterArgumentsAdaptorFrame(masm); | 1746 EnterArgumentsAdaptorFrame(masm); |
1742 | 1747 |
1743 // Calculate copy start address into r0 and copy end address is fp. | 1748 // Calculate copy start address into r0 and copy end address is fp. |
1744 // r0: actual number of arguments as a smi | 1749 // r0: actual number of arguments as a smi |
1745 // r1: function | 1750 // r1: function |
1746 // r2: expected number of arguments | 1751 // r2: expected number of arguments |
1747 // r3: code entry to call | 1752 // r3: code entry to call |
1748 __ add(r0, fp, Operand::PointerOffsetFromSmiKey(r0)); | 1753 __ add(r0, fp, Operand::PointerOffsetFromSmiKey(r0)); |
1749 | 1754 |
1750 // Copy the arguments (including the receiver) to the new stack frame. | 1755 // Copy the arguments (including the receiver) to the new stack frame. |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1804 __ bkpt(0); | 1809 __ bkpt(0); |
1805 } | 1810 } |
1806 } | 1811 } |
1807 | 1812 |
1808 | 1813 |
1809 #undef __ | 1814 #undef __ |
1810 | 1815 |
1811 } } // namespace v8::internal | 1816 } } // namespace v8::internal |
1812 | 1817 |
1813 #endif // V8_TARGET_ARCH_ARM | 1818 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |