Bug 1437955 - Part 2: Remove unused ParseNodeKind::Nop. r=Waldo.
authorJason Orendorff <jorendorff@mozilla.com>
Tue, 16 Jan 2018 15:12:04 -0600
changeset 404281 b593a217bb5a4bd160dff15f1fc1577b95f06778
parent 404280 e21126825c41be2a70bb6759e2dbdc7190621608
child 404282 e9b8c798e67de86db459ce020218664487744270
push id33459
push userdluca@mozilla.com
push dateSat, 17 Feb 2018 09:56:03 +0000
treeherdermozilla-central@dde7eb1a589f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersWaldo
bugs1437955
milestone60.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1437955 - Part 2: Remove unused ParseNodeKind::Nop. r=Waldo.
js/src/builtin/ReflectParse.cpp
js/src/frontend/BinSource.cpp
js/src/frontend/BytecodeEmitter.cpp
js/src/frontend/FoldConstants.cpp
js/src/frontend/NameFunctions.cpp
js/src/frontend/ParseNode.cpp
js/src/frontend/ParseNode.h
--- a/js/src/builtin/ReflectParse.cpp
+++ b/js/src/builtin/ReflectParse.cpp
@@ -2273,17 +2273,16 @@ ASTSerializer::statement(ParseNode* pn, 
       case ParseNodeKind::Import:
         return importDeclaration(pn, dst);
 
       case ParseNodeKind::Export:
       case ParseNodeKind::ExportDefault:
       case ParseNodeKind::ExportFrom:
         return exportDeclaration(pn, dst);
 
-      case ParseNodeKind::Nop:
       case ParseNodeKind::EmptyStatement:
         return builder.emptyStatement(&pn->pn_pos, dst);
 
       case ParseNodeKind::ExpressionStatement:
       {
         RootedValue expr(cx);
         return expression(pn->pn_kid, &expr) &&
             builder.expressionStatement(expr, &pn->pn_pos, dst);
--- a/js/src/frontend/BinSource.cpp
+++ b/js/src/frontend/BinSource.cpp
@@ -1212,18 +1212,16 @@ BinASTParser::parseVariableDeclarationAu
                 return raiseInvalidField("VariableDeclaration", field);
             }
         }
 
         if (!result || pnk == ParseNodeKind::Limit)
             return raiseMissingField("VariableDeclaration", BinField::Declarations);
 
         result->setKind(pnk);
-
-        MOZ_ASSERT(!result->isKind(ParseNodeKind::Nop));
     }
 
     return result;
 }
 
 
 JS::Result<ParseNode*>
 BinASTParser::parseExpressionStatementAux(const BinKind kind, const BinFields& fields)
