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

Unified Diff: src/arm/builtins-arm.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 | « no previous file | src/arm64/builtins-arm64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/arm/builtins-arm.cc
diff --git a/src/arm/builtins-arm.cc b/src/arm/builtins-arm.cc
index 7070ce7e27c50cf074fc209b76bb1ac26420ced2..db53022869aa4f0e5ceb8e431b50ef11914a2bce 100644
--- a/src/arm/builtins-arm.cc
+++ b/src/arm/builtins-arm.cc
@@ -1724,12 +1724,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;
__ ldr(r4, FieldMemOperand(r1, JSFunction::kSharedFunctionInfoOffset));
- __ ldr(r4, FieldMemOperand(r4, SharedFunctionInfo::kCompilerHintsOffset));
- __ tst(r4, Operand(1 << (SharedFunctionInfo::kStrongModeFunction +
+ __ ldr(r5, FieldMemOperand(r4, SharedFunctionInfo::kCompilerHintsOffset));
+ __ tst(r5, Operand(1 << (SharedFunctionInfo::kStrongModeFunction +
kSmiTagSize)));
- __ b(eq, &weak_function);
+ __ b(eq, &no_strong_error);
+
+ // What we really care about is the required number of arguments.
+ __ ldr(r4, FieldMemOperand(r4, SharedFunctionInfo::kLengthOffset));
+ __ cmp(r0, Operand::SmiUntag(r4));
+ __ b(ge, &no_strong_error);
{
FrameScope frame(masm, StackFrame::MANUAL);
@@ -1737,7 +1742,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 r0 and copy end address is fp.
« no previous file with comments | « no previous file | src/arm64/builtins-arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698