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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/ia32/builtins-ia32.cc ('k') | src/mips64/builtins-mips64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/mips/builtins-mips.cc
diff --git a/src/mips/builtins-mips.cc b/src/mips/builtins-mips.cc
index 4234679ed354be7eb1259ae8b23ed9f57e8b15f0..f2774924ae5eb99cd47dc045bcc637ecb8f2e07f 100644
--- a/src/mips/builtins-mips.cc
+++ b/src/mips/builtins-mips.cc
@@ -1744,12 +1744,17 @@ void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) {
__ bind(&too_few);
// If the function is strong we need to throw an error.
- Label weak_function;
+ Label no_strong_error;
__ lw(t1, FieldMemOperand(a1, JSFunction::kSharedFunctionInfoOffset));
- __ lw(t1, FieldMemOperand(t1, SharedFunctionInfo::kCompilerHintsOffset));
- __ And(t2, t1, Operand(1 << (SharedFunctionInfo::kStrongModeFunction +
+ __ lw(t2, FieldMemOperand(t1, SharedFunctionInfo::kCompilerHintsOffset));
+ __ And(t3, t2, Operand(1 << (SharedFunctionInfo::kStrongModeFunction +
kSmiTagSize)));
- __ Branch(&weak_function, eq, t2, Operand(zero_reg));
+ __ Branch(&no_strong_error, eq, t3, Operand(zero_reg));
+
+ // What we really care about is the required number of arguments.
+ __ lw(t2, FieldMemOperand(t1, SharedFunctionInfo::kLengthOffset));
+ __ SmiUntag(t2);
+ __ Branch(&no_strong_error, ge, a0, Operand(t2));
{
FrameScope frame(masm, StackFrame::MANUAL);
@@ -1757,7 +1762,7 @@ void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) {
__ CallRuntime(Runtime::kThrowStrongModeTooFewArguments, 0);
}
- __ bind(&weak_function);
+ __ bind(&no_strong_error);
EnterArgumentsAdaptorFrame(masm);
// Calculate copy start address into a0 and copy end address is fp.
« 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