From: arv Date: Wed, 25 Feb 2015 21:46:30 +0000 (-0800) Subject: Remove ValidateSuperCall X-Git-Tag: upstream/4.7.83~4176 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5c19e4f1cb08c11e636315e6eea566794779b415;p=platform%2Fupstream%2Fv8.git Remove ValidateSuperCall We don't need this since this case is now a SyntaxError. BUG=None LOG=N R=dslomov@chromium.org Review URL: https://codereview.chromium.org/957823002 Cr-Commit-Position: refs/heads/master@{#26864} --- diff --git a/src/arm/full-codegen-arm.cc b/src/arm/full-codegen-arm.cc index f433990..3a44e8f 100644 --- a/src/arm/full-codegen-arm.cc +++ b/src/arm/full-codegen-arm.cc @@ -3273,7 +3273,6 @@ void FullCodeGenerator::VisitCallNew(CallNew* expr) { void FullCodeGenerator::EmitSuperConstructorCall(Call* expr) { - if (!ValidateSuperCall(expr)) return; Variable* new_target_var = scope()->DeclarationScope()->new_target_var(); GetVar(result_register(), new_target_var); __ Push(result_register()); diff --git a/src/arm64/full-codegen-arm64.cc b/src/arm64/full-codegen-arm64.cc index d2e48b2..5c3ec40 100644 --- a/src/arm64/full-codegen-arm64.cc +++ b/src/arm64/full-codegen-arm64.cc @@ -2962,8 +2962,6 @@ void FullCodeGenerator::VisitCallNew(CallNew* expr) { void FullCodeGenerator::EmitSuperConstructorCall(Call* expr) { - if (!ValidateSuperCall(expr)) return; - Variable* new_target_var = scope()->DeclarationScope()->new_target_var(); GetVar(result_register(), new_target_var); __ Push(result_register()); diff --git a/src/full-codegen.cc b/src/full-codegen.cc index 6d9bea2..80141db 100644 --- a/src/full-codegen.cc +++ b/src/full-codegen.cc @@ -838,22 +838,6 @@ void FullCodeGenerator::VisitSuperReference(SuperReference* super) { } -bool FullCodeGenerator::ValidateSuperCall(Call* expr) { - Variable* new_target_var = scope()->DeclarationScope()->new_target_var(); - if (new_target_var == nullptr) { - // TODO(dslomov): this is not exactly correct, the spec requires us - // to execute the constructor and only fail when an assigment to 'this' - // is attempted. Will implement once we have general new.target support, - // but also filed spec bug 3843 to make it an early error. - __ CallRuntime(Runtime::kThrowUnsupportedSuperError, 0); - RecordJSReturnSite(expr); - context()->Plug(result_register()); - return false; - } - return true; -} - - void FullCodeGenerator::SetExpressionPosition(Expression* expr) { if (!info_->is_debug()) { CodeGenerator::RecordPositions(masm_, expr->position()); diff --git a/src/full-codegen.h b/src/full-codegen.h index 72d3434..60c3ac2 100644 --- a/src/full-codegen.h +++ b/src/full-codegen.h @@ -640,7 +640,6 @@ class FullCodeGenerator: public AstVisitor { void EmitSetHomeObjectIfNeeded(Expression* initializer, int offset); void EmitLoadSuperConstructor(); - bool ValidateSuperCall(Call* expr); void CallIC(Handle code, TypeFeedbackId id = TypeFeedbackId::None()); diff --git a/src/ia32/full-codegen-ia32.cc b/src/ia32/full-codegen-ia32.cc index e2e7b4c..44648f5 100644 --- a/src/ia32/full-codegen-ia32.cc +++ b/src/ia32/full-codegen-ia32.cc @@ -3154,8 +3154,6 @@ void FullCodeGenerator::VisitCallNew(CallNew* expr) { void FullCodeGenerator::EmitSuperConstructorCall(Call* expr) { - if (!ValidateSuperCall(expr)) return; - Variable* new_target_var = scope()->DeclarationScope()->new_target_var(); GetVar(eax, new_target_var); __ push(eax); diff --git a/src/mips/full-codegen-mips.cc b/src/mips/full-codegen-mips.cc index 9175316..0382ade 100644 --- a/src/mips/full-codegen-mips.cc +++ b/src/mips/full-codegen-mips.cc @@ -3247,7 +3247,6 @@ void FullCodeGenerator::VisitCallNew(CallNew* expr) { void FullCodeGenerator::EmitSuperConstructorCall(Call* expr) { - if (!ValidateSuperCall(expr)) return; Variable* new_target_var = scope()->DeclarationScope()->new_target_var(); GetVar(result_register(), new_target_var); __ Push(result_register()); diff --git a/src/mips64/full-codegen-mips64.cc b/src/mips64/full-codegen-mips64.cc index 9809514..b86523a 100644 --- a/src/mips64/full-codegen-mips64.cc +++ b/src/mips64/full-codegen-mips64.cc @@ -3247,7 +3247,6 @@ void FullCodeGenerator::VisitCallNew(CallNew* expr) { void FullCodeGenerator::EmitSuperConstructorCall(Call* expr) { - if (!ValidateSuperCall(expr)) return; Variable* new_target_var = scope()->DeclarationScope()->new_target_var(); GetVar(result_register(), new_target_var); __ Push(result_register()); diff --git a/src/ppc/full-codegen-ppc.cc b/src/ppc/full-codegen-ppc.cc index 3548e87..88b7fc9 100644 --- a/src/ppc/full-codegen-ppc.cc +++ b/src/ppc/full-codegen-ppc.cc @@ -3262,7 +3262,6 @@ void FullCodeGenerator::VisitCallNew(CallNew* expr) { void FullCodeGenerator::EmitSuperConstructorCall(Call* expr) { - if (!ValidateSuperCall(expr)) return; Variable* new_target_var = scope()->DeclarationScope()->new_target_var(); GetVar(result_register(), new_target_var); __ Push(result_register()); diff --git a/src/x64/full-codegen-x64.cc b/src/x64/full-codegen-x64.cc index a5b0652..9434b6b 100644 --- a/src/x64/full-codegen-x64.cc +++ b/src/x64/full-codegen-x64.cc @@ -3160,8 +3160,6 @@ void FullCodeGenerator::VisitCallNew(CallNew* expr) { void FullCodeGenerator::EmitSuperConstructorCall(Call* expr) { - if (!ValidateSuperCall(expr)) return; - Variable* new_target_var = scope()->DeclarationScope()->new_target_var(); GetVar(result_register(), new_target_var); __ Push(result_register()); diff --git a/src/x87/full-codegen-x87.cc b/src/x87/full-codegen-x87.cc index b6e5c22..3bfde76 100644 --- a/src/x87/full-codegen-x87.cc +++ b/src/x87/full-codegen-x87.cc @@ -3141,8 +3141,6 @@ void FullCodeGenerator::VisitCallNew(CallNew* expr) { void FullCodeGenerator::EmitSuperConstructorCall(Call* expr) { - if (!ValidateSuperCall(expr)) return; - Variable* new_target_var = scope()->DeclarationScope()->new_target_var(); GetVar(eax, new_target_var); __ push(eax);