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

Side by Side Diff: src/mips64/builtins-mips64.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/mips/builtins-mips.cc ('k') | src/x64/builtins-x64.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_MIPS64 9 #if V8_TARGET_ARCH_MIPS64
10 10
(...skipping 1735 matching lines...) Expand 10 before | Expand all | Expand 10 after
1746 __ Branch(USE_DELAY_SLOT, &copy, ne, a0, Operand(a2)); 1746 __ Branch(USE_DELAY_SLOT, &copy, ne, a0, Operand(a2));
1747 __ daddiu(a0, a0, -kPointerSize); // In delay slot. 1747 __ daddiu(a0, a0, -kPointerSize); // In delay slot.
1748 1748
1749 __ jmp(&invoke); 1749 __ jmp(&invoke);
1750 } 1750 }
1751 1751
1752 { // Too few parameters: Actual < expected. 1752 { // Too few parameters: Actual < expected.
1753 __ bind(&too_few); 1753 __ bind(&too_few);
1754 1754
1755 // If the function is strong we need to throw an error. 1755 // If the function is strong we need to throw an error.
1756 Label weak_function; 1756 Label no_strong_error;
1757 __ ld(a4, FieldMemOperand(a1, JSFunction::kSharedFunctionInfoOffset)); 1757 __ ld(a4, FieldMemOperand(a1, JSFunction::kSharedFunctionInfoOffset));
1758 __ lbu(a4, FieldMemOperand(a4, SharedFunctionInfo::kStrongModeByteOffset)); 1758 __ lbu(a5, FieldMemOperand(a4, SharedFunctionInfo::kStrongModeByteOffset));
1759 __ And(a4, a4, Operand(1 << SharedFunctionInfo::kStrongModeBitWithinByte)); 1759 __ And(a5, a5, Operand(1 << SharedFunctionInfo::kStrongModeBitWithinByte));
1760 __ Branch(&weak_function, eq, a4, Operand(zero_reg)); 1760 __ Branch(&no_strong_error, eq, a5, Operand(zero_reg));
1761
1762 // What we really care about is the required number of arguments.
1763 DCHECK_EQ(kPointerSize, kInt64Size);
1764 __ lw(a5, FieldMemOperand(a4, SharedFunctionInfo::kLengthOffset));
1765 __ srl(a5, a5, 1);
1766 __ Branch(&no_strong_error, ge, a0, Operand(a5));
1761 1767
1762 { 1768 {
1763 FrameScope frame(masm, StackFrame::MANUAL); 1769 FrameScope frame(masm, StackFrame::MANUAL);
1764 EnterArgumentsAdaptorFrame(masm); 1770 EnterArgumentsAdaptorFrame(masm);
1765 __ CallRuntime(Runtime::kThrowStrongModeTooFewArguments, 0); 1771 __ CallRuntime(Runtime::kThrowStrongModeTooFewArguments, 0);
1766 } 1772 }
1767 1773
1768 __ bind(&weak_function); 1774 __ bind(&no_strong_error);
1769 EnterArgumentsAdaptorFrame(masm); 1775 EnterArgumentsAdaptorFrame(masm);
1770 1776
1771 // Calculate copy start address into a0 and copy end address is fp. 1777 // Calculate copy start address into a0 and copy end address is fp.
1772 // a0: actual number of arguments as a smi 1778 // a0: actual number of arguments as a smi
1773 // a1: function 1779 // a1: function
1774 // a2: expected number of arguments 1780 // a2: expected number of arguments
1775 // a3: code entry to call 1781 // a3: code entry to call
1776 __ SmiScale(a0, a0, kPointerSizeLog2); 1782 __ SmiScale(a0, a0, kPointerSizeLog2);
1777 __ Daddu(a0, fp, a0); 1783 __ Daddu(a0, fp, a0);
1778 // Adjust for return address and receiver. 1784 // Adjust for return address and receiver.
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
1839 __ break_(0xCC); 1845 __ break_(0xCC);
1840 } 1846 }
1841 } 1847 }
1842 1848
1843 1849
1844 #undef __ 1850 #undef __
1845 1851
1846 } } // namespace v8::internal 1852 } } // namespace v8::internal
1847 1853
1848 #endif // V8_TARGET_ARCH_MIPS64 1854 #endif // V8_TARGET_ARCH_MIPS64
OLDNEW
« no previous file with comments | « src/mips/builtins-mips.cc ('k') | src/x64/builtins-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698