Index: src/arm/lithium-codegen-arm.cc |
diff --git a/src/arm/lithium-codegen-arm.cc b/src/arm/lithium-codegen-arm.cc |
index 7a4893658f340b491b94d1a2e32b78cf05c57f8b..0433a26200c114f4526db988ee8f3a6a83defffc 100644 |
--- a/src/arm/lithium-codegen-arm.cc |
+++ b/src/arm/lithium-codegen-arm.cc |
@@ -3429,19 +3429,21 @@ void LCodeGen::DoWrapReceiver(LWrapReceiver* instr) { |
// passed unchanged to builtins and strict-mode functions. |
Label global_object, result_in_receiver; |
- // Do not transform the receiver to object for strict mode |
- // functions. |
- __ ldr(scratch, |
- FieldMemOperand(function, JSFunction::kSharedFunctionInfoOffset)); |
- __ ldr(scratch, |
- FieldMemOperand(scratch, SharedFunctionInfo::kCompilerHintsOffset)); |
- __ tst(scratch, |
- Operand(1 << (SharedFunctionInfo::kStrictModeFunction + kSmiTagSize))); |
- __ b(ne, &result_in_receiver); |
- |
- // Do not transform the receiver to object for builtins. |
- __ tst(scratch, Operand(1 << (SharedFunctionInfo::kNative + kSmiTagSize))); |
- __ b(ne, &result_in_receiver); |
+ if (!instr->hydrogen()->known_function()) { |
+ // Do not transform the receiver to object for strict mode |
+ // functions. |
+ __ ldr(scratch, |
+ FieldMemOperand(function, JSFunction::kSharedFunctionInfoOffset)); |
+ __ ldr(scratch, |
+ FieldMemOperand(scratch, SharedFunctionInfo::kCompilerHintsOffset)); |
+ int mask = 1 << (SharedFunctionInfo::kStrictModeFunction + kSmiTagSize); |
+ __ tst(scratch, Operand(mask)); |
+ __ b(ne, &result_in_receiver); |
+ |
+ // Do not transform the receiver to object for builtins. |
+ __ tst(scratch, Operand(1 << (SharedFunctionInfo::kNative + kSmiTagSize))); |
+ __ b(ne, &result_in_receiver); |
+ } |
// Normal function. Replace undefined or null with global receiver. |
__ LoadRoot(scratch, Heap::kNullValueRootIndex); |
@@ -3456,8 +3458,8 @@ void LCodeGen::DoWrapReceiver(LWrapReceiver* instr) { |
DeoptimizeIf(eq, instr->environment()); |
__ CompareObjectType(receiver, scratch, scratch, FIRST_SPEC_OBJECT_TYPE); |
DeoptimizeIf(lt, instr->environment()); |
- __ b(&result_in_receiver); |
+ __ b(&result_in_receiver); |
__ bind(&global_object); |
__ ldr(result, FieldMemOperand(function, JSFunction::kContextOffset)); |
__ ldr(result, |