| Index: src/arm/builtins-arm.cc
|
| diff --git a/src/arm/builtins-arm.cc b/src/arm/builtins-arm.cc
|
| index f14d77af0a8d7654b2eb82ddeed0e704e3f89077..6e8fe28a2bbc4ab21ada33e73d5cacd1bbfdfece 100644
|
| --- a/src/arm/builtins-arm.cc
|
| +++ b/src/arm/builtins-arm.cc
|
| @@ -1231,6 +1231,14 @@ void Builtins::Generate_FunctionCall(MacroAssembler* masm) {
|
| // Change context eagerly in case we need the global receiver.
|
| __ ldr(cp, FieldMemOperand(r1, JSFunction::kContextOffset));
|
|
|
| + // Do not transform the receiver for strict mode functions.
|
| + __ ldr(r2, FieldMemOperand(r1, JSFunction::kSharedFunctionInfoOffset));
|
| + __ ldr(r2, FieldMemOperand(r2, SharedFunctionInfo::kCompilerHintsOffset));
|
| + __ tst(r2, Operand(1 << (SharedFunctionInfo::kStrictModeFunction +
|
| + kSmiTagSize)));
|
| + __ b(ne, &shift_arguments);
|
| +
|
| + // Compute the receiver in non-strict mode.
|
| __ add(r2, sp, Operand(r0, LSL, kPointerSizeLog2));
|
| __ ldr(r2, MemOperand(r2, -kPointerSize));
|
| // r0: actual number of arguments
|
| @@ -1394,10 +1402,20 @@ void Builtins::Generate_FunctionApply(MacroAssembler* masm) {
|
| // Change context eagerly to get the right global object if necessary.
|
| __ ldr(r0, MemOperand(fp, kFunctionOffset));
|
| __ ldr(cp, FieldMemOperand(r0, JSFunction::kContextOffset));
|
| + // Load the shared function info while the function is still in r0.
|
| + __ ldr(r1, FieldMemOperand(r0, JSFunction::kSharedFunctionInfoOffset));
|
|
|
| // Compute the receiver.
|
| Label call_to_object, use_global_receiver, push_receiver;
|
| __ ldr(r0, MemOperand(fp, kRecvOffset));
|
| +
|
| + // Do not transform the receiver for strict mode functions.
|
| + __ ldr(r1, FieldMemOperand(r1, SharedFunctionInfo::kCompilerHintsOffset));
|
| + __ tst(r1, Operand(1 << (SharedFunctionInfo::kStrictModeFunction +
|
| + kSmiTagSize)));
|
| + __ b(ne, &push_receiver);
|
| +
|
| + // Compute the receiver in non-strict mode.
|
| __ tst(r0, Operand(kSmiTagMask));
|
| __ b(eq, &call_to_object);
|
| __ LoadRoot(r1, Heap::kNullValueRootIndex);
|
|
|