Bug 1528837 - Part 6: Rename ParserBase::usedNames field to usedNames_. r=Yoric
authorTooru Fujisawa <arai_a@mac.com>
Sun, 24 Feb 2019 03:27:59 +0000
changeset 518653 bc91af3d40a4d1b6c703f55f9c7dea47f9da1af0
parent 518652 1703de7ce9a0007dfce22787445581fe9c997a7f
child 518654 c46a2d2f9b6119cbddb070e0806acd422a6ca7ec
push id10862
push userffxbld-merge
push dateMon, 11 Mar 2019 13:01:11 +0000
treeherdermozilla-beta@a2e7f5c935da [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersYoric
bugs1528837
milestone67.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 1528837 - Part 6: Rename ParserBase::usedNames field to usedNames_. r=Yoric Differential Revision: https://phabricator.services.mozilla.com/D20218
js/src/frontend/ParseContext-inl.h
js/src/frontend/Parser.cpp
js/src/frontend/Parser.h
--- a/js/src/frontend/ParseContext-inl.h
+++ b/js/src/frontend/ParseContext-inl.h
@@ -38,17 +38,17 @@ inline ParseContext::Scope::BindingIter 
   return BindingIter(*this, pc->varScope_ == this ||
                                 pc->functionScope_.ptrOr(nullptr) == this);
 }
 
 inline ParseContext::Scope::Scope(ParserBase* parser)
     : Nestable<Scope>(&parser->pc_->innermostScope_),
       declared_(parser->cx_->frontendCollectionPool()),
       possibleAnnexBFunctionBoxes_(parser->cx_->frontendCollectionPool()),
-      id_(parser->usedNames.nextScopeId()) {}
+      id_(parser->usedNames_.nextScopeId()) {}
 
 inline ParseContext::Scope::Scope(JSContext* cx, ParseContext* pc,
                                   UsedNameTracker& usedNames)
     : Nestable<Scope>(&pc->innermostScope_),
       declared_(cx->frontendCollectionPool()),
       possibleAnnexBFunctionBoxes_(cx->frontendCollectionPool()),
       id_(usedNames.nextScopeId()) {}
 
--- a/js/src/frontend/Parser.cpp
+++ b/js/src/frontend/Parser.cpp
@@ -140,17 +140,17 @@ ParserBase::ParserBase(JSContext* cx, Li
                        bool foldConstants, UsedNameTracker& usedNames,
                        ScriptSourceObject* sourceObject, ParseGoal parseGoal)
     : AutoGCRooter(cx, AutoGCRooter::Tag::Parser),
       cx_(cx),
       alloc_(alloc),
       anyChars(cx, options, thisForCtor()),
       traceListHead_(nullptr),
       pc_(nullptr),
-      usedNames(usedNames),
+      usedNames_(usedNames),
       ss(nullptr),
       sourceObject(cx, sourceObject),
       keepAtoms(cx),
       foldConstants(foldConstants),
 #ifdef DEBUG
       checkOptionsCalled(false),
 #endif
       isUnexpectedEOF_(false),
@@ -792,21 +792,21 @@ bool ParserBase::noteUsedNameInternal(Ha
   // to know if they are closed over. So no need to track used name at the
   // global scope. It is not incorrect to track them, this is an
   // optimization.
   ParseContext::Scope* scope = pc_->innermostScope();
   if (pc_->sc()->isGlobalContext() && scope == &pc_->varScope()) {
     return true;
   }
 
-  return usedNames.noteUse(cx_, name, pc_->scriptId(), scope->id());
+  return usedNames_.noteUse(cx_, name, pc_->scriptId(), scope->id());
 }
 
 bool ParserBase::hasUsedName(HandlePropertyName name) {
-  if (UsedNamePtr p = usedNames.lookup(name)) {
+  if (UsedNamePtr p = usedNames_.lookup(name)) {
     return p->value().isUsedInScript(pc_->scriptId());
   }
   return false;
 }
 
 template <class ParseHandler>
 bool PerHandlerParser<ParseHandler>::
     propagateFreeNamesAndMarkClosedOverBindings(ParseContext::Scope& scope) {
@@ -825,17 +825,17 @@ bool PerHandlerParser<ParseHandler>::
     return true;
   }
 
   bool isSyntaxParser =
       mozilla::IsSame<ParseHandler, SyntaxParseHandler>::value;
   uint32_t scriptId = pc_->scriptId();
   uint32_t scopeId = scope.id();
   for (BindingIter bi = scope.bindings(pc_); bi; bi++) {
-    if (UsedNamePtr p = usedNames.lookup(bi.name())) {
+    if (UsedNamePtr p = usedNames_.lookup(bi.name())) {
       bool closedOver;
       p->value().noteBoundInScope(scriptId, scopeId, &closedOver);
       if (closedOver) {
         bi.setClosedOver();
 
         if (isSyntaxParser &&
             !pc_->closedOverBindingsForLazy().append(bi.name())) {
           ReportOutOfMemory(cx_);
@@ -2756,17 +2756,17 @@ bool Parser<FullParseHandler, Unit>::try
       break;
     }
 
     SyntaxParser* syntaxParser = getSyntaxParser();
     if (!syntaxParser) {
       break;
     }
 
-    UsedNameTracker::RewindToken token = usedNames.getRewindToken();
+    UsedNameTracker::RewindToken token = usedNames_.getRewindToken();
 
     // Move the syntax parser to the current position in the stream.
     Position currentPosition(keepAtoms, tokenStream);
     if (!syntaxParser->tokenStream.seek(currentPosition, anyChars)) {
       return false;
     }
 
     // Make a FunctionBox before we enter the syntax parser, because |pn|
@@ -2785,17 +2785,17 @@ bool Parser<FullParseHandler, Unit>::try
             SyntaxParseHandler::NodeGeneric, pc_, funbox, inHandling,
             yieldHandling, kind, newDirectives);
     if (!syntaxNode) {
       if (syntaxParser->hadAbortedSyntaxParse()) {
         // Try again with a full parse. UsedNameTracker needs to be
         // rewound to just before we tried the syntax parse for
         // correctness.
         syntaxParser->clearAbortedSyntaxParse();
-        usedNames.rewind(token);
+        usedNames_.rewind(token);
         MOZ_ASSERT_IF(!syntaxParser->cx_->helperThread(),
                       !syntaxParser->cx_->isExceptionPending());
         break;
       }
       return false;
     }
 
     // Advance this parser over tokens processed by the syntax parser.
--- a/js/src/frontend/Parser.h
+++ b/js/src/frontend/Parser.h
@@ -196,17 +196,17 @@ class ParserBase;
 template <class ParseHandler, typename Unit>
 class GeneralParser;
 
 class SourceParseContext : public ParseContext {
  public:
   template <typename ParseHandler, typename Unit>
   SourceParseContext(GeneralParser<ParseHandler, Unit>* prs, SharedContext* sc,
                      Directives* newDirectives)
-      : ParseContext(prs->cx_, prs->pc_, sc, prs->tokenStream, prs->usedNames,
+      : ParseContext(prs->cx_, prs->pc_, sc, prs->tokenStream, prs->usedNames_,
                      newDirectives,
                      mozilla::IsSame<ParseHandler, FullParseHandler>::value) {}
 };
 
 enum VarContext { HoistVars, DontHoistVars };
 enum PropListType { ObjectLiteral, ClassBody, DerivedClassBody };
 enum class PropertyType {
   Normal,
@@ -256,17 +256,17 @@ class MOZ_STACK_CLASS ParserBase : priva
 
   /* list of parsed objects and BigInts for GC tracing */
   TraceListNode* traceListHead_;
 
   /* innermost parse context (stack-allocated) */
   ParseContext* pc_;
 
   // For tracking used names in this parsing session.
-  UsedNameTracker& usedNames;
+  UsedNameTracker& usedNames_;
 
   ScriptSource* ss;
 
   RootedScriptSourceObject sourceObject;
 
   /* Root atoms and objects allocated for the parsed tree. */
   AutoKeepAtoms keepAtoms;
 
@@ -782,17 +782,17 @@ class MOZ_STACK_CLASS GeneralParser : pu
   using Base::warningWithNotesNoOffset;
 
  public:
   using Base::anyChars;
   using Base::cx_;
   using Base::handler;
   using Base::isValidSimpleAssignmentTarget;
   using Base::pc_;
-  using Base::usedNames;
+  using Base::usedNames_;
 
  private:
   using Base::checkAndMarkSuperScope;
   using Base::declareDotGeneratorName;
   using Base::declareFunctionArgumentsObject;
   using Base::declareFunctionThis;
   using Base::finishFunction;
   using Base::hasUsedName;
@@ -1506,17 +1506,17 @@ class MOZ_STACK_CLASS Parser<SyntaxParse
   using Base::null;
   using Base::options;
   using Base::pc_;
   using Base::pos;
   using Base::propagateFreeNamesAndMarkClosedOverBindings;
   using Base::ss;
   using Base::statementList;
   using Base::stringLiteral;
-  using Base::usedNames;
+  using Base::usedNames_;
 
  private:
   using Base::abortIfSyntaxParser;
   using Base::disableSyntaxParser;
 
  public:
   // Functions with multiple overloads of different visibility.  We can't
   // |using| the whole thing into existence because of the visibility
@@ -1656,17 +1656,17 @@ class MOZ_STACK_CLASS Parser<FullParseHa
   using Base::newModuleScopeData;
   using Base::newName;
   using Base::newVarScopeData;
   using Base::noteDeclaredName;
   using Base::null;
   using Base::propagateFreeNamesAndMarkClosedOverBindings;
   using Base::statementList;
   using Base::stringLiteral;
-  using Base::usedNames;
+  using Base::usedNames_;
 
   using Base::abortIfSyntaxParser;
   using Base::disableSyntaxParser;
   using Base::getSyntaxParser;
 
  public:
   // Functions with multiple overloads of different visibility.  We can't
   // |using| the whole thing into existence because of the visibility