Remove ValidateSuperCall
authorarv <arv@chromium.org>
Wed, 25 Feb 2015 21:46:30 +0000 (13:46 -0800)
committerCommit bot <commit-bot@chromium.org>
Wed, 25 Feb 2015 21:46:52 +0000 (21:46 +0000)
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}

src/arm/full-codegen-arm.cc
src/arm64/full-codegen-arm64.cc
src/full-codegen.cc
src/full-codegen.h
src/ia32/full-codegen-ia32.cc
src/mips/full-codegen-mips.cc
src/mips64/full-codegen-mips64.cc
src/ppc/full-codegen-ppc.cc
src/x64/full-codegen-x64.cc
src/x87/full-codegen-x87.cc

index f433990..3a44e8f 100644 (file)
@@ -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());
index d2e48b2..5c3ec40 100644 (file)
@@ -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());
index 6d9bea2..80141db 100644 (file)
@@ -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());
index 72d3434..60c3ac2 100644 (file)
@@ -640,7 +640,6 @@ class FullCodeGenerator: public AstVisitor {
   void EmitSetHomeObjectIfNeeded(Expression* initializer, int offset);
 
   void EmitLoadSuperConstructor();
-  bool ValidateSuperCall(Call* expr);
 
   void CallIC(Handle<Code> code,
               TypeFeedbackId id = TypeFeedbackId::None());
index e2e7b4c..44648f5 100644 (file)
@@ -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);
index 9175316..0382ade 100644 (file)
@@ -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());
index 9809514..b86523a 100644 (file)
@@ -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());
index 3548e87..88b7fc9 100644 (file)
@@ -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());
index a5b0652..9434b6b 100644 (file)
@@ -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());
index b6e5c22..3bfde76 100644 (file)
@@ -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);