| Index: src/arm64/lithium-codegen-arm64.cc
|
| diff --git a/src/arm64/lithium-codegen-arm64.cc b/src/arm64/lithium-codegen-arm64.cc
|
| index 99f3b27d830077f8a431c1e5694108716cbb2f90..b5ca5d462850c00880b3a3519cfe262cc2c299b9 100644
|
| --- a/src/arm64/lithium-codegen-arm64.cc
|
| +++ b/src/arm64/lithium-codegen-arm64.cc
|
| @@ -5822,7 +5822,7 @@ void LCodeGen::DoWrapReceiver(LWrapReceiver* instr) {
|
| // If the receiver is null or undefined, we have to pass the global object as
|
| // a receiver to normal functions. Values have to be passed unchanged to
|
| // builtins and strict-mode functions.
|
| - Label global_object, done;
|
| + Label global_object, done, copy_receiver;
|
|
|
| if (!instr->hydrogen()->known_function()) {
|
| __ Ldr(result, FieldMemOperand(function,
|
| @@ -5833,10 +5833,10 @@ void LCodeGen::DoWrapReceiver(LWrapReceiver* instr) {
|
| FieldMemOperand(result, SharedFunctionInfo::kCompilerHintsOffset));
|
|
|
| // Do not transform the receiver to object for strict mode functions.
|
| - __ Tbnz(result, SharedFunctionInfo::kStrictModeFunction, &done);
|
| + __ Tbnz(result, SharedFunctionInfo::kStrictModeFunction, ©_receiver);
|
|
|
| // Do not transform the receiver to object for builtins.
|
| - __ Tbnz(result, SharedFunctionInfo::kNative, &done);
|
| + __ Tbnz(result, SharedFunctionInfo::kNative, ©_receiver);
|
| }
|
|
|
| // Normal function. Replace undefined or null with global receiver.
|
| @@ -5854,7 +5854,10 @@ void LCodeGen::DoWrapReceiver(LWrapReceiver* instr) {
|
| __ Ldr(result, FieldMemOperand(function, JSFunction::kContextOffset));
|
| __ Ldr(result, ContextMemOperand(result, Context::GLOBAL_OBJECT_INDEX));
|
| __ Ldr(result, FieldMemOperand(result, GlobalObject::kGlobalReceiverOffset));
|
| + __ B(&done);
|
|
|
| + __ Bind(©_receiver);
|
| + __ Mov(result, receiver);
|
| __ Bind(&done);
|
| }
|
|
|
|
|