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

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: git rebase 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') | src/arm64/builtins-arm64.cc » ('J')
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..60a8565ed37b14cb1e028e78ad7ae8b0872d971a 100644
--- a/src/arm/builtins-arm.cc
+++ b/src/arm/builtins-arm.cc
@@ -1724,12 +1724,18 @@ 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));
+ __ SmiUntag(r4);
+ __ cmp(r0, r4);
Rodolph Perfetta 2015/05/19 14:37:05 The two instructions above can be merged: __ cm
arv (Not doing code reviews) 2015/05/19 14:56:13 Done.
+ __ b(ge, &no_strong_error);
{
FrameScope frame(masm, StackFrame::MANUAL);
@@ -1737,7 +1743,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') | src/arm64/builtins-arm64.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698