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

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

Issue 1133933003: [strong] Function arity check should be based on required parameters (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Use Ldr on arm64 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
« no previous file with comments | « src/ia32/builtins-ia32.cc ('k') | src/mips64/builtins-mips64.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 1726 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 1745
1746 // If the function is strong we need to throw an error. 1746 // If the function is strong we need to throw an error.
1747 Label weak_function; 1747 Label no_strong_error;
1748 __ lw(t1, FieldMemOperand(a1, JSFunction::kSharedFunctionInfoOffset)); 1748 __ lw(t1, FieldMemOperand(a1, JSFunction::kSharedFunctionInfoOffset));
1749 __ lw(t1, FieldMemOperand(t1, SharedFunctionInfo::kCompilerHintsOffset)); 1749 __ lw(t2, FieldMemOperand(t1, SharedFunctionInfo::kCompilerHintsOffset));
1750 __ And(t2, t1, Operand(1 << (SharedFunctionInfo::kStrongModeFunction + 1750 __ And(t3, t2, Operand(1 << (SharedFunctionInfo::kStrongModeFunction +
1751 kSmiTagSize))); 1751 kSmiTagSize)));
1752 __ Branch(&weak_function, eq, t2, Operand(zero_reg)); 1752 __ Branch(&no_strong_error, eq, t3, Operand(zero_reg));
1753
1754 // What we really care about is the required number of arguments.
1755 __ lw(t2, FieldMemOperand(t1, SharedFunctionInfo::kLengthOffset));
1756 __ SmiUntag(t2);
1757 __ Branch(&no_strong_error, ge, a0, Operand(t2));
1753 1758
1754 { 1759 {
1755 FrameScope frame(masm, StackFrame::MANUAL); 1760 FrameScope frame(masm, StackFrame::MANUAL);
1756 EnterArgumentsAdaptorFrame(masm); 1761 EnterArgumentsAdaptorFrame(masm);
1757 __ CallRuntime(Runtime::kThrowStrongModeTooFewArguments, 0); 1762 __ CallRuntime(Runtime::kThrowStrongModeTooFewArguments, 0);
1758 } 1763 }
1759 1764
1760 __ bind(&weak_function); 1765 __ bind(&no_strong_error);
1761 EnterArgumentsAdaptorFrame(masm); 1766 EnterArgumentsAdaptorFrame(masm);
1762 1767
1763 // Calculate copy start address into a0 and copy end address is fp. 1768 // Calculate copy start address into a0 and copy end address is fp.
1764 // a0: actual number of arguments as a smi 1769 // a0: actual number of arguments as a smi
1765 // a1: function 1770 // a1: function
1766 // a2: expected number of arguments 1771 // a2: expected number of arguments
1767 // a3: code entry to call 1772 // a3: code entry to call
1768 __ sll(a0, a0, kPointerSizeLog2 - kSmiTagSize); 1773 __ sll(a0, a0, kPointerSizeLog2 - kSmiTagSize);
1769 __ Addu(a0, fp, a0); 1774 __ Addu(a0, fp, a0);
1770 // Adjust for return address and receiver. 1775 // Adjust for return address and receiver.
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
1831 __ break_(0xCC); 1836 __ break_(0xCC);
1832 } 1837 }
1833 } 1838 }
1834 1839
1835 1840
1836 #undef __ 1841 #undef __
1837 1842
1838 } } // namespace v8::internal 1843 } } // namespace v8::internal
1839 1844
1840 #endif // V8_TARGET_ARCH_MIPS 1845 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « src/ia32/builtins-ia32.cc ('k') | src/mips64/builtins-mips64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698