Chromium Code Reviews| 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. |