Reviewers: Dmitry Lomov (chromium),

Message:
PTAL

Description:
Remove ValidateSuperCall

We don't need this since this case is now a SyntaxError.

BUG=None
LOG=N
[email protected]

Please review this at https://codereview.chromium.org/957823002/

Base URL: https://chromium.googlesource.com/v8/v8.git@master

Affected files (+0, -29 lines):
  M src/arm/full-codegen-arm.cc
  M src/arm64/full-codegen-arm64.cc
  M src/full-codegen.h
  M src/full-codegen.cc
  M src/ia32/full-codegen-ia32.cc
  M src/mips/full-codegen-mips.cc
  M src/mips64/full-codegen-mips64.cc
  M src/ppc/full-codegen-ppc.cc
  M src/x64/full-codegen-x64.cc
  M src/x87/full-codegen-x87.cc


Index: src/arm/full-codegen-arm.cc
diff --git a/src/arm/full-codegen-arm.cc b/src/arm/full-codegen-arm.cc
index f433990d23a9b41c171c1fc9e987dbe004730ed7..3a44e8f2a5726c6a05dd0f4a8ea2ddcc35abf69b 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());
Index: src/arm64/full-codegen-arm64.cc
diff --git a/src/arm64/full-codegen-arm64.cc b/src/arm64/full-codegen-arm64.cc index d2e48b23121e65a407f46f2efa4e41af4cf081b1..5c3ec40a2124de426266b6f3ed6d4a3d77164467 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());
Index: src/full-codegen.cc
diff --git a/src/full-codegen.cc b/src/full-codegen.cc
index 6d9bea29559c6b8d25043a00739db40073a8b094..80141db5729d6d7af72f9591527996c94b71fb60 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());
Index: src/full-codegen.h
diff --git a/src/full-codegen.h b/src/full-codegen.h
index 72d343409e0f5504cd72676d923f3459e219072b..60c3ac24b1c77ac8fd750421a48e20e2678536f2 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> code,
               TypeFeedbackId id = TypeFeedbackId::None());
Index: src/ia32/full-codegen-ia32.cc
diff --git a/src/ia32/full-codegen-ia32.cc b/src/ia32/full-codegen-ia32.cc
index e2e7b4c87f5c3e3f00921d66fbb269749d3e1a33..44648f5ede5af1d08725ac7ef3505cb997bd3223 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);
Index: src/mips/full-codegen-mips.cc
diff --git a/src/mips/full-codegen-mips.cc b/src/mips/full-codegen-mips.cc
index 91753162faf4e1ecc7d30af4f0e8ae583eda6091..0382adea709ff91cbfb81fc7b4090fc1480b1260 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());
Index: src/mips64/full-codegen-mips64.cc
diff --git a/src/mips64/full-codegen-mips64.cc b/src/mips64/full-codegen-mips64.cc index 9809514d1477c83865c086c3e32aa03dba60ec93..b86523a0988dd5600649114d55062c39562d9470 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());
Index: src/ppc/full-codegen-ppc.cc
diff --git a/src/ppc/full-codegen-ppc.cc b/src/ppc/full-codegen-ppc.cc
index 3548e874400690fb3a03fdfd872ae3608bfd2d4c..88b7fc9a0118d5a8f9583b6f280f0d176e05fd56 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());
Index: src/x64/full-codegen-x64.cc
diff --git a/src/x64/full-codegen-x64.cc b/src/x64/full-codegen-x64.cc
index a5b065289d829a1f9b5fbe23399433c0cd04eaca..9434b6b799dddaef4fed423556503c8d5859227b 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());
Index: src/x87/full-codegen-x87.cc
diff --git a/src/x87/full-codegen-x87.cc b/src/x87/full-codegen-x87.cc
index b6e5c221a3b3ced9d17a0a9dd5f18c1ba1fc8718..3bfde7661e78f3bea11c345cfdc64bf03bb1892a 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);


--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to