Index: src/arm/full-codegen-arm.cc |
diff --git a/src/arm/full-codegen-arm.cc b/src/arm/full-codegen-arm.cc |
index 2ed37e4196c86b64e7492ffa87770f858e55cfd6..7eb88a43f762a8986e74588c4bbf46e617349f85 100644 |
--- a/src/arm/full-codegen-arm.cc |
+++ b/src/arm/full-codegen-arm.cc |
@@ -3386,9 +3386,6 @@ void FullCodeGenerator::EmitSuperConstructorCall(Call* expr) { |
expr->expression()->AsSuperCallReference(); |
DCHECK_NOT_NULL(super_call_ref); |
- VariableProxy* new_target_proxy = super_call_ref->new_target_var(); |
- VisitForStackValue(new_target_proxy); |
- |
EmitLoadSuperConstructor(super_call_ref); |
__ push(result_register()); |
@@ -3403,6 +3400,10 @@ void FullCodeGenerator::EmitSuperConstructorCall(Call* expr) { |
// constructor invocation. |
SetConstructCallPosition(expr); |
+ // Load original constructor into r4. |
+ VisitForAccumulatorValue(super_call_ref->new_target_var()); |
+ __ mov(r4, result_register()); |
+ |
// Load function and argument count into r1 and r0. |
__ mov(r0, Operand(arg_count)); |
__ ldr(r1, MemOperand(sp, arg_count * kPointerSize)); |
@@ -3423,8 +3424,6 @@ void FullCodeGenerator::EmitSuperConstructorCall(Call* expr) { |
CallConstructStub stub(isolate(), SUPER_CALL_RECORD_TARGET); |
__ Call(stub.GetCode(), RelocInfo::CONSTRUCT_CALL); |
- __ Drop(1); |
- |
RecordJSReturnSite(expr); |
EmitInitializeThisAfterSuper(super_call_ref, expr->CallFeedbackICSlot()); |
@@ -4335,6 +4334,9 @@ void FullCodeGenerator::EmitDefaultConstructorCallSuper(CallRuntime* expr) { |
__ CallRuntime(Runtime::kGetPrototype, 1); |
__ Push(result_register()); |
+ // Load original constructor into r4. |
+ __ ldr(r4, MemOperand(sp, 1 * kPointerSize)); |
+ |
// Check if the calling frame is an arguments adaptor frame. |
Label adaptor_frame, args_set_up, runtime; |
__ ldr(r2, MemOperand(fp, StandardFrameConstants::kCallerFPOffset)); |