--- a/js/src/frontend/BytecodeEmitter.cpp
+++ b/js/src/frontend/BytecodeEmitter.cpp
@@ -3062,17 +3062,16 @@ BytecodeEmitter::checkSideEffects(ParseN
 {
     if (!CheckRecursionLimit(cx))
         return false;
 
  restart:
 
     switch (pn->getKind()) {
       // Trivial cases with no side effects.
-      case ParseNodeKind::Nop:
       case ParseNodeKind::EmptyStatement:
       case ParseNodeKind::String:
       case ParseNodeKind::TemplateString:
       case ParseNodeKind::RegExp:
       case ParseNodeKind::True:
       case ParseNodeKind::False:
       case ParseNodeKind::Null:
       case ParseNodeKind::RawUndefined:
@@ -10983,20 +10982,16 @@ BytecodeEmitter::emitTree(ParseNode* pn,
 
       case ParseNodeKind::Debugger:
         if (!updateSourceCoordNotes(pn->pn_pos.begin))
             return false;
         if (!emit1(JSOP_DEBUGGER))
             return false;
         break;
 
-      case ParseNodeKind::Nop:
-        MOZ_ASSERT(pn->getArity() == PN_NULLARY);
-        break;
-
       case ParseNodeKind::Class:
         if (!emitClass(pn))
             return false;
         break;
 
       case ParseNodeKind::NewTarget:
         if (!emit1(JSOP_NEWTARGET))
             return false;
--- a/js/src/frontend/FoldConstants.cpp
+++ b/js/src/frontend/FoldConstants.cpp
@@ -97,17 +97,16 @@ ContainsHoistedDeclaration(JSContext* cx
         *result = false;
         return true;
 
       case ParseNodeKind::Module:
         *result = false;
         return true;
 
       // Statements with no sub-components at all.
-      case ParseNodeKind::Nop: // induced by function f() {} function f() {}
       case ParseNodeKind::EmptyStatement:
       case ParseNodeKind::Debugger:
         MOZ_ASSERT(node->isArity(PN_NULLARY));
         *result = false;
         return true;
 
       // Statements containing only an expression have no declarations.
       case ParseNodeKind::ExpressionStatement:
@@ -1586,17 +1585,16 @@ bool
 Fold(JSContext* cx, ParseNode** pnp, PerHandlerParser<FullParseHandler>& parser)
 {
     if (!CheckRecursionLimit(cx))
         return false;
 
     ParseNode* pn = *pnp;
 
     switch (pn->getKind()) {
-      case ParseNodeKind::Nop:
       case ParseNodeKind::EmptyStatement:
       case ParseNodeKind::RegExp:
       case ParseNodeKind::String:
       case ParseNodeKind::True:
       case ParseNodeKind::False:
       case ParseNodeKind::Null:
       case ParseNodeKind::RawUndefined:
       case ParseNodeKind::Elision:
--- a/js/src/frontend/NameFunctions.cpp
+++ b/js/src/frontend/NameFunctions.cpp
@@ -383,17 +383,16 @@ class NameResolver
 
         auto initialParents = nparents;
         parents[initialParents] = cur;
         nparents++;
 
         switch (cur->getKind()) {
           // Nodes with no children that might require name resolution need no
           // further work.
-          case ParseNodeKind::Nop:
           case ParseNodeKind::EmptyStatement:
           case ParseNodeKind::String:
           case ParseNodeKind::TemplateString:
           case ParseNodeKind::RegExp:
           case ParseNodeKind::True:
           case ParseNodeKind::False:
           case ParseNodeKind::Null:
           case ParseNodeKind::RawUndefined:
--- a/js/src/frontend/ParseNode.cpp
+++ b/js/src/frontend/ParseNode.cpp
@@ -178,17 +178,16 @@ PushUnaryNodeChild(ParseNode* node, Node
  * just need to take care of its children.
  */
 static PushResult
 PushNodeChildren(ParseNode* pn, NodeStack* stack)
 {
     switch (pn->getKind()) {
       // Trivial nodes that refer to no nodes, are referred to by nothing
       // but their parents, are never used, and are never a definition.
-      case ParseNodeKind::Nop:
       case ParseNodeKind::EmptyStatement:
       case ParseNodeKind::String:
       case ParseNodeKind::TemplateString:
       case ParseNodeKind::RegExp:
       case ParseNodeKind::True:
       case ParseNodeKind::False:
       case ParseNodeKind::Null:
       case ParseNodeKind::RawUndefined:
--- a/js/src/frontend/ParseNode.h
+++ b/js/src/frontend/ParseNode.h
@@ -38,17 +38,16 @@ namespace js {
 namespace frontend {
 
 class ParseContext;
 class FullParseHandler;
 class FunctionBox;
 class ObjectBox;
 
 #define FOR_EACH_PARSE_NODE_KIND(F) \
-    F(Nop) \
     F(EmptyStatement) \
     F(ExpressionStatement) \
     F(Comma) \
     F(Conditional) \
     F(Colon) \
     F(Shorthand) \
     F(Pos) \
     F(Neg) \