Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(384)

Side by Side Diff: src/mips/builtins-mips.cc

Issue 1115263004: [strong] Check arity of functions (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Ports done and even more tests Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 5
6 6
7 #include "src/v8.h" 7 #include "src/v8.h"
8 8
9 #if V8_TARGET_ARCH_MIPS 9 #if V8_TARGET_ARCH_MIPS
10 10
(...skipping 1724 matching lines...) Expand 10 before | Expand all | Expand 10 after
1735 __ lw(t0, MemOperand(a0)); 1735 __ lw(t0, MemOperand(a0));
1736 __ push(t0); 1736 __ push(t0);
1737 __ Branch(USE_DELAY_SLOT, &copy, ne, a0, Operand(a2)); 1737 __ Branch(USE_DELAY_SLOT, &copy, ne, a0, Operand(a2));
1738 __ addiu(a0, a0, -kPointerSize); // In delay slot. 1738 __ addiu(a0, a0, -kPointerSize); // In delay slot.
1739 1739
1740 __ jmp(&invoke); 1740 __ jmp(&invoke);
1741 } 1741 }
1742 1742
1743 { // Too few parameters: Actual < expected. 1743 { // Too few parameters: Actual < expected.
1744 __ bind(&too_few); 1744 __ bind(&too_few);
1745
1746 // If the function is strong we need to throw an error.
1747 Label weak_function;
1748 __ lw(t1, FieldMemOperand(a1, JSFunction::kSharedFunctionInfoOffset));
1749 __ lw(t1, FieldMemOperand(t1, SharedFunctionInfo::kCompilerHintsOffset));
1750 __ And(t2, t1, Operand(1 << (SharedFunctionInfo::kStrongModeFunction +
1751 kSmiTagSize)));
1752 __ Branch(&weak_function, eq, t2, Operand(zero_reg));
1753
1754 {
1755 FrameScope frame(masm, StackFrame::MANUAL);
1756 EnterArgumentsAdaptorFrame(masm);
1757 __ CallRuntime(Runtime::kThrowStrongModeTooFewArguments, 0);
1758 }
1759
1760 __ bind(&weak_function);
1745 EnterArgumentsAdaptorFrame(masm); 1761 EnterArgumentsAdaptorFrame(masm);
1746 1762
1747 // Calculate copy start address into a0 and copy end address is fp. 1763 // Calculate copy start address into a0 and copy end address is fp.
1748 // a0: actual number of arguments as a smi 1764 // a0: actual number of arguments as a smi
1749 // a1: function 1765 // a1: function
1750 // a2: expected number of arguments 1766 // a2: expected number of arguments
1751 // a3: code entry to call 1767 // a3: code entry to call
1752 __ sll(a0, a0, kPointerSizeLog2 - kSmiTagSize); 1768 __ sll(a0, a0, kPointerSizeLog2 - kSmiTagSize);
1753 __ Addu(a0, fp, a0); 1769 __ Addu(a0, fp, a0);
1754 // Adjust for return address and receiver. 1770 // Adjust for return address and receiver.
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
1815 __ break_(0xCC); 1831 __ break_(0xCC);
1816 } 1832 }
1817 } 1833 }
1818 1834
1819 1835
1820 #undef __ 1836 #undef __
1821 1837
1822 } } // namespace v8::internal 1838 } } // namespace v8::internal
1823 1839
1824 #endif // V8_TARGET_ARCH_MIPS 1840 #endif // V8_TARGET_ARCH_MIPS
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698