Bug 1424946 - Move GeneralParser::prefixAccessorName into a baser class. r=arai
authorJeff Walden <jwalden@mit.edu>
Tue, 12 Dec 2017 15:21:00 -0600
changeset 448160 b971a6efd247e9ac740474ce1597a20f199418b6
parent 448159 f7119db72646c44ffbdc44310597348b378e0551
child 448161 a334be8b1d8719d1fb998995fd427c8c4dbf0a51
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::prefixAccessorName 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
@@ -2886,19 +2886,18 @@ ParserBase::leaveInnerFunction(ParseCont
     if (!outerpc->innerFunctionsForLazy.append(pc->functionBox()->function()))
         return false;
 
     PropagateTransitiveParseFlags(pc->functionBox(), outerpc->sc());
 
     return true;
 }
 
-template <class ParseHandler, typename CharT>
 JSAtom*
-GeneralParser<ParseHandler, CharT>::prefixAccessorName(PropertyType propType, HandleAtom propAtom)
+ParserBase::prefixAccessorName(PropertyType propType, HandleAtom propAtom)
 {
     RootedAtom prefix(context);
     if (propType == PropertyType::Setter || propType == PropertyType::SetterNoExpressionClosure) {
         prefix = context->names().setPrefix;
     } else {
         MOZ_ASSERT(propType == PropertyType::Getter || propType == PropertyType::GetterNoExpressionClosure);
         prefix = context->names().getPrefix;
     }
--- a/js/src/frontend/Parser.h
+++ b/js/src/frontend/Parser.h
@@ -245,16 +245,18 @@ class ParserBase
 
     bool noteUsedNameInternal(HandlePropertyName name);
     bool hasUsedName(HandlePropertyName name);
     bool hasUsedFunctionSpecialName(HandlePropertyName name);
 
     bool declareDotGeneratorName();
 
     bool leaveInnerFunction(ParseContext* outerpc);
+
+    JSAtom* prefixAccessorName(PropertyType propType, HandleAtom propAtom);
 };
 
 inline
 ParseContext::Scope::Scope(ParserBase* parser)
   : Nestable<Scope>(&parser->pc->innermostScope_),
     declared_(parser->context->frontendCollectionPool()),
     possibleAnnexBFunctionBoxes_(parser->context->frontendCollectionPool()),
     id_(parser->usedNames.nextScopeId())
@@ -534,16 +536,17 @@ class GeneralParser
     using Base::finishFunction;
     using Base::hasUsedName;
     using Base::leaveInnerFunction;
     using Base::newDotGeneratorName;
     using Base::newInternalDotName;
     using Base::newThisName;
     using Base::noteDestructuredPositionalFormalParameter;
     using Base::noteUsedName;
+    using Base::prefixAccessorName;
 
   private:
     inline FinalParser* asFinalParser();
     inline const FinalParser* asFinalParser() const;
 
     /*
      * A class for temporarily stashing errors while parsing continues.
      *
@@ -1081,18 +1084,16 @@ class GeneralParser
                        FunctionAsyncKind asyncKind, bool tryAnnexB, Directives inheritedDirectives,
                        Directives* newDirectives);
 
     bool matchOrInsertSemicolon();
 
     bool noteDeclaredName(HandlePropertyName name, DeclarationKind kind, TokenPos pos);
 
   private:
-    JSAtom* prefixAccessorName(PropertyType propType, HandleAtom propAtom);
-
     inline bool asmJS(Node list);
 };
 
 template <typename CharT>
 class Parser<SyntaxParseHandler, CharT> final
   : public GeneralParser<SyntaxParseHandler, CharT>
 {
     using Base = GeneralParser<SyntaxParseHandler, CharT>;