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

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

Issue 1115263004: [strong] Check arity of functions (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: 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/objects.h » ('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 1733 matching lines...) Expand 10 before | Expand all | Expand 10 after
1744 __ ld(a4, MemOperand(a0)); 1744 __ ld(a4, MemOperand(a0));
1745 __ push(a4); 1745 __ push(a4);
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
1755 // If the function is strong we need to throw an error.
1756 Label weak_function;
1757 __ ld(t1, FieldMemOperand(a1, JSFunction::kSharedFunctionInfoOffset));
1758 __ lbu(t1, FieldMemOperand(t1, SharedFunctionInfo::kCompilerHintsOffset));
1759 __ And(t2, t1, Operand(1 << SharedFunctionInfo::kStrongModeBitWithinByte));
1760 __ Branch(&weak_function, eq, t2, Operand(zero_reg));
1761
1762 {
1763 FrameScope frame(masm, StackFrame::MANUAL);
1764 EnterArgumentsAdaptorFrame(masm);
1765 __ CallRuntime(Runtime::kThrowStrongModeTooFewArguments, 0);
1766 }
1767
1768 __ bind(&weak_function);
1754 EnterArgumentsAdaptorFrame(masm); 1769 EnterArgumentsAdaptorFrame(masm);
1755 1770
1756 // Calculate copy start address into a0 and copy end address is fp. 1771 // Calculate copy start address into a0 and copy end address is fp.
1757 // a0: actual number of arguments as a smi 1772 // a0: actual number of arguments as a smi
1758 // a1: function 1773 // a1: function
1759 // a2: expected number of arguments 1774 // a2: expected number of arguments
1760 // a3: code entry to call 1775 // a3: code entry to call
1761 __ SmiScale(a0, a0, kPointerSizeLog2); 1776 __ SmiScale(a0, a0, kPointerSizeLog2);
1762 __ Daddu(a0, fp, a0); 1777 __ Daddu(a0, fp, a0);
1763 // Adjust for return address and receiver. 1778 // Adjust for return address and receiver.
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
1824 __ break_(0xCC); 1839 __ break_(0xCC);
1825 } 1840 }
1826 } 1841 }
1827 1842
1828 1843
1829 #undef __ 1844 #undef __
1830 1845
1831 } } // namespace v8::internal 1846 } } // namespace v8::internal
1832 1847
1833 #endif // V8_TARGET_ARCH_MIPS64 1848 #endif // V8_TARGET_ARCH_MIPS64
OLDNEW
« no previous file with comments | « src/mips/builtins-mips.cc ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698