Bug 1424946 - Move GeneralParser::checkAndMarkSuperScope into a baser class. r=arai
authorJeff Walden <jwalden@mit.edu>
Tue, 12 Dec 2017 15:21:00 -0600
changeset 448164 d2f925aeead21f409fbe910997b9e4520c371cd2
parent 448163 5996e1f1de797642c550dfed18838cd13190acda
child 448165 aebd63da51c49d2a439fcce2276c2adecd3fab54
push id8527
push userCallek@gmail.com
push dateThu, 11 Jan 2018 21:05:50 +0000
treeherdermozilla-beta@95342d212a7a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersarai
bugs1424946
milestone59.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 1424946 - Move GeneralParser::checkAndMarkSuperScope into a baser class. r=arai
js/src/frontend/Parser.cpp
js/src/frontend/Parser.h
--- a/js/src/frontend/Parser.cpp
+++ b/js/src/frontend/Parser.cpp
@@ -8480,22 +8480,22 @@ GeneralParser<ParseHandler, CharT>::argu
     }
 
     MUST_MATCH_TOKEN_MOD(TOK_RP, TokenStream::Operand, JSMSG_PAREN_AFTER_ARGS);
 
     handler.setEndPosition(listNode, pos().end);
     return true;
 }
 
-template <class ParseHandler, typename CharT>
 bool
-GeneralParser<ParseHandler, CharT>::checkAndMarkSuperScope()
+ParserBase::checkAndMarkSuperScope()
 {
     if (!pc->sc()->allowSuperProperty())
         return false;
+
     pc->setSuperScopeNeedsHomeObject();
     return true;
 }
 
 template <class ParseHandler, typename CharT>
 typename ParseHandler::Node
 GeneralParser<ParseHandler, CharT>::memberExpr(YieldHandling yieldHandling,
                                                TripledotHandling tripledotHandling,
--- a/js/src/frontend/Parser.h
+++ b/js/src/frontend/Parser.h
@@ -247,16 +247,18 @@ class ParserBase
     // gotten).  Indicate whether |next|, the next token already gotten with
     // modifier TokenStream::None, continues a LexicalDeclaration.
     bool nextTokenContinuesLetDeclaration(TokenKind next);
 
     bool noteUsedNameInternal(HandlePropertyName name);
     bool hasUsedName(HandlePropertyName name);
     bool hasUsedFunctionSpecialName(HandlePropertyName name);
 
+    bool checkAndMarkSuperScope();
+
     bool declareDotGeneratorName();
 
     bool leaveInnerFunction(ParseContext* outerpc);
 
     JSAtom* prefixAccessorName(PropertyType propType, HandleAtom propAtom);
 };
 
 inline
@@ -533,16 +535,17 @@ class GeneralParser
     using Base::anyChars;
     using Base::context;
     using Base::handler;
     using Base::isValidSimpleAssignmentTarget;
     using Base::pc;
     using Base::usedNames;
 
   private:
+    using Base::checkAndMarkSuperScope;
     using Base::declareDotGeneratorName;
     using Base::declareFunctionArgumentsObject;
     using Base::declareFunctionThis;
     using Base::finishFunction;
     using Base::hasUsedName;
     using Base::leaveInnerFunction;
     using Base::newDotGeneratorName;
     using Base::newInternalDotName;
@@ -950,17 +953,16 @@ class GeneralParser
                     InvokedPrediction invoked = PredictUninvoked);
     Node primaryExpr(YieldHandling yieldHandling, TripledotHandling tripledotHandling,
                      ExpressionClosure expressionClosureHandling, TokenKind tt,
                      PossibleError* possibleError, InvokedPrediction invoked = PredictUninvoked);
     Node exprInParens(InHandling inHandling, YieldHandling yieldHandling,
                       TripledotHandling tripledotHandling, PossibleError* possibleError = nullptr);
 
     bool tryNewTarget(Node& newTarget);
-    bool checkAndMarkSuperScope();
 
     Node methodDefinition(uint32_t toStringStart, PropertyType propType, HandleAtom funName);
 
     /*
      * Additional JS parsers.
      */
     bool functionArguments(YieldHandling yieldHandling, FunctionSyntaxKind kind,
                            Node funcpn);