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..1fb5b7632e79110e147570308d951d97a3479890 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. |
@@ -5846,15 +5846,17 @@ void LCodeGen::DoWrapReceiver(LWrapReceiver* instr) { |
// Deoptimize if the receiver is not a JS object. |
DeoptimizeIfSmi(receiver, instr->environment()); |
__ CompareObjectType(receiver, result, result, FIRST_SPEC_OBJECT_TYPE); |
- __ Mov(result, receiver); |
- __ B(ge, &done); |
+ __ B(ge, ©_receiver); |
Deoptimize(instr->environment()); |
__ Bind(&global_object); |
__ 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); |
} |