From a6f0a373dc6869c0ce827b0837c72a71e6a09819 Mon Sep 17 00:00:00 2001 From: arv Date: Wed, 11 Feb 2015 07:11:54 -0800 Subject: [PATCH] Remove dead code related to new super Support for `new super` has been removed so this code in the full code gen is now unreachable. BUG=None LOG=N R=dslomov@chromium.org Review URL: https://codereview.chromium.org/911223002 Cr-Commit-Position: refs/heads/master@{#26585} --- src/arm/full-codegen-arm.cc | 8 ++------ src/arm64/full-codegen-arm64.cc | 8 ++------ src/ia32/full-codegen-ia32.cc | 8 ++------ src/mips/full-codegen-mips.cc | 8 ++------ src/mips64/full-codegen-mips64.cc | 9 +++------ src/ppc/full-codegen-ppc.cc | 8 ++------ src/x64/full-codegen-x64.cc | 8 ++------ src/x87/full-codegen-x87.cc | 8 ++------ 8 files changed, 17 insertions(+), 48 deletions(-) diff --git a/src/arm/full-codegen-arm.cc b/src/arm/full-codegen-arm.cc index 599231ef7f..0a5990dacb 100644 --- a/src/arm/full-codegen-arm.cc +++ b/src/arm/full-codegen-arm.cc @@ -3226,12 +3226,8 @@ void FullCodeGenerator::VisitCallNew(CallNew* expr) { // Push constructor on the stack. If it's not a function it's used as // receiver for CALL_NON_FUNCTION, otherwise the value on the stack is // ignored. - if (expr->expression()->IsSuperReference()) { - EmitLoadSuperConstructor(expr->expression()->AsSuperReference()); - __ Push(result_register()); - } else { - VisitForStackValue(expr->expression()); - } + DCHECK(!expr->expression()->IsSuperReference()); + VisitForStackValue(expr->expression()); // Push the arguments ("left-to-right") on the stack. ZoneList* args = expr->arguments(); diff --git a/src/arm64/full-codegen-arm64.cc b/src/arm64/full-codegen-arm64.cc index d49b06b77b..56533be712 100644 --- a/src/arm64/full-codegen-arm64.cc +++ b/src/arm64/full-codegen-arm64.cc @@ -2915,12 +2915,8 @@ void FullCodeGenerator::VisitCallNew(CallNew* expr) { // Push constructor on the stack. If it's not a function it's used as // receiver for CALL_NON_FUNCTION, otherwise the value on the stack is // ignored. - if (expr->expression()->IsSuperReference()) { - EmitLoadSuperConstructor(expr->expression()->AsSuperReference()); - __ Push(result_register()); - } else { - VisitForStackValue(expr->expression()); - } + DCHECK(!expr->expression()->IsSuperReference()); + VisitForStackValue(expr->expression()); // Push the arguments ("left-to-right") on the stack. ZoneList* args = expr->arguments(); diff --git a/src/ia32/full-codegen-ia32.cc b/src/ia32/full-codegen-ia32.cc index ca51dc32e6..63a3781ed6 100644 --- a/src/ia32/full-codegen-ia32.cc +++ b/src/ia32/full-codegen-ia32.cc @@ -3106,12 +3106,8 @@ void FullCodeGenerator::VisitCallNew(CallNew* expr) { // Push constructor on the stack. If it's not a function it's used as // receiver for CALL_NON_FUNCTION, otherwise the value on the stack is // ignored. - if (expr->expression()->IsSuperReference()) { - EmitLoadSuperConstructor(expr->expression()->AsSuperReference()); - __ push(result_register()); - } else { - VisitForStackValue(expr->expression()); - } + DCHECK(!expr->expression()->IsSuperReference()); + VisitForStackValue(expr->expression()); // Push the arguments ("left-to-right") on the stack. ZoneList* args = expr->arguments(); diff --git a/src/mips/full-codegen-mips.cc b/src/mips/full-codegen-mips.cc index 8b4645726d..21e189fab6 100644 --- a/src/mips/full-codegen-mips.cc +++ b/src/mips/full-codegen-mips.cc @@ -3190,12 +3190,8 @@ void FullCodeGenerator::VisitCallNew(CallNew* expr) { // Push constructor on the stack. If it's not a function it's used as // receiver for CALL_NON_FUNCTION, otherwise the value on the stack is // ignored. - if (expr->expression()->IsSuperReference()) { - EmitLoadSuperConstructor(expr->expression()->AsSuperReference()); - __ Push(result_register()); - } else { - VisitForStackValue(expr->expression()); - } + DCHECK(!expr->expression()->IsSuperReference()); + VisitForStackValue(expr->expression()); // Push the arguments ("left-to-right") on the stack. ZoneList* args = expr->arguments(); diff --git a/src/mips64/full-codegen-mips64.cc b/src/mips64/full-codegen-mips64.cc index 900837f7b1..eed57afc65 100644 --- a/src/mips64/full-codegen-mips64.cc +++ b/src/mips64/full-codegen-mips64.cc @@ -3189,12 +3189,8 @@ void FullCodeGenerator::VisitCallNew(CallNew* expr) { // Push constructor on the stack. If it's not a function it's used as // receiver for CALL_NON_FUNCTION, otherwise the value on the stack is // ignored. - if (expr->expression()->IsSuperReference()) { - EmitLoadSuperConstructor(expr->expression()->AsSuperReference()); - __ Push(result_register()); - } else { - VisitForStackValue(expr->expression()); - } + DCHECK(!expr->expression()->IsSuperReference()); + VisitForStackValue(expr->expression()); // Push the arguments ("left-to-right") on the stack. ZoneList* args = expr->arguments(); @@ -3202,6 +3198,7 @@ void FullCodeGenerator::VisitCallNew(CallNew* expr) { for (int i = 0; i < arg_count; i++) { VisitForStackValue(args->at(i)); } + // Call the construct call builtin that handles allocation and // constructor invocation. SetSourcePosition(expr->position()); diff --git a/src/ppc/full-codegen-ppc.cc b/src/ppc/full-codegen-ppc.cc index 45133617e0..f38ee50c12 100644 --- a/src/ppc/full-codegen-ppc.cc +++ b/src/ppc/full-codegen-ppc.cc @@ -3206,12 +3206,8 @@ void FullCodeGenerator::VisitCallNew(CallNew* expr) { // Push constructor on the stack. If it's not a function it's used as // receiver for CALL_NON_FUNCTION, otherwise the value on the stack is // ignored. - if (expr->expression()->IsSuperReference()) { - EmitLoadSuperConstructor(expr->expression()->AsSuperReference()); - __ Push(result_register()); - } else { - VisitForStackValue(expr->expression()); - } + DCHECK(!expr->expression()->IsSuperReference()); + VisitForStackValue(expr->expression()); // Push the arguments ("left-to-right") on the stack. ZoneList* args = expr->arguments(); diff --git a/src/x64/full-codegen-x64.cc b/src/x64/full-codegen-x64.cc index 63357e95f5..84a0d9f58b 100644 --- a/src/x64/full-codegen-x64.cc +++ b/src/x64/full-codegen-x64.cc @@ -3112,12 +3112,8 @@ void FullCodeGenerator::VisitCallNew(CallNew* expr) { // Push constructor on the stack. If it's not a function it's used as // receiver for CALL_NON_FUNCTION, otherwise the value on the stack is // ignored. - if (expr->expression()->IsSuperReference()) { - EmitLoadSuperConstructor(expr->expression()->AsSuperReference()); - __ Push(result_register()); - } else { - VisitForStackValue(expr->expression()); - } + DCHECK(!expr->expression()->IsSuperReference()); + VisitForStackValue(expr->expression()); // Push the arguments ("left-to-right") on the stack. ZoneList* args = expr->arguments(); diff --git a/src/x87/full-codegen-x87.cc b/src/x87/full-codegen-x87.cc index a1c2960b4d..5d67e7cf80 100644 --- a/src/x87/full-codegen-x87.cc +++ b/src/x87/full-codegen-x87.cc @@ -3084,12 +3084,8 @@ void FullCodeGenerator::VisitCallNew(CallNew* expr) { // Push constructor on the stack. If it's not a function it's used as // receiver for CALL_NON_FUNCTION, otherwise the value on the stack is // ignored. - if (expr->expression()->IsSuperReference()) { - EmitLoadSuperConstructor(expr->expression()->AsSuperReference()); - __ push(result_register()); - } else { - VisitForStackValue(expr->expression()); - } + DCHECK(!expr->expression()->IsSuperReference()); + VisitForStackValue(expr->expression()); // Push the arguments ("left-to-right") on the stack. ZoneList* args = expr->arguments();