Bug 1424946 - Move GeneralParser::identifierReference into a baser class. r=arai
authorJeff Walden <jwalden@mit.edu>
Tue, 12 Dec 2017 15:21:00 -0600
changeset 448165 aebd63da51c49d2a439fcce2276c2adecd3fab54
parent 448164 d2f925aeead21f409fbe910997b9e4520c371cd2
child 448166 87c33d6cfcd86b6b7ee0a2fdfed0daaedb5f6374
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::identifierReference 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
@@ -8867,19 +8867,19 @@ GeneralParser<ParseHandler, CharT>::bind
                      ? anyChars.currentToken().type
                      : TOK_LIMIT;
     RootedPropertyName ident(context, anyChars.currentName());
     if (!checkBindingIdentifier(ident, pos().begin, yieldHandling, hint))
         return nullptr;
     return ident;
 }
 
-template <class ParseHandler, typename CharT>
+template <class ParseHandler>
 typename ParseHandler::Node
-GeneralParser<ParseHandler, CharT>::identifierReference(Handle<PropertyName*> name)
+PerHandlerParser<ParseHandler>::identifierReference(Handle<PropertyName*> name)
 {
     Node pn = newName(name);
     if (!pn)
         return null();
 
     if (!noteUsedName(name))
         return null();
 
--- a/js/src/frontend/Parser.h
+++ b/js/src/frontend/Parser.h
@@ -352,16 +352,18 @@ class PerHandlerParser
 
     inline Node newName(PropertyName* name);
     inline Node newName(PropertyName* name, TokenPos pos);
 
     Node newInternalDotName(HandlePropertyName name);
     Node newThisName();
     Node newDotGeneratorName();
 
+    Node identifierReference(Handle<PropertyName*> name);
+
     inline bool processExport(Node node);
     inline bool processExportFrom(Node node);
 
     // If ParseHandler is SyntaxParseHandler:
     //   Do nothing.
     // If ParseHandler is FullParseHandler:
     //   Disable syntax parsing of all future inner functions during this
     //   full-parse.
@@ -541,16 +543,17 @@ class GeneralParser
 
   private:
     using Base::checkAndMarkSuperScope;
     using Base::declareDotGeneratorName;
     using Base::declareFunctionArgumentsObject;
     using Base::declareFunctionThis;
     using Base::finishFunction;
     using Base::hasUsedName;
+    using Base::identifierReference;
     using Base::leaveInnerFunction;
     using Base::newDotGeneratorName;
     using Base::newInternalDotName;
     using Base::newThisName;
     using Base::nextTokenContinuesLetDeclaration;
     using Base::noteDestructuredPositionalFormalParameter;
     using Base::noteUsedName;
     using Base::prefixAccessorName;
@@ -1009,18 +1012,16 @@ class GeneralParser
     PropertyName* labelIdentifier(YieldHandling yieldHandling) {
         return labelOrIdentifierReference(yieldHandling);
     }
 
     PropertyName* identifierReference(YieldHandling yieldHandling) {
         return labelOrIdentifierReference(yieldHandling);
     }
 
-    Node identifierReference(Handle<PropertyName*> name);
-
     bool matchLabel(YieldHandling yieldHandling, MutableHandle<PropertyName*> label);
 
     // Indicate if the next token (tokenized as Operand) is |in| or |of|.  If
     // so, consume it.
     bool matchInOrOf(bool* isForInp, bool* isForOfp);
 
   private:
     bool checkIncDecOperand(Node operand, uint32_t operandOffset);