Bug 1528837 - Part 1: Rename {ParserBase,SharedContext}::context field to cx_. r=Yoric
authorTooru Fujisawa <arai_a@mac.com>
Sun, 24 Feb 2019 09:42:28 +0000
changeset 518648 4c9346b3f7e3
parent 518647 5ddf9d49a6b3
child 518649 886ae31b4f01
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 1: Rename {ParserBase,SharedContext}::context field to cx_. r=Yoric Differential Revision: https://phabricator.services.mozilla.com/D20211
js/src/frontend/BytecodeEmitter.cpp
js/src/frontend/ParseContext-inl.h
js/src/frontend/ParseContext.cpp
js/src/frontend/ParseContext.h
js/src/frontend/Parser.cpp
js/src/frontend/Parser.h
js/src/frontend/SharedContext.cpp
js/src/frontend/SharedContext.h
--- a/js/src/frontend/BytecodeEmitter.cpp
+++ b/js/src/frontend/BytecodeEmitter.cpp
@@ -88,17 +88,17 @@ static bool ParseNodeRequiresSpecialLine
          kind == ParseNodeKind::Function;
 }
 
 BytecodeEmitter::BytecodeEmitter(BytecodeEmitter* parent, SharedContext* sc,
                                  HandleScript script,
                                  Handle<LazyScript*> lazyScript,
                                  uint32_t lineNum, EmitterMode emitterMode)
     : sc(sc),
-      cx(sc->context),
+      cx(sc->cx_),
       parent(parent),
       script(cx, script),
       lazyScript(cx, lazyScript),
       code_(cx),
       notes_(cx),
       lastNoteOffset_(0),
       currentLine_(lineNum),
       lastColumn_(0),
--- a/js/src/frontend/ParseContext-inl.h
+++ b/js/src/frontend/ParseContext-inl.h
@@ -36,18 +36,18 @@ inline ParseContext::Scope::BindingIter 
   // (like '.this') are declared as vars in the function scope, despite its
   // not being the var scope.
   return BindingIter(*this, pc->varScope_ == this ||
                                 pc->functionScope_.ptrOr(nullptr) == this);
 }
 
 inline ParseContext::Scope::Scope(ParserBase* parser)
     : Nestable<Scope>(&parser->pc->innermostScope_),
-      declared_(parser->context->frontendCollectionPool()),
-      possibleAnnexBFunctionBoxes_(parser->context->frontendCollectionPool()),
+      declared_(parser->cx_->frontendCollectionPool()),
+      possibleAnnexBFunctionBoxes_(parser->cx_->frontendCollectionPool()),
       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/ParseContext.cpp
+++ b/js/src/frontend/ParseContext.cpp
@@ -95,17 +95,17 @@ void UsedNameTracker::rewind(RewindToken
   scopeCounter_ = token.scopeId;
 
   for (UsedNameMap::Range r = map_.all(); !r.empty(); r.popFront()) {
     r.front().value().resetToScope(token.scriptId, token.scopeId);
   }
 }
 
 void ParseContext::Scope::dump(ParseContext* pc) {
-  JSContext* cx = pc->sc()->context;
+  JSContext* cx = pc->sc()->cx_;
 
   fprintf(stdout, "ParseScope %p", this);
 
   fprintf(stdout, "\n  decls:\n");
   for (DeclaredNameMap::Range r = declared_->all(); !r.empty(); r.popFront()) {
     UniqueChars bytes = AtomToPrintableString(cx, r.front().key());
     if (!bytes) {
       return;
@@ -116,17 +116,17 @@ void ParseContext::Scope::dump(ParseCont
   }
 
   fprintf(stdout, "\n");
 }
 
 bool ParseContext::Scope::addPossibleAnnexBFunctionBox(ParseContext* pc,
                                                        FunctionBox* funbox) {
   if (!possibleAnnexBFunctionBoxes_) {
-    if (!possibleAnnexBFunctionBoxes_.acquire(pc->sc()->context)) {
+    if (!possibleAnnexBFunctionBoxes_.acquire(pc->sc()->cx_)) {
       return false;
     }
   }
 
   return maybeReportOOM(pc, possibleAnnexBFunctionBoxes_->append(funbox));
 }
 
 bool ParseContext::Scope::propagateAndMarkAnnexBFunctionBoxes(
@@ -135,17 +135,17 @@ bool ParseContext::Scope::propagateAndMa
   if (pc->sc()->strict() || !possibleAnnexBFunctionBoxes_ ||
       possibleAnnexBFunctionBoxes_->empty()) {
     return true;
   }
 
   if (this == &pc->varScope()) {
     // Base case: actually declare the Annex B vars and mark applicable
     // function boxes as Annex B.
-    RootedPropertyName name(pc->sc()->context);
+    RootedPropertyName name(pc->sc()->cx_);
     Maybe<DeclarationKind> redeclaredKind;
     uint32_t unused;
     for (FunctionBox* funbox : *possibleAnnexBFunctionBoxes_) {
       if (pc->annexBAppliesToLexicalFunctionInInnermostScope(funbox)) {
         name = funbox->function()->explicitName()->asPropertyName();
         if (!pc->tryDeclareVar(
                 name, DeclarationKind::VarForAnnexBLexicalFunction,
                 DeclaredNameInfo::npos, &redeclaredKind, &unused)) {
@@ -217,17 +217,17 @@ void ParseContext::Scope::removeCatchPar
   }
 }
 
 ParseContext::ParseContext(JSContext* cx, ParseContext*& parent,
                            SharedContext* sc, ErrorReporter& errorReporter,
                            class UsedNameTracker& usedNames,
                            Directives* newDirectives, bool isFull)
     : Nestable<ParseContext>(&parent),
-      traceLog_(sc->context,
+      traceLog_(sc->cx_,
                 isFull ? TraceLogger_ParsingFull : TraceLogger_ParsingSyntax,
                 errorReporter),
       sc_(sc),
       errorReporter_(errorReporter),
       innermostStatement_(nullptr),
       innermostScope_(nullptr),
       varScope_(nullptr),
       positionalFormalParameterNames_(cx->frontendCollectionPool()),
@@ -248,17 +248,17 @@ ParseContext::ParseContext(JSContext* cx
 }
 
 bool ParseContext::init() {
   if (scriptId_ == UINT32_MAX) {
     errorReporter_.errorNoOffset(JSMSG_NEED_DIET, js_script_str);
     return false;
   }
 
-  JSContext* cx = sc()->context;
+  JSContext* cx = sc()->cx_;
 
   if (isFunctionBox()) {
     // Named lambdas always need a binding for their own name. If this
     // binding is closed over when we finish parsing the function in
     // finishExtraFunctionScopes, the function box needs to be marked as
     // needing a dynamic DeclEnv object.
     RootedFunction fun(cx, functionBox()->function());
     if (fun->isNamedLambda()) {
@@ -290,17 +290,17 @@ bool ParseContext::init() {
 
   return true;
 }
 
 bool ParseContext::annexBAppliesToLexicalFunctionInInnermostScope(
     FunctionBox* funbox) {
   MOZ_ASSERT(!sc()->strict());
 
-  RootedPropertyName name(sc()->context,
+  RootedPropertyName name(sc()->cx_,
                           funbox->function()->explicitName()->asPropertyName());
   Maybe<DeclarationKind> redeclaredKind = isVarRedeclaredInInnermostScope(
       name, DeclarationKind::VarForAnnexBLexicalFunction);
 
   if (!redeclaredKind && isFunctionBox()) {
     Scope& funScope = functionScope();
     if (&funScope != &varScope()) {
       // Annex B.3.3.1 disallows redeclaring parameter names. In the
@@ -308,17 +308,17 @@ bool ParseContext::annexBAppliesToLexica
       // function scope, which encloses the var scope. This means the
       // isVarRedeclaredInInnermostScope call above would not catch this
       // case, so test it manually.
       if (AddDeclaredNamePtr p = funScope.lookupDeclaredNameForAdd(name)) {
         DeclarationKind declaredKind = p->value()->kind();
         if (DeclarationKindIsParameter(declaredKind)) {
           redeclaredKind = Some(declaredKind);
         } else {
-          MOZ_ASSERT(FunctionScope::isSpecialName(sc()->context, name));
+          MOZ_ASSERT(FunctionScope::isSpecialName(sc()->cx_, name));
         }
       }
     }
   }
 
   // If an early error would have occurred already, this function should not
   // exhibit Annex B.3.3 semantics.
   return !redeclaredKind;
--- a/js/src/frontend/ParseContext.h
+++ b/js/src/frontend/ParseContext.h
@@ -204,18 +204,17 @@ class ParseContext : public Nestable<Par
     }
   };
 
   class LabelStatement : public Statement {
     RootedAtom label_;
 
    public:
     LabelStatement(ParseContext* pc, JSAtom* label)
-        : Statement(pc, StatementKind::Label),
-          label_(pc->sc_->context, label) {}
+        : Statement(pc, StatementKind::Label), label_(pc->sc_->cx_, label) {}
 
     HandleAtom label() const { return label_; }
   };
 
   struct ClassStatement : public Statement {
     FunctionBox* constructorBox;
 
     explicit ClassStatement(ParseContext* pc)
@@ -241,17 +240,17 @@ class ParseContext : public Nestable<Par
     // all the declared names and would know if Annex B.3.3 is applicable.
     PooledVectorPtr<FunctionBoxVector> possibleAnnexBFunctionBoxes_;
 
     // Monotonically increasing id.
     uint32_t id_;
 
     bool maybeReportOOM(ParseContext* pc, bool result) {
       if (!result) {
-        ReportOutOfMemory(pc->sc()->context);
+        ReportOutOfMemory(pc->sc()->cx_);
       }
       return result;
     }
 
    public:
     using DeclaredNamePtr = DeclaredNameMap::Ptr;
     using AddDeclaredNamePtr = DeclaredNameMap::AddPtr;
 
@@ -266,17 +265,17 @@ class ParseContext : public Nestable<Par
     uint32_t id() const { return id_; }
 
     MOZ_MUST_USE bool init(ParseContext* pc) {
       if (id_ == UINT32_MAX) {
         pc->errorReporter_.errorNoOffset(JSMSG_NEED_DIET, js_script_str);
         return false;
       }
 
-      return declared_.acquire(pc->sc()->context);
+      return declared_.acquire(pc->sc()->cx_);
     }
 
     bool isEmpty() const { return declared_->all().empty(); }
 
     DeclaredNamePtr lookupDeclaredName(JSAtom* name) {
       return declared_->lookup(name);
     }
 
--- a/js/src/frontend/Parser.cpp
+++ b/js/src/frontend/Parser.cpp
@@ -135,17 +135,17 @@ bool GeneralParser<ParseHandler, Unit>::
   return true;
 }
 
 ParserBase::ParserBase(JSContext* cx, LifoAlloc& alloc,
                        const ReadOnlyCompileOptions& options,
                        bool foldConstants, UsedNameTracker& usedNames,
                        ScriptSourceObject* sourceObject, ParseGoal parseGoal)
     : AutoGCRooter(cx, AutoGCRooter::Tag::Parser),
-      context(cx),
+      cx_(cx),
       alloc(alloc),
       anyChars(cx, options, thisForCtor()),
       traceListHead(nullptr),
       pc(nullptr),
       usedNames(usedNames),
       ss(nullptr),
       sourceObject(cx, sourceObject),
       keepAtoms(cx),
@@ -176,17 +176,17 @@ ParserBase::~ParserBase() {
 
   /*
    * The parser can allocate enormous amounts of memory for large functions.
    * Eagerly free the memory now (which otherwise won't be freed until the
    * next GC) to avoid unnecessary OOMs.
    */
   alloc.freeAllIfHugeAndUnused();
 
-  context->frontendCollectionPool().removeActiveCompilation();
+  cx_->frontendCollectionPool().removeActiveCompilation();
 }
 
 template <class ParseHandler>
 PerHandlerParser<ParseHandler>::PerHandlerParser(
     JSContext* cx, LifoAlloc& alloc, const ReadOnlyCompileOptions& options,
     bool foldConstants, UsedNameTracker& usedNames,
     LazyScript* lazyOuterFunction, ScriptSourceObject* sourceObject,
     ParseGoal parseGoal, void* internalSyntaxParser)
@@ -257,17 +257,17 @@ BoxT* ParserBase::newTraceListNode(ArgT*
    * on a list in this Parser to ensure GC safety. Thus the tempLifoAlloc
    * arenas containing the entries must be alive until we are done with
    * scanning, parsing and code generation for the whole script or top-level
    * function.
    */
 
   BoxT* box = alloc.template new_<BoxT>(arg, traceListHead);
   if (!box) {
-    ReportOutOfMemory(context);
+    ReportOutOfMemory(cx_);
     return nullptr;
   }
 
   traceListHead = box;
 
   return box;
 }
 
@@ -289,20 +289,20 @@ FunctionBox* PerHandlerParser<ParseHandl
   /*
    * We use JSContext.tempLifoAlloc to allocate parsed objects and place them
    * on a list in this Parser to ensure GC safety. Thus the tempLifoAlloc
    * arenas containing the entries must be alive until we are done with
    * scanning, parsing and code generation for the whole script or top-level
    * function.
    */
   FunctionBox* funbox = alloc.new_<FunctionBox>(
-      context, traceListHead, fun, toStringStart, inheritedDirectives,
+      cx_, traceListHead, fun, toStringStart, inheritedDirectives,
       options().extraWarningsOption, generatorKind, asyncKind);
   if (!funbox) {
-    ReportOutOfMemory(context);
+    ReportOutOfMemory(cx_);
     return nullptr;
   }
 
   traceListHead = funbox;
   if (funNode) {
     handler.setFunctionBox(funNode, funbox);
   }
 
@@ -320,24 +320,24 @@ void TraceParser(JSTracer* trc, AutoGCRo
 bool ParserBase::setSourceMapInfo() {
   // Not all clients initialize ss. Can't update info to an object that isn't
   // there.
   if (!ss) {
     return true;
   }
 
   if (anyChars.hasDisplayURL()) {
-    if (!ss->setDisplayURL(context, anyChars.displayURL())) {
+    if (!ss->setDisplayURL(cx_, anyChars.displayURL())) {
       return false;
     }
   }
 
   if (anyChars.hasSourceMapURL()) {
     MOZ_ASSERT(!ss->hasSourceMapURL());
-    if (!ss->setSourceMapURL(context, anyChars.sourceMapURL())) {
+    if (!ss->setSourceMapURL(cx_, anyChars.sourceMapURL())) {
       return false;
     }
   }
 
   /*
    * Source map URLs passed as a compile option (usually via a HTTP source map
    * header) override any source map urls passed as comment pragmas.
    */
@@ -345,33 +345,33 @@ bool ParserBase::setSourceMapInfo() {
     // Warn about the replacement, but use the new one.
     if (ss->hasSourceMapURL()) {
       if (!warningNoOffset(JSMSG_ALREADY_HAS_PRAGMA, ss->filename(),
                            "//# sourceMappingURL")) {
         return false;
       }
     }
 
-    if (!ss->setSourceMapURL(context, options().sourceMapURL())) {
+    if (!ss->setSourceMapURL(cx_, options().sourceMapURL())) {
       return false;
     }
   }
 
   return true;
 }
 
 /*
  * Parse a top-level JS script.
  */
 template <class ParseHandler, typename Unit>
 typename ParseHandler::ListNodeType GeneralParser<ParseHandler, Unit>::parse() {
   MOZ_ASSERT(checkOptionsCalled);
 
   Directives directives(options().strictOption);
-  GlobalSharedContext globalsc(context, ScopeKind::Global, directives,
+  GlobalSharedContext globalsc(cx_, ScopeKind::Global, directives,
                                options().extraWarningsOption);
   SourceParseContext globalpc(this, &globalsc, /* newDirectives = */ nullptr);
   if (!globalpc.init()) {
     return null();
   }
 
   ParseContext::VarScope varScope(this);
   if (!varScope.init(pc)) {
@@ -391,34 +391,34 @@ typename ParseHandler::ListNodeType Gene
     error(JSMSG_GARBAGE_AFTER_INPUT, "script", TokenKindToDesc(tt));
     return null();
   }
   if (foldConstants) {
     Node node = stmtList;
     // Don't constant-fold inside "use asm" code, as this could create a parse
     // tree that doesn't type-check as asm.js.
     if (!pc->useAsmOrInsideUseAsm()) {
-      if (!FoldConstants(context, &node, &handler)) {
+      if (!FoldConstants(cx_, &node, &handler)) {
         return null();
       }
     }
     stmtList = handler.asList(node);
   }
 
   return stmtList;
 }
 
 /*
  * Strict mode forbids introducing new definitions for 'eval', 'arguments',
  * 'let', 'static', 'yield', or for any strict mode reserved word.
  */
 bool ParserBase::isValidStrictBinding(PropertyName* name) {
   TokenKind tt = ReservedWordTokenKind(name);
   if (tt == TokenKind::Name) {
-    return name != context->names().eval && name != context->names().arguments;
+    return name != cx_->names().eval && name != cx_->names().arguments;
   }
   return tt != TokenKind::Let && tt != TokenKind::Static &&
          tt != TokenKind::Yield && !TokenKindIsStrictReservedWord(tt);
 }
 
 /*
  * Returns true if all parameter names are valid strict mode binding names and
  * no duplicate parameter names are present.
@@ -440,69 +440,69 @@ bool ParserBase::hasValidSimpleStrictPar
   return true;
 }
 
 template <class ParseHandler, typename Unit>
 void GeneralParser<ParseHandler, Unit>::reportMissingClosing(
     unsigned errorNumber, unsigned noteNumber, uint32_t openedPos) {
   auto notes = MakeUnique<JSErrorNotes>();
   if (!notes) {
-    ReportOutOfMemory(pc->sc()->context);
+    ReportOutOfMemory(pc->sc()->cx_);
     return;
   }
 
   uint32_t line, column;
   tokenStream.computeLineAndColumn(openedPos, &line, &column);
 
   const size_t MaxWidth = sizeof("4294967295");
   char columnNumber[MaxWidth];
   SprintfLiteral(columnNumber, "%" PRIu32, column);
   char lineNumber[MaxWidth];
   SprintfLiteral(lineNumber, "%" PRIu32, line);
 
-  if (!notes->addNoteASCII(pc->sc()->context, getFilename(), line, column,
+  if (!notes->addNoteASCII(pc->sc()->cx_, getFilename(), line, column,
                            GetErrorMessage, nullptr, noteNumber, lineNumber,
                            columnNumber)) {
     return;
   }
 
   errorWithNotes(std::move(notes), errorNumber);
 }
 
 template <class ParseHandler, typename Unit>
 void GeneralParser<ParseHandler, Unit>::reportRedeclaration(
     HandlePropertyName name, DeclarationKind prevKind, TokenPos pos,
     uint32_t prevPos) {
-  UniqueChars bytes = AtomToPrintableString(context, name);
+  UniqueChars bytes = AtomToPrintableString(cx_, name);
   if (!bytes) {
     return;
   }
 
   if (prevPos == DeclaredNameInfo::npos) {
     errorAt(pos.begin, JSMSG_REDECLARED_VAR, DeclarationKindString(prevKind),
             bytes.get());
     return;
   }
 
   auto notes = MakeUnique<JSErrorNotes>();
   if (!notes) {
-    ReportOutOfMemory(pc->sc()->context);
+    ReportOutOfMemory(pc->sc()->cx_);
     return;
   }
 
   uint32_t line, column;
   tokenStream.computeLineAndColumn(prevPos, &line, &column);
 
   const size_t MaxWidth = sizeof("4294967295");
   char columnNumber[MaxWidth];
   SprintfLiteral(columnNumber, "%" PRIu32, column);
   char lineNumber[MaxWidth];
   SprintfLiteral(lineNumber, "%" PRIu32, line);
 
-  if (!notes->addNoteASCII(pc->sc()->context, getFilename(), line, column,
+  if (!notes->addNoteASCII(pc->sc()->cx_, getFilename(), line, column,
                            GetErrorMessage, nullptr, JSMSG_REDECLARED_PREV,
                            lineNumber, columnNumber)) {
     return;
   }
 
   errorWithNotesAt(std::move(notes), pos.begin, JSMSG_REDECLARED_VAR,
                    DeclarationKindString(prevKind), bytes.get());
 }
@@ -527,17 +527,17 @@ bool GeneralParser<ParseHandler, Unit>::
       return false;
     }
 
     // Strict-mode disallows duplicate args. We may not know whether we are
     // in strict mode or not (since the function body hasn't been parsed).
     // In such cases, report will queue up the potential error and return
     // 'true'.
     if (pc->sc()->needStrictChecks()) {
-      UniqueChars bytes = AtomToPrintableString(context, name);
+      UniqueChars bytes = AtomToPrintableString(cx_, name);
       if (!bytes) {
         return false;
       }
       if (!strictModeError(JSMSG_DUPLICATE_FORMAL, bytes.get())) {
         return false;
       }
     }
 
@@ -545,17 +545,17 @@ bool GeneralParser<ParseHandler, Unit>::
   } else {
     DeclarationKind kind = DeclarationKind::PositionalFormalParameter;
     if (!pc->functionScope().addDeclaredName(pc, p, name, kind, beginPos)) {
       return false;
     }
   }
 
   if (!pc->positionalFormalParameterNames().append(name)) {
-    ReportOutOfMemory(context);
+    ReportOutOfMemory(cx_);
     return false;
   }
 
   NameNodeType paramNode = newName(name);
   if (!paramNode) {
     return false;
   }
 
@@ -564,17 +564,17 @@ bool GeneralParser<ParseHandler, Unit>::
 }
 
 template <class ParseHandler>
 bool PerHandlerParser<ParseHandler>::noteDestructuredPositionalFormalParameter(
     FunctionNodeType funNode, Node destruct) {
   // Append an empty name to the positional formals vector to keep track of
   // argument slots when making FunctionScope::Data.
   if (!pc->positionalFormalParameterNames().append(nullptr)) {
-    ReportOutOfMemory(context);
+    ReportOutOfMemory(cx_);
     return false;
   }
 
   handler.addFunctionFormalParameter(funNode, destruct);
   return true;
 }
 
 template <class ParseHandler, typename Unit>
@@ -704,27 +704,27 @@ bool GeneralParser<ParseHandler, Unit>::
     }
 
     case DeclarationKind::Let:
     case DeclarationKind::Const:
     case DeclarationKind::Class:
       // The BoundNames of LexicalDeclaration and ForDeclaration must not
       // contain 'let'. (CatchParameter is the only lexical binding form
       // without this restriction.)
-      if (name == context->names().let) {
+      if (name == cx_->names().let) {
         errorAt(pos.begin, JSMSG_LEXICAL_DECL_DEFINES_LET);
         return false;
       }
 
       MOZ_FALLTHROUGH;
 
     case DeclarationKind::Import:
       // Module code is always strict, so 'let' is always a keyword and never a
       // name.
-      MOZ_ASSERT(name != context->names().let);
+      MOZ_ASSERT(name != cx_->names().let);
       MOZ_FALLTHROUGH;
 
     case DeclarationKind::SimpleCatchParameter:
     case DeclarationKind::CatchParameter: {
       if (ParseContext::Statement* stmt = pc->innermostStatement()) {
         if (!checkLexicalDeclarationDirectlyWithinBlock(*stmt, kind, pos)) {
           return false;
         }
@@ -790,17 +790,17 @@ 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(context, 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)) {
     return p->value().isUsedInScript(pc->scriptId());
   }
   return false;
 }
@@ -831,26 +831,26 @@ bool PerHandlerParser<ParseHandler>::
     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(context);
+          ReportOutOfMemory(cx_);
           return false;
         }
       }
     }
   }
 
   // Append a nullptr to denote end-of-scope.
   if (isSyntaxParser && !pc->closedOverBindingsForLazy().append(nullptr)) {
-    ReportOutOfMemory(context);
+    ReportOutOfMemory(cx_);
     return false;
   }
 
   return true;
 }
 
 template <typename Unit>
 bool Parser<FullParseHandler, Unit>::checkStatementsEOF() {
@@ -929,23 +929,23 @@ static MOZ_ALWAYS_INLINE void Initialize
 #endif
       detail::InitializeIndexedBindings(data, start, cursor,
                                         std::forward<Step>(step)...);
 
   MOZ_ASSERT(PointerRangeSize(start, end) == count);
   data->length = count;
 }
 
-Maybe<GlobalScope::Data*> NewGlobalScopeData(JSContext* context,
+Maybe<GlobalScope::Data*> NewGlobalScopeData(JSContext* cx,
                                              ParseContext::Scope& scope,
                                              LifoAlloc& alloc,
                                              ParseContext* pc) {
-  BindingNameVector vars(context);
-  BindingNameVector lets(context);
-  BindingNameVector consts(context);
+  BindingNameVector vars(cx);
+  BindingNameVector lets(cx);
+  BindingNameVector consts(cx);
 
   bool allBindingsClosedOver = pc->sc()->allBindingsClosedOver();
   for (BindingIter bi = scope.bindings(pc); bi; bi++) {
     bool closedOver = allBindingsClosedOver || bi.closedOver();
 
     switch (bi.kind()) {
       case BindingKind::Var: {
         bool isTopLevelFunction =
@@ -974,43 +974,43 @@ Maybe<GlobalScope::Data*> NewGlobalScope
         MOZ_CRASH("Bad global scope BindingKind");
     }
   }
 
   GlobalScope::Data* bindings = nullptr;
   uint32_t numBindings = vars.length() + lets.length() + consts.length();
 
   if (numBindings > 0) {
-    bindings = NewEmptyBindingData<GlobalScope>(context, alloc, numBindings);
+    bindings = NewEmptyBindingData<GlobalScope>(cx, alloc, numBindings);
     if (!bindings) {
       return Nothing();
     }
 
     // The ordering here is important. See comments in GlobalScope.
     InitializeBindingData(bindings, numBindings, vars,
                           &GlobalScope::Data::letStart, lets,
                           &GlobalScope::Data::constStart, consts);
   }
 
   return Some(bindings);
 }
 
 Maybe<GlobalScope::Data*> ParserBase::newGlobalScopeData(
     ParseContext::Scope& scope) {
-  return NewGlobalScopeData(context, scope, alloc, pc);
-}
-
-Maybe<ModuleScope::Data*> NewModuleScopeData(JSContext* context,
+  return NewGlobalScopeData(cx_, scope, alloc, pc);
+}
+
+Maybe<ModuleScope::Data*> NewModuleScopeData(JSContext* cx,
                                              ParseContext::Scope& scope,
                                              LifoAlloc& alloc,
                                              ParseContext* pc) {
-  BindingNameVector imports(context);
-  BindingNameVector vars(context);
-  BindingNameVector lets(context);
-  BindingNameVector consts(context);
+  BindingNameVector imports(cx);
+  BindingNameVector vars(cx);
+  BindingNameVector lets(cx);
+  BindingNameVector consts(cx);
 
   bool allBindingsClosedOver = pc->sc()->allBindingsClosedOver();
   for (BindingIter bi = scope.bindings(pc); bi; bi++) {
     // Imports are indirect bindings and must not be given known slots.
     BindingName binding(bi.name(), (allBindingsClosedOver || bi.closedOver()) &&
                                        bi.kind() != BindingKind::Import);
     switch (bi.kind()) {
       case BindingKind::Import:
@@ -1038,40 +1038,40 @@ Maybe<ModuleScope::Data*> NewModuleScope
     }
   }
 
   ModuleScope::Data* bindings = nullptr;
   uint32_t numBindings =
       imports.length() + vars.length() + lets.length() + consts.length();
 
   if (numBindings > 0) {
-    bindings = NewEmptyBindingData<ModuleScope>(context, alloc, numBindings);
+    bindings = NewEmptyBindingData<ModuleScope>(cx, alloc, numBindings);
     if (!bindings) {
       return Nothing();
     }
 
     // The ordering here is important. See comments in ModuleScope.
     InitializeBindingData(bindings, numBindings, imports,
                           &ModuleScope::Data::varStart, vars,
                           &ModuleScope::Data::letStart, lets,
                           &ModuleScope::Data::constStart, consts);
   }
 
   return Some(bindings);
 }
 
 Maybe<ModuleScope::Data*> ParserBase::newModuleScopeData(
     ParseContext::Scope& scope) {
-  return NewModuleScopeData(context, scope, alloc, pc);
-}
-
-Maybe<EvalScope::Data*> NewEvalScopeData(JSContext* context,
+  return NewModuleScopeData(cx_, scope, alloc, pc);
+}
+
+Maybe<EvalScope::Data*> NewEvalScopeData(JSContext* cx,
                                          ParseContext::Scope& scope,
                                          LifoAlloc& alloc, ParseContext* pc) {
-  BindingNameVector vars(context);
+  BindingNameVector vars(cx);
 
   for (BindingIter bi = scope.bindings(pc); bi; bi++) {
     // Eval scopes only contain 'var' bindings. Make all bindings aliased
     // for now.
     MOZ_ASSERT(bi.kind() == BindingKind::Var);
     bool isTopLevelFunction =
         bi.declarationKind() == DeclarationKind::BodyLevelFunction;
     BindingName binding(bi.name(), true, isTopLevelFunction);
@@ -1079,40 +1079,40 @@ Maybe<EvalScope::Data*> NewEvalScopeData
       return Nothing();
     }
   }
 
   EvalScope::Data* bindings = nullptr;
   uint32_t numBindings = vars.length();
 
   if (numBindings > 0) {
-    bindings = NewEmptyBindingData<EvalScope>(context, alloc, numBindings);
+    bindings = NewEmptyBindingData<EvalScope>(cx, alloc, numBindings);
     if (!bindings) {
       return Nothing();
     }
 
     InitializeBindingData(bindings, numBindings, vars);
   }
 
   return Some(bindings);
 }
 
 Maybe<EvalScope::Data*> ParserBase::newEvalScopeData(
     ParseContext::Scope& scope) {
-  return NewEvalScopeData(context, scope, alloc, pc);
-}
-
-Maybe<FunctionScope::Data*> NewFunctionScopeData(JSContext* context,
+  return NewEvalScopeData(cx_, scope, alloc, pc);
+}
+
+Maybe<FunctionScope::Data*> NewFunctionScopeData(JSContext* cx,
                                                  ParseContext::Scope& scope,
                                                  bool hasParameterExprs,
                                                  LifoAlloc& alloc,
                                                  ParseContext* pc) {
-  BindingNameVector positionalFormals(context);
-  BindingNameVector formals(context);
-  BindingNameVector vars(context);
+  BindingNameVector positionalFormals(cx);
+  BindingNameVector formals(cx);
+  BindingNameVector vars(cx);
 
   bool allBindingsClosedOver = pc->sc()->allBindingsClosedOver();
   bool hasDuplicateParams = pc->functionBox()->hasDuplicateParameters;
 
   // Positional parameter names must be added in order of appearance as they are
   // referenced using argument slots.
   for (size_t i = 0; i < pc->positionalFormalParameterNames().length(); i++) {
     JSAtom* name = pc->positionalFormalParameterNames()[i];
@@ -1159,91 +1159,91 @@ Maybe<FunctionScope::Data*> NewFunctionS
           }
         }
         break;
       case BindingKind::Var:
         // The only vars in the function scope when there are parameter
         // exprs, which induces a separate var environment, should be the
         // special bindings.
         MOZ_ASSERT_IF(hasParameterExprs,
-                      FunctionScope::isSpecialName(context, bi.name()));
+                      FunctionScope::isSpecialName(cx, bi.name()));
         if (!vars.append(binding)) {
           return Nothing();
         }
         break;
       default:
         break;
     }
   }
 
   FunctionScope::Data* bindings = nullptr;
   uint32_t numBindings =
       positionalFormals.length() + formals.length() + vars.length();
 
   if (numBindings > 0) {
-    bindings = NewEmptyBindingData<FunctionScope>(context, alloc, numBindings);
+    bindings = NewEmptyBindingData<FunctionScope>(cx, alloc, numBindings);
     if (!bindings) {
       return Nothing();
     }
 
     // The ordering here is important. See comments in FunctionScope.
     InitializeBindingData(bindings, numBindings, positionalFormals,
                           &FunctionScope::Data::nonPositionalFormalStart,
                           formals, &FunctionScope::Data::varStart, vars);
   }
 
   return Some(bindings);
 }
 
 Maybe<FunctionScope::Data*> ParserBase::newFunctionScopeData(
     ParseContext::Scope& scope, bool hasParameterExprs) {
-  return NewFunctionScopeData(context, scope, hasParameterExprs, alloc, pc);
-}
-
-Maybe<VarScope::Data*> NewVarScopeData(JSContext* context,
+  return NewFunctionScopeData(cx_, scope, hasParameterExprs, alloc, pc);
+}
+
+Maybe<VarScope::Data*> NewVarScopeData(JSContext* cx,
                                        ParseContext::Scope& scope,
                                        LifoAlloc& alloc, ParseContext* pc) {
-  BindingNameVector vars(context);
+  BindingNameVector vars(cx);
 
   bool allBindingsClosedOver = pc->sc()->allBindingsClosedOver();
 
   for (BindingIter bi = scope.bindings(pc); bi; bi++) {
     if (bi.kind() == BindingKind::Var) {
       BindingName binding(bi.name(), allBindingsClosedOver || bi.closedOver());
       if (!vars.append(binding)) {
         return Nothing();
       }
     }
   }
 
   VarScope::Data* bindings = nullptr;
   uint32_t numBindings = vars.length();
 
   if (numBindings > 0) {
-    bindings = NewEmptyBindingData<VarScope>(context, alloc, numBindings);
+    bindings = NewEmptyBindingData<VarScope>(cx, alloc, numBindings);
     if (!bindings) {
       return Nothing();
     }
 
     InitializeBindingData(bindings, numBindings, vars);
   }
 
   return Some(bindings);
 }
 
 Maybe<VarScope::Data*> ParserBase::newVarScopeData(ParseContext::Scope& scope) {
-  return NewVarScopeData(context, scope, alloc, pc);
-}
-
-Maybe<LexicalScope::Data*> NewLexicalScopeData(JSContext* context,
+  return NewVarScopeData(cx_, scope, alloc, pc);
+}
+
+Maybe<LexicalScope::Data*> NewLexicalScopeData(JSContext* cx,
                                                ParseContext::Scope& scope,
                                                LifoAlloc& alloc,
                                                ParseContext* pc) {
-  BindingNameVector lets(context);
-  BindingNameVector consts(context);
+  BindingNameVector lets(cx);
+  BindingNameVector consts(cx);
 
   // Unlike other scopes with bindings which are body-level, it is unknown
   // if pc->sc()->allBindingsClosedOver() is correct at the time of
   // finishing parsing a lexical scope.
   //
   // Instead, pc->sc()->allBindingsClosedOver() is checked in
   // EmitterScope::enterLexical. Also see comment there.
   for (BindingIter bi = scope.bindings(pc); bi; bi++) {
@@ -1263,32 +1263,32 @@ Maybe<LexicalScope::Data*> NewLexicalSco
         break;
     }
   }
 
   LexicalScope::Data* bindings = nullptr;
   uint32_t numBindings = lets.length() + consts.length();
 
   if (numBindings > 0) {
-    bindings = NewEmptyBindingData<LexicalScope>(context, alloc, numBindings);
+    bindings = NewEmptyBindingData<LexicalScope>(cx, alloc, numBindings);
     if (!bindings) {
       return Nothing();
     }
 
     // The ordering here is important. See comments in LexicalScope.
     InitializeBindingData(bindings, numBindings, lets,
                           &LexicalScope::Data::constStart, consts);
   }
 
   return Some(bindings);
 }
 
 Maybe<LexicalScope::Data*> ParserBase::newLexicalScopeData(
     ParseContext::Scope& scope) {
-  return NewLexicalScopeData(context, scope, alloc, pc);
+  return NewLexicalScopeData(cx_, scope, alloc, pc);
 }
 
 template <>
 SyntaxParseHandler::LexicalScopeNodeType
 PerHandlerParser<SyntaxParseHandler>::finishLexicalScope(
     ParseContext::Scope& scope, Node body) {
   if (!propagateFreeNamesAndMarkClosedOverBindings(scope)) {
     return null();
@@ -1372,17 +1372,17 @@ LexicalScopeNode* Parser<FullParseHandle
                "allows super.property");
   }
 #endif
 
   ParseNode* node = body;
   // Don't constant-fold inside "use asm" code, as this could create a parse
   // tree that doesn't type-check as asm.js.
   if (!pc->useAsmOrInsideUseAsm()) {
-    if (!FoldConstants(context, &node, &handler)) {
+    if (!FoldConstants(cx_, &node, &handler)) {
       return null();
     }
   }
   body = handler.asLexicalScope(node);
 
   if (!this->setSourceMapInfo()) {
     return nullptr;
   }
@@ -1424,17 +1424,17 @@ ListNode* Parser<FullParseHandler, Unit>
   if (!checkStatementsEOF()) {
     return nullptr;
   }
 
   ParseNode* node = body;
   // Don't constant-fold inside "use asm" code, as this could create a parse
   // tree that doesn't type-check as asm.js.
   if (!pc->useAsmOrInsideUseAsm()) {
-    if (!FoldConstants(context, &node, &handler)) {
+    if (!FoldConstants(cx_, &node, &handler)) {
       return null();
     }
   }
   body = &node->as<ListNode>();
 
   if (!this->setSourceMapInfo()) {
     return nullptr;
   }
@@ -1500,33 +1500,33 @@ ModuleNode* Parser<FullParseHandler, Uni
 
   // Check exported local bindings exist and mark them as closed over.
   for (auto entry : modulesc->builder.localExportEntries()) {
     JSAtom* name = entry->localName();
     MOZ_ASSERT(name);
 
     DeclaredNamePtr p = modulepc.varScope().lookupDeclaredName(name);
     if (!p) {
-      UniqueChars str = AtomToPrintableString(context, name);
+      UniqueChars str = AtomToPrintableString(cx_, name);
       if (!str) {
         return null();
       }
 
       errorNoOffset(JSMSG_MISSING_EXPORT, str.get());
       return null();
     }
 
     p->value()->setClosedOver();
   }
 
   ParseNode* node = stmtList;
   // Don't constant-fold inside "use asm" code, as this could create a parse
   // tree that doesn't type-check as asm.js.
   if (!pc->useAsmOrInsideUseAsm()) {
-    if (!FoldConstants(context, &node, &handler)) {
+    if (!FoldConstants(cx_, &node, &handler)) {
       return null();
     }
   }
   stmtList = &node->as<ListNode>();
 
   if (!this->setSourceMapInfo()) {
     return null();
   }
@@ -1547,33 +1547,32 @@ ModuleNode* Parser<FullParseHandler, Uni
 template <typename Unit>
 SyntaxParseHandler::ModuleNodeType Parser<SyntaxParseHandler, Unit>::moduleBody(
     ModuleSharedContext* modulesc) {
   MOZ_ALWAYS_FALSE(abortIfSyntaxParser());
   return SyntaxParseHandler::NodeFailure;
 }
 
 bool ParserBase::hasUsedFunctionSpecialName(HandlePropertyName name) {
-  MOZ_ASSERT(name == context->names().arguments ||
-             name == context->names().dotThis);
+  MOZ_ASSERT(name == cx_->names().arguments || name == cx_->names().dotThis);
   return hasUsedName(name) || pc->functionBox()->bindingsAccessedDynamically();
 }
 
 template <class ParseHandler>
 bool PerHandlerParser<ParseHandler>::declareFunctionThis() {
   // The asm.js validator does all its own symbol-table management so, as an
   // optimization, avoid doing any work here.
   if (pc->useAsmOrInsideUseAsm()) {
     return true;
   }
 
   // Derived class constructors emit JSOP_CHECKRETURN, which requires
   // '.this' to be bound.
   FunctionBox* funbox = pc->functionBox();
-  HandlePropertyName dotThis = context->names().dotThis;
+  HandlePropertyName dotThis = cx_->names().dotThis;
 
   bool declareThis;
   if (handler.canSkipLazyClosedOverBindings()) {
     declareThis = funbox->function()->lazyScript()->hasThisBinding();
   } else {
     declareThis = hasUsedFunctionSpecialName(dotThis) ||
                   funbox->isDerivedClassConstructor();
   }
@@ -1603,30 +1602,30 @@ PerHandlerParser<ParseHandler>::newInter
     return null();
   }
   return nameNode;
 }
 
 template <class ParseHandler>
 typename ParseHandler::NameNodeType
 PerHandlerParser<ParseHandler>::newThisName() {
-  return newInternalDotName(context->names().dotThis);
+  return newInternalDotName(cx_->names().dotThis);
 }
 
 template <class ParseHandler>
 typename ParseHandler::NameNodeType
 PerHandlerParser<ParseHandler>::newDotGeneratorName() {
-  return newInternalDotName(context->names().dotGenerator);
+  return newInternalDotName(cx_->names().dotGenerator);
 }
 
 bool ParserBase::declareDotGeneratorName() {
   // The special '.generator' binding must be on the function scope, as
   // generators expect to find it on the CallObject.
   ParseContext::Scope& funScope = pc->functionScope();
-  HandlePropertyName dotGenerator = context->names().dotGenerator;
+  HandlePropertyName dotGenerator = cx_->names().dotGenerator;
   AddDeclaredNamePtr p = funScope.lookupDeclaredNameForAdd(dotGenerator);
   if (!p && !funScope.addDeclaredName(pc, p, dotGenerator, DeclarationKind::Var,
                                       DeclaredNameInfo::npos)) {
     return false;
   }
   return true;
 }
 
@@ -1707,19 +1706,19 @@ bool PerHandlerParser<SyntaxParseHandler
           LazyScript::NumClosedOverBindingsLimit ||
       pc->innerFunctionsForLazy.length() >=
           LazyScript::NumInnerFunctionsLimit) {
     MOZ_ALWAYS_FALSE(abortIfSyntaxParser());
     return false;
   }
 
   FunctionBox* funbox = pc->functionBox();
-  RootedFunction fun(context, funbox->function());
+  RootedFunction fun(cx_, funbox->function());
   LazyScript* lazy = LazyScript::Create(
-      context, fun, sourceObject, pc->closedOverBindingsForLazy(),
+      cx_, fun, sourceObject, pc->closedOverBindingsForLazy(),
       pc->innerFunctionsForLazy, funbox->bufStart, funbox->bufEnd,
       funbox->toStringStart, funbox->startLine, funbox->startColumn,
       parseGoal());
   if (!lazy) {
     return false;
   }
 
   // Flags that need to be copied into the JSScript when we do the full
@@ -1852,17 +1851,17 @@ FunctionNode* Parser<FullParseHandler, U
     error(JSMSG_GARBAGE_AFTER_INPUT, "function body", TokenKindToDesc(tt));
     return null();
   }
 
   ParseNode* node = funNode;
   // Don't constant-fold inside "use asm" code, as this could create a parse
   // tree that doesn't type-check as asm.js.
   if (!pc->useAsmOrInsideUseAsm()) {
-    if (!FoldConstants(context, &node, &handler)) {
+    if (!FoldConstants(cx_, &node, &handler)) {
       return null();
     }
   }
   funNode = &node->as<FunctionNode>();
 
   if (!this->setSourceMapInfo()) {
     return null();
   }
@@ -1874,17 +1873,17 @@ template <class ParseHandler>
 bool PerHandlerParser<ParseHandler>::declareFunctionArgumentsObject() {
   FunctionBox* funbox = pc->functionBox();
   ParseContext::Scope& funScope = pc->functionScope();
   ParseContext::Scope& varScope = pc->varScope();
 
   bool hasExtraBodyVarScope = &funScope != &varScope;
 
   // Time to implement the odd semantics of 'arguments'.
-  HandlePropertyName argumentsName = context->names().arguments;
+  HandlePropertyName argumentsName = cx_->names().arguments;
 
   bool tryDeclareArguments;
   if (handler.canSkipLazyClosedOverBindings()) {
     tryDeclareArguments =
         funbox->function()->lazyScript()->shouldDeclareArguments();
   } else {
     tryDeclareArguments = hasUsedFunctionSpecialName(argumentsName);
   }
@@ -2124,17 +2123,17 @@ JSFunction* AllocNewFunction(JSContext* 
   }
   return fun;
 }
 
 JSFunction* ParserBase::newFunction(HandleAtom atom, FunctionSyntaxKind kind,
                                     GeneratorKind generatorKind,
                                     FunctionAsyncKind asyncKind,
                                     HandleObject proto /* = nullptr */) {
-  return AllocNewFunction(context, atom, kind, generatorKind, asyncKind, proto,
+  return AllocNewFunction(cx_, atom, kind, generatorKind, asyncKind, proto,
                           options().selfHostingMode, pc->isFunctionBox());
 }
 
 template <class ParseHandler, typename Unit>
 bool GeneralParser<ParseHandler, Unit>::matchOrInsertSemicolon() {
   TokenKind tt = TokenKind::Eof;
   if (!tokenStream.peekTokenSameLine(&tt, TokenStream::Operand)) {
     return false;
@@ -2200,30 +2199,30 @@ bool ParserBase::leaveInnerFunction(Pars
 
   PropagateTransitiveParseFlags(pc->functionBox(), outerpc->sc());
 
   return true;
 }
 
 JSAtom* ParserBase::prefixAccessorName(PropertyType propType,
                                        HandleAtom propAtom) {
-  RootedAtom prefix(context);
+  RootedAtom prefix(cx_);
   if (propType == PropertyType::Setter) {
-    prefix = context->names().setPrefix;
+    prefix = cx_->names().setPrefix;
   } else {
     MOZ_ASSERT(propType == PropertyType::Getter);
-    prefix = context->names().getPrefix;
-  }
-
-  RootedString str(context, ConcatStrings<CanGC>(context, prefix, propAtom));
+    prefix = cx_->names().getPrefix;
+  }
+
+  RootedString str(cx_, ConcatStrings<CanGC>(cx_, prefix, propAtom));
   if (!str) {
     return nullptr;
   }
 
-  return AtomizeString(context, str);
+  return AtomizeString(cx_, str);
 }
 
 template <class ParseHandler, typename Unit>
 bool GeneralParser<ParseHandler, Unit>::functionArguments(
     YieldHandling yieldHandling, FunctionSyntaxKind kind,
     FunctionNodeType funNode) {
   FunctionBox* funbox = pc->functionBox();
 
@@ -2398,17 +2397,17 @@ bool GeneralParser<ParseHandler, Unit>::
             error(JSMSG_MISSING_FORMAL);
             return false;
           }
 
           if (parenFreeArrow) {
             tokenStream.setFunctionStart(funbox);
           }
 
-          RootedPropertyName name(context, bindingIdentifier(yieldHandling));
+          RootedPropertyName name(cx_, bindingIdentifier(yieldHandling));
           if (!name) {
             return false;
           }
 
           if (!notePositionalFormalParameter(funNode, name, pos().begin,
                                              disallowDuplicateParams,
                                              &duplicatedParam)) {
             return false;
@@ -2536,17 +2535,17 @@ template <typename Unit>
 bool Parser<FullParseHandler, Unit>::skipLazyInnerFunction(
     FunctionNode* funNode, uint32_t toStringStart, FunctionSyntaxKind kind,
     bool tryAnnexB) {
   // When a lazily-parsed function is called, we only fully parse (and emit)
   // that function, not any of its nested children. The initial syntax-only
   // parse recorded the free variables of nested functions and their extents,
   // so we can skip over them after accounting for their free variables.
 
-  RootedFunction fun(context, handler.nextLazyInnerFunction());
+  RootedFunction fun(cx_, handler.nextLazyInnerFunction());
   FunctionBox* funbox = newFunctionBox(funNode, fun, toStringStart,
                                        Directives(/* strict = */ false),
                                        fun->generatorKind(), fun->asyncKind());
   if (!funbox) {
     return false;
   }
 
   LazyScript* lazy = fun->lazyScript();
@@ -2676,27 +2675,27 @@ GeneralParser<ParseHandler, Unit>::funct
   if (handler.canSkipLazyInnerFunctions()) {
     if (!skipLazyInnerFunction(funNode, toStringStart, kind, tryAnnexB)) {
       return null();
     }
 
     return funNode;
   }
 
-  RootedObject proto(context);
+  RootedObject proto(cx_);
   if (generatorKind == GeneratorKind::Generator ||
       asyncKind == FunctionAsyncKind::AsyncFunction) {
-    proto = GlobalObject::getOrCreateGeneratorFunctionPrototype(
-        context, context->global());
+    proto =
+        GlobalObject::getOrCreateGeneratorFunctionPrototype(cx_, cx_->global());
     if (!proto) {
       return null();
     }
   }
   RootedFunction fun(
-      context, newFunction(funName, kind, generatorKind, asyncKind, proto));
+      cx_, newFunction(funName, kind, generatorKind, asyncKind, proto));
   if (!fun) {
     return null();
   }
 
   // Speculatively parse using the directives of the parent parsing context.
   // If a directive is encountered (e.g., "use strict") that changes how the
   // function should have been parsed, we backup and reparse with the new set
   // of directives.
@@ -2784,18 +2783,18 @@ bool Parser<FullParseHandler, Unit>::try
             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);
-        MOZ_ASSERT_IF(!syntaxParser->context->helperThread(),
-                      !syntaxParser->context->isExceptionPending());
+        MOZ_ASSERT_IF(!syntaxParser->cx_->helperThread(),
+                      !syntaxParser->cx_->isExceptionPending());
         break;
       }
       return false;
     }
 
     // Advance this parser over tokens processed by the syntax parser.
     Position currentSyntaxPosition(keepAtoms, syntaxParser->tokenStream);
     if (!tokenStream.seek(currentSyntaxPosition, syntaxParser->anyChars)) {
@@ -3002,17 +3001,17 @@ FunctionNode* Parser<FullParseHandler, U
     MOZ_ASSERT(directives == newDirectives);
     return null();
   }
 
   ParseNode* node = funNode;
   // Don't constant-fold inside "use asm" code, as this could create a parse
   // tree that doesn't type-check as asm.js.
   if (!pc->useAsmOrInsideUseAsm()) {
-    if (!FoldConstants(context, &node, &handler)) {
+    if (!FoldConstants(cx_, &node, &handler)) {
       return null();
     }
   }
   funNode = &node->as<FunctionNode>();
 
   return funNode;
 }
 
@@ -3022,17 +3021,17 @@ bool GeneralParser<ParseHandler, Unit>::
     FunctionNodeType* funNode, FunctionSyntaxKind kind,
     const Maybe<uint32_t>& parameterListEnd /* = Nothing() */,
     bool isStandaloneFunction /* = false */) {
   // Given a properly initialized parse context, try to parse an actual
   // function without concern for conversion to strict mode, use of lazy
   // parsing and such.
 
   FunctionBox* funbox = pc->functionBox();
-  RootedFunction fun(context, funbox->function());
+  RootedFunction fun(cx_, funbox->function());
 
   // See below for an explanation why arrow function parameters and arrow
   // function bodies are parsed with different yield/await settings.
   {
     AwaitHandling awaitHandling =
         (funbox->isAsync() ||
          (kind == FunctionSyntaxKind::Arrow && awaitIsKeyword()))
             ? AwaitIsKeyword
@@ -3224,24 +3223,24 @@ GeneralParser<ParseHandler, Unit>::funct
   GeneratorKind generatorKind = GeneratorKind::NotGenerator;
   if (tt == TokenKind::Mul) {
     generatorKind = GeneratorKind::Generator;
     if (!tokenStream.getToken(&tt)) {
       return null();
     }
   }
 
-  RootedPropertyName name(context);
+  RootedPropertyName name(cx_);
   if (TokenKindIsPossibleIdentifier(tt)) {
     name = bindingIdentifier(yieldHandling);
     if (!name) {
       return null();
     }
   } else if (defaultHandling == AllowDefaultName) {
-    name = context->names().default_;
+    name = cx_->names().default_;
     anyChars.ungetToken();
   } else {
     /* Unnamed function expressions are forbidden in statement context. */
     error(JSMSG_UNNAMED_FUNCTION_STMT);
     return null();
   }
 
   // Note the declared name and check for early errors.
@@ -3304,17 +3303,17 @@ GeneralParser<ParseHandler, Unit>::funct
     generatorKind = GeneratorKind::Generator;
     if (!tokenStream.getToken(&tt)) {
       return null();
     }
   }
 
   YieldHandling yieldHandling = GetYieldHandling(generatorKind);
 
-  RootedPropertyName name(context);
+  RootedPropertyName name(cx_);
   if (TokenKindIsPossibleIdentifier(tt)) {
     name = bindingIdentifier(yieldHandling);
     if (!name) {
       return null();
     }
   } else {
     anyChars.ungetToken();
   }
@@ -3391,17 +3390,17 @@ bool Parser<FullParseHandler, Unit>::asm
   pc->functionBox()->useAsm = true;
 
   // Attempt to validate and compile this asm.js module. On success, the
   // tokenStream has been advanced to the closing }. On failure, the
   // tokenStream is in an indeterminate state and we must reparse the
   // function from the beginning. Reparsing is triggered by marking that a
   // new directive has been encountered and returning 'false'.
   bool validated;
-  if (!CompileAsmJS(context, *this, list, &validated)) {
+  if (!CompileAsmJS(cx_, *this, list, &validated)) {
     return false;
   }
   if (!validated) {
     pc->newDirectives->setAsmJS();
     return false;
   }
 
   return true;
@@ -3451,17 +3450,17 @@ bool GeneralParser<ParseHandler, Unit>::
     //
     // Note that even if the string isn't one we recognize as a directive,
     // the emitter still shouldn't flag it as useless, as it could become a
     // directive in the future. We don't want to interfere with people
     // taking advantage of directive-prologue-enabled features that appear
     // in other browsers first.
     handler.setInDirectivePrologue(handler.asUnary(possibleDirective));
 
-    if (directive == context->names().useStrict) {
+    if (directive == cx_->names().useStrict) {
       // Functions with non-simple parameter lists (destructuring,
       // default or rest parameters) must not contain a "use strict"
       // directive.
       if (pc->isFunctionBox()) {
         FunctionBox* funbox = pc->functionBox();
         if (!funbox->hasSimpleParameterList()) {
           const char* parameterKind =
               funbox->hasDestructuringArgs
@@ -3481,30 +3480,30 @@ bool GeneralParser<ParseHandler, Unit>::
         // occur in the directive prologue -- octal escapes -- and
         // complain now.
         if (anyChars.sawOctalEscape()) {
           error(JSMSG_DEPRECATED_OCTAL);
           return false;
         }
         pc->sc()->strictScript = true;
       }
-    } else if (directive == context->names().useAsm) {
+    } else if (directive == cx_->names().useAsm) {
       if (pc->isFunctionBox()) {
         return asmJS(list);
       }
       return warningAt(directivePos.begin, JSMSG_USE_ASM_DIRECTIVE_FAIL);
     }
   }
   return true;
 }
 
 template <class ParseHandler, typename Unit>
 typename ParseHandler::ListNodeType
 GeneralParser<ParseHandler, Unit>::statementList(YieldHandling yieldHandling) {
-  if (!CheckRecursionLimit(context)) {
+  if (!CheckRecursionLimit(cx_)) {
     return null();
   }
 
   ListNodeType stmtList = handler.newStatementList(pos());
   if (!stmtList) {
     return null();
   }
 
@@ -3782,17 +3781,17 @@ GeneralParser<ParseHandler, Unit>::bindi
 
   return assign;
 }
 
 template <class ParseHandler, typename Unit>
 typename ParseHandler::NameNodeType
 GeneralParser<ParseHandler, Unit>::bindingIdentifier(
     DeclarationKind kind, YieldHandling yieldHandling) {
-  RootedPropertyName name(context, bindingIdentifier(yieldHandling));
+  RootedPropertyName name(cx_, bindingIdentifier(yieldHandling));
   if (!name) {
     return null();
   }
 
   NameNodeType binding = newName(name);
   if (!binding || !noteDeclaredName(name, kind, pos())) {
     return null();
   }
@@ -3821,28 +3820,28 @@ GeneralParser<ParseHandler, Unit>::bindi
 }
 
 template <class ParseHandler, typename Unit>
 typename ParseHandler::ListNodeType
 GeneralParser<ParseHandler, Unit>::objectBindingPattern(
     DeclarationKind kind, YieldHandling yieldHandling) {
   MOZ_ASSERT(anyChars.isCurrentTokenType(TokenKind::LeftCurly));
 
-  if (!CheckRecursionLimit(context)) {
+  if (!CheckRecursionLimit(cx_)) {
     return null();
   }
 
   uint32_t begin = pos().begin;
   ListNodeType literal = handler.newObjectLiteral(begin);
   if (!literal) {
     return null();
   }
 
   Maybe<DeclarationKind> declKind = Some(kind);
-  RootedAtom propAtom(context);
+  RootedAtom propAtom(cx_);
   for (;;) {
     TokenKind tt;
     if (!tokenStream.peekToken(&tt)) {
       return null();
     }
     if (tt == TokenKind::RightCurly) {
       anyChars.addModifierException(TokenStream::OperandIsNone);
       break;
@@ -3975,17 +3974,17 @@ GeneralParser<ParseHandler, Unit>::objec
 }
 
 template <class ParseHandler, typename Unit>
 typename ParseHandler::ListNodeType
 GeneralParser<ParseHandler, Unit>::arrayBindingPattern(
     DeclarationKind kind, YieldHandling yieldHandling) {
   MOZ_ASSERT(anyChars.isCurrentTokenType(TokenKind::LeftBracket));
 
-  if (!CheckRecursionLimit(context)) {
+  if (!CheckRecursionLimit(cx_)) {
     return null();
   }
 
   uint32_t begin = pos().begin;
   ListNodeType literal = handler.newArrayLiteral(begin);
   if (!literal) {
     return null();
   }
@@ -4277,17 +4276,17 @@ GeneralParser<ParseHandler, Unit>::decla
                                                    ParseNodeKind* forHeadKind,
                                                    Node* forInOrOfExpression) {
   // Anything other than possible identifier is an error.
   if (!TokenKindIsPossibleIdentifier(tt)) {
     error(JSMSG_NO_VARIABLE_NAME);
     return null();
   }
 
-  RootedPropertyName name(context, bindingIdentifier(yieldHandling));
+  RootedPropertyName name(cx_, bindingIdentifier(yieldHandling));
   if (!name) {
     return null();
   }
 
   NameNodeType binding = newName(name);
   if (!binding) {
     return null();
   }
@@ -4467,17 +4466,17 @@ bool Parser<FullParseHandler, Unit>::nam
         break;
       }
 
       if (!TokenKindIsPossibleIdentifierName(tt)) {
         error(JSMSG_NO_IMPORT_NAME);
         return false;
       }
 
-      Rooted<PropertyName*> importName(context, anyChars.currentName());
+      Rooted<PropertyName*> importName(cx_, anyChars.currentName());
       TokenPos importNamePos = pos();
 
       bool matched;
       if (!tokenStream.matchToken(&matched, TokenKind::As)) {
         return false;
       }
 
       if (matched) {
@@ -4496,17 +4495,17 @@ bool Parser<FullParseHandler, Unit>::nam
         // by the keyword 'as'.
         // See the ImportSpecifier production in ES6 section 15.2.2.
         if (IsKeyword(importName)) {
           error(JSMSG_AS_AFTER_RESERVED_WORD, ReservedWordToCharZ(importName));
           return false;
         }
       }
 
-      RootedPropertyName bindingAtom(context, importedBinding());
+      RootedPropertyName bindingAtom(cx_, importedBinding());
       if (!bindingAtom) {
         return false;
       }
 
       NameNodeType bindingName = newName(bindingAtom);
       if (!bindingName) {
         return false;
       }
@@ -4548,26 +4547,26 @@ bool Parser<FullParseHandler, Unit>::nam
       return false;
     }
 
     if (!mustMatchToken(TokenKindIsPossibleIdentifierName,
                         JSMSG_NO_BINDING_NAME)) {
       return false;
     }
 
-    NameNodeType importName = newName(context->names().star);
+    NameNodeType importName = newName(cx_->names().star);
     if (!importName) {
       return false;
     }
 
     // Namespace imports are are not indirect bindings but lexical
     // definitions that hold a module namespace object. They are treated
     // as const variables which are initialized during the
     // ModuleInstantiate step.
-    RootedPropertyName bindingName(context, importedBinding());
+    RootedPropertyName bindingName(cx_, importedBinding());
     if (!bindingName) {
       return false;
     }
     NameNodeType bindingNameNode = newName(bindingName);
     if (!bindingNameNode) {
       return false;
     }
     if (!noteDeclaredName(bindingName, DeclarationKind::Const, pos())) {
@@ -4620,22 +4619,22 @@ BinaryNode* Parser<FullParseHandler, Uni
       if (!namedImportsOrNamespaceImport(tt, importSpecSet)) {
         return null();
       }
     } else if (TokenKindIsPossibleIdentifierName(tt)) {
       // Handle the form |import a from 'b'|, by adding a single import
       // specifier to the list, with 'default' as the import name and
       // 'a' as the binding name. This is equivalent to
       // |import { default as a } from 'b'|.
-      Node importName = newName(context->names().default_);
+      Node importName = newName(cx_->names().default_);
       if (!importName) {
         return null();
       }
 
-      RootedPropertyName bindingAtom(context, importedBinding());
+      RootedPropertyName bindingAtom(cx_, importedBinding());
       if (!bindingAtom) {
         return null();
       }
 
       Node bindingName = newName(bindingAtom);
       if (!bindingName) {
         return null();
       }
@@ -4735,17 +4734,17 @@ GeneralParser<ParseHandler, Unit>::impor
 }
 
 template <typename Unit>
 bool Parser<FullParseHandler, Unit>::checkExportedName(JSAtom* exportName) {
   if (!pc->sc()->asModuleContext()->builder.hasExportedName(exportName)) {
     return true;
   }
 
-  UniqueChars str = AtomToPrintableString(context, exportName);
+  UniqueChars str = AtomToPrintableString(cx_, exportName);
   if (!str) {
     return false;
   }
 
   error(JSMSG_DUPLICATE_EXPORT_NAME, str.get());
   return false;
 }
 
@@ -5071,17 +5070,17 @@ GeneralParser<ParseHandler, Unit>::expor
 
 template <typename Unit>
 bool Parser<FullParseHandler, Unit>::checkLocalExportNames(ListNode* node) {
   // ES 2017 draft 15.2.3.1.
   for (ParseNode* next : node->contents()) {
     ParseNode* name = next->as<BinaryNode>().left();
     MOZ_ASSERT(name->isKind(ParseNodeKind::Name));
 
-    RootedPropertyName ident(context,
+    RootedPropertyName ident(cx_,
                              name->as<NameNode>().atom()->asPropertyName());
     if (!checkLocalExportName(ident, name->pn_pos.begin)) {
       return false;
     }
   }
 
   return true;
 }
@@ -5415,17 +5414,17 @@ GeneralParser<ParseHandler, Unit>::expor
 
 template <class ParseHandler, typename Unit>
 typename ParseHandler::BinaryNodeType
 GeneralParser<ParseHandler, Unit>::exportDefaultAssignExpr(uint32_t begin) {
   if (!abortIfSyntaxParser()) {
     return null();
   }
 
-  HandlePropertyName name = context->names().default_;
+  HandlePropertyName name = cx_->names().default_;
   NameNodeType nameNode = newName(name);
   if (!nameNode) {
     return null();
   }
   if (!noteDeclaredName(name, DeclarationKind::Const, pos())) {
     return null();
   }
 
@@ -5460,17 +5459,17 @@ GeneralParser<ParseHandler, Unit>::expor
 
   MOZ_ASSERT(anyChars.isCurrentTokenType(TokenKind::Default));
 
   TokenKind tt;
   if (!tokenStream.getToken(&tt, TokenStream::Operand)) {
     return null();
   }
 
-  if (!checkExportedName(context->names().default_)) {
+  if (!checkExportedName(cx_->names().default_)) {
     return null();
   }
 
   switch (tt) {
     case TokenKind::Function:
       return exportDefaultFunctionDeclaration(begin, pos().begin);
 
     case TokenKind::Async: {
@@ -5640,18 +5639,18 @@ GeneralParser<ParseHandler, Unit>::conse
   }
 
   return statement(yieldHandling);
 }
 
 template <class ParseHandler, typename Unit>
 typename ParseHandler::TernaryNodeType
 GeneralParser<ParseHandler, Unit>::ifStatement(YieldHandling yieldHandling) {
-  Vector<Node, 4> condList(context), thenList(context);
-  Vector<uint32_t, 4> posList(context);
+  Vector<Node, 4> condList(cx_), thenList(cx_);
+  Vector<uint32_t, 4> posList(cx_);
   Node elseBranch;
 
   ParseContext::Statement stmt(pc, StatementKind::If);
 
   while (true) {
     uint32_t begin = pos().begin;
 
     /* An IF node has three kids: condition, then, and optional else. */
@@ -6270,17 +6269,17 @@ GeneralParser<ParseHandler, Unit>::switc
 
 template <class ParseHandler, typename Unit>
 typename ParseHandler::ContinueStatementType
 GeneralParser<ParseHandler, Unit>::continueStatement(
     YieldHandling yieldHandling) {
   MOZ_ASSERT(anyChars.isCurrentTokenType(TokenKind::Continue));
   uint32_t begin = pos().begin;
 
-  RootedPropertyName label(context);
+  RootedPropertyName label(cx_);
   if (!matchLabel(yieldHandling, &label)) {
     return null();
   }
 
   auto validity = pc->checkContinueStatement(label);
   if (validity.isErr()) {
     switch (validity.unwrapErr()) {
       case ParseContext::ContinueStatementError::NotInALoop:
@@ -6301,17 +6300,17 @@ GeneralParser<ParseHandler, Unit>::conti
 }
 
 template <class ParseHandler, typename Unit>
 typename ParseHandler::BreakStatementType
 GeneralParser<ParseHandler, Unit>::breakStatement(YieldHandling yieldHandling) {
   MOZ_ASSERT(anyChars.isCurrentTokenType(TokenKind::Break));
   uint32_t begin = pos().begin;
 
-  RootedPropertyName label(context);
+  RootedPropertyName label(cx_);
   if (!matchLabel(yieldHandling, &label)) {
     return null();
   }
 
   // Labeled 'break' statements target the nearest labeled statements (could
   // be any kind) with the same label. Unlabeled 'break' statements target
   // the innermost loop or switch statement.
   if (label) {
@@ -6515,17 +6514,17 @@ typename ParseHandler::Node GeneralParse
   anyChars.ungetToken();
   return statement(yieldHandling);
 }
 
 template <class ParseHandler, typename Unit>
 typename ParseHandler::LabeledStatementType
 GeneralParser<ParseHandler, Unit>::labeledStatement(
     YieldHandling yieldHandling) {
-  RootedPropertyName label(context, labelIdentifier(yieldHandling));
+  RootedPropertyName label(cx_, labelIdentifier(yieldHandling));
   if (!label) {
     return null();
   }
 
   auto hasSameLabel = [&label](ParseContext::LabelStatement* stmt) {
     return stmt->label() == label;
   };
 
@@ -6865,41 +6864,41 @@ GeneralParser<ParseHandler, Unit>::class
   uint32_t classStartOffset = pos().begin;
   bool savedStrictness = setLocalStrictMode(true);
 
   TokenKind tt;
   if (!tokenStream.getToken(&tt)) {
     return null();
   }
 
-  RootedPropertyName className(context);
+  RootedPropertyName className(cx_);
   if (TokenKindIsPossibleIdentifier(tt)) {
     className = bindingIdentifier(yieldHandling);
     if (!className) {
       return null();
     }
   } else if (classContext == ClassStatement) {
     if (defaultHandling == AllowDefaultName) {
-      className = context->names().default_;
+      className = cx_->names().default_;
       anyChars.ungetToken();
     } else {
       // Class statements must have a bound name
       error(JSMSG_UNNAMED_CLASS_STMT);
       return null();
     }
   } else {
     // Make sure to put it back, whatever it was
     anyChars.ungetToken();
   }
 
   // Push a ParseContext::ClassStatement to keep track of the constructor
   // funbox.
   ParseContext::ClassStatement classStmt(pc);
 
-  RootedAtom propAtom(context);
+  RootedAtom propAtom(cx_);
 
   // A named class creates a new lexical scope with a const binding of the
   // class name for the "inner name".
   Maybe<ParseContext::Statement> innerScopeStmt;
   Maybe<ParseContext::Scope> innerScope;
   if (className) {
     innerScopeStmt.emplace(pc, StatementKind::Block);
     innerScope.emplace(this);
@@ -7028,34 +7027,34 @@ GeneralParser<ParseHandler, Unit>::class
         propType != PropertyType::Method &&
         propType != PropertyType::GeneratorMethod &&
         propType != PropertyType::AsyncMethod &&
         propType != PropertyType::AsyncGeneratorMethod) {
       errorAt(propNameOffset, JSMSG_BAD_METHOD_DEF);
       return null();
     }
 
-    bool isConstructor = !isStatic && propAtom == context->names().constructor;
+    bool isConstructor = !isStatic && propAtom == cx_->names().constructor;
     if (isConstructor) {
       if (propType != PropertyType::Method) {
         errorAt(propNameOffset, JSMSG_BAD_METHOD_DEF);
         return null();
       }
       if (classStmt.constructorBox) {
         errorAt(propNameOffset, JSMSG_DUPLICATE_PROPERTY, "constructor");
         return null();
       }
       propType = hasHeritage ? PropertyType::DerivedConstructor
                              : PropertyType::Constructor;
-    } else if (isStatic && propAtom == context->names().prototype) {
+    } else if (isStatic && propAtom == cx_->names().prototype) {
       errorAt(propNameOffset, JSMSG_BAD_METHOD_DEF);
       return null();
     }
 
-    RootedAtom funName(context);
+    RootedAtom funName(cx_);
     switch (propType) {
       case PropertyType::Getter:
       case PropertyType::Setter:
         if (!anyChars.isCurrentTokenType(TokenKind::RightBracket)) {
           funName = prefixAccessorName(propType, propAtom);
           if (!funName) {
             return null();
           }
@@ -7098,17 +7097,17 @@ GeneralParser<ParseHandler, Unit>::class
       return null();
     }
 
     MOZ_ASSERT(classStmt.constructorBox != nullptr);
 
     // Note: the *function* has the name of the class, but the *property*
     // containing the function has the name "constructor"
     Node constructorNameNode = handler.newObjectLiteralPropertyName(
-        context->names().constructor, pos());
+        cx_->names().constructor, pos());
     if (!constructorNameNode) {
       return null();
     }
 
     if (!handler.addClassMethodDefinition(classMembers, constructorNameNode,
                                           synthesizedCtor, AccessorType::None,
                                           /* isStatic = */ false)) {
       return null();
@@ -7193,17 +7192,17 @@ GeneralParser<ParseHandler, Unit>::class
 
 template <class ParseHandler, typename Unit>
 typename ParseHandler::FunctionNodeType
 GeneralParser<ParseHandler, Unit>::synthesizeConstructor(
     HandleAtom className, uint32_t classNameOffset) {
   FunctionSyntaxKind functionSyntaxKind = FunctionSyntaxKind::ClassConstructor;
 
   // Create the function object
-  RootedFunction fun(context, newFunction(className, functionSyntaxKind,
+  RootedFunction fun(cx_, newFunction(className, functionSyntaxKind,
                                           GeneratorKind::NotGenerator,
                                           FunctionAsyncKind::SyncFunction));
   if (!fun) {
     return null();
   }
 
   // Create the top-level field initializer node
   FunctionNodeType funNode = handler.newFunction(functionSyntaxKind, pos());
@@ -7246,17 +7245,17 @@ GeneralParser<ParseHandler, Unit>::synth
     return null();
   }
 
   auto stmtList = handler.newStatementList(synthesizedBodyPos);
   if (!stmtList) {
     return null();
   }
 
-  if (!noteUsedName(context->names().dotThis)) {
+  if (!noteUsedName(cx_->names().dotThis)) {
     return null();
   }
 
   if (!declareFunctionThis()) {
     return null();
   }
 
   // Set the function's body to the field assignment.
@@ -7282,17 +7281,17 @@ GeneralParser<ParseHandler, Unit>::synth
 
 template <class ParseHandler, typename Unit>
 typename ParseHandler::FunctionNodeType
 GeneralParser<ParseHandler, Unit>::fieldInitializer(YieldHandling yieldHandling,
                                                     HandleAtom propAtom) {
   TokenPos fieldPos = pos();
 
   // Create the function object
-  RootedFunction fun(context,
+  RootedFunction fun(cx_,
                      newFunction(propAtom, FunctionSyntaxKind::Expression,
                                  GeneratorKind::NotGenerator,
                                  FunctionAsyncKind::SyncFunction));
   if (!fun) {
     return null();
   }
 
   // Create the top-level field initializer node
@@ -7448,17 +7447,17 @@ GeneralParser<ParseHandler, Unit>::varia
   return vars;
 }
 
 template <class ParseHandler, typename Unit>
 typename ParseHandler::Node GeneralParser<ParseHandler, Unit>::statement(
     YieldHandling yieldHandling) {
   MOZ_ASSERT(checkOptionsCalled);
 
-  if (!CheckRecursionLimit(context)) {
+  if (!CheckRecursionLimit(cx_)) {
     return null();
   }
 
   TokenKind tt;
   if (!tokenStream.getToken(&tt, TokenStream::Operand)) {
     return null();
   }
 
@@ -7681,17 +7680,17 @@ typename ParseHandler::Node GeneralParse
 }
 
 template <class ParseHandler, typename Unit>
 typename ParseHandler::Node
 GeneralParser<ParseHandler, Unit>::statementListItem(
     YieldHandling yieldHandling, bool canHaveDirectives /* = false */) {
   MOZ_ASSERT(checkOptionsCalled);
 
-  if (!CheckRecursionLimit(context)) {
+  if (!CheckRecursionLimit(cx_)) {
     return null();
   }
 
   TokenKind tt;
   if (!tokenStream.getToken(&tt, TokenStream::Operand)) {
     return null();
   }
 
@@ -7709,17 +7708,17 @@ GeneralParser<ParseHandler, Unit>::state
       return handler.newEmptyStatement(pos());
 
     // ExpressionStatement[?Yield].
     //
     // These should probably be handled by a single ExpressionStatement
     // function in a default, not split up this way.
     case TokenKind::String:
       if (!canHaveDirectives &&
-          anyChars.currentToken().atom() == context->names().useAsm) {
+          anyChars.currentToken().atom() == cx_->names().useAsm) {
         if (!abortIfSyntaxParser()) {
           return null();
         }
         if (!warning(JSMSG_USE_ASM_DIRECTIVE_FAIL)) {
           return null();
         }
       }
       return expressionStatement(yieldHandling);
@@ -8149,17 +8148,17 @@ GeneralParser<ParseHandler, Unit>::condE
 }
 
 template <class ParseHandler, typename Unit>
 typename ParseHandler::Node GeneralParser<ParseHandler, Unit>::assignExpr(
     InHandling inHandling, YieldHandling yieldHandling,
     TripledotHandling tripledotHandling,
     PossibleError* possibleError /* = nullptr */,
     InvokedPrediction invoked /* = PredictUninvoked */) {
-  if (!CheckRecursionLimit(context)) {
+  if (!CheckRecursionLimit(cx_)) {
     return null();
   }
 
   // It's very common at this point to have a "detectably simple" expression,
   // i.e. a name/number/string token followed by one of the following tokens
   // that obviously isn't part of an expression: , ; : ) ] }
   //
   // (In Parsemark this happens 81.4% of the time;  in code with large
@@ -8181,17 +8180,17 @@ typename ParseHandler::Node GeneralParse
   // This only handles identifiers that *never* have special meaning anywhere
   // in the language.  Contextual keywords, reserved words in strict mode,
   // and other hard cases are handled outside this fast path.
   if (firstToken == TokenKind::Name) {
     if (!tokenStream.nextTokenEndsExpr(&endsExpr)) {
       return null();
     }
     if (endsExpr) {
-      Rooted<PropertyName*> name(context, identifierReference(yieldHandling));
+      Rooted<PropertyName*> name(cx_, identifierReference(yieldHandling));
       if (!name) {
         return null();
       }
 
       return identifierReference(name);
     }
   }
 
@@ -8244,17 +8243,17 @@ typename ParseHandler::Node GeneralParse
 
     TokenKind tokenAfterAsync;
     if (!tokenStream.getToken(&tokenAfterAsync)) {
       return null();
     }
     MOZ_ASSERT(TokenKindIsPossibleIdentifier(tokenAfterAsync));
 
     // Check yield validity here.
-    RootedPropertyName name(context, bindingIdentifier(yieldHandling));
+    RootedPropertyName name(cx_, bindingIdentifier(yieldHandling));
     if (!name) {
       return null();
     }
 
     if (!tokenStream.peekTokenSameLine(&tokenAfterLHS)) {
       return null();
     }
     if (tokenAfterLHS != TokenKind::Arrow) {
@@ -8459,20 +8458,20 @@ bool PerHandlerParser<ParseHandler>::isV
   return false;
 }
 
 template <class ParseHandler>
 const char* PerHandlerParser<ParseHandler>::nameIsArgumentsOrEval(Node node) {
   MOZ_ASSERT(handler.isName(node),
              "must only call this function on known names");
 
-  if (handler.isEvalName(node, context)) {
+  if (handler.isEvalName(node, cx_)) {
     return js_eval_str;
   }
-  if (handler.isArgumentsName(node, context)) {
+  if (handler.isArgumentsName(node, cx_)) {
     return js_arguments_str;
   }
   return nullptr;
 }
 
 template <class ParseHandler, typename Unit>
 bool GeneralParser<ParseHandler, Unit>::checkIncDecOperand(
     Node operand, uint32_t operandOffset) {
@@ -8515,17 +8514,17 @@ GeneralParser<ParseHandler, Unit>::unary
   return handler.newUnary(kind, begin, kid);
 }
 
 template <class ParseHandler, typename Unit>
 typename ParseHandler::Node GeneralParser<ParseHandler, Unit>::unaryExpr(
     YieldHandling yieldHandling, TripledotHandling tripledotHandling,
     PossibleError* possibleError /* = nullptr */,
     InvokedPrediction invoked /* = PredictUninvoked */) {
-  if (!CheckRecursionLimit(context)) {
+  if (!CheckRecursionLimit(cx_)) {
     return null();
   }
 
   TokenKind tt;
   if (!tokenStream.getToken(&tt, TokenStream::Operand)) {
     return null();
   }
   uint32_t begin = pos().begin;
@@ -8768,17 +8767,17 @@ typename ParseHandler::Node GeneralParse
     YieldHandling yieldHandling, TripledotHandling tripledotHandling,
     TokenKind tt, bool allowCallSyntax /* = true */,
     PossibleError* possibleError /* = nullptr */,
     InvokedPrediction invoked /* = PredictUninvoked */) {
   MOZ_ASSERT(anyChars.isCurrentTokenType(tt));
 
   Node lhs;
 
-  if (!CheckRecursionLimit(context)) {
+  if (!CheckRecursionLimit(cx_)) {
     return null();
   }
 
   /* Check for new expression first. */
   if (tt == TokenKind::New) {
     uint32_t newBegin = pos().begin;
     // Make sure this wasn't a |new.target| in disguise.
     BinaryNodeType newTarget;
@@ -8948,34 +8947,34 @@ typename ParseHandler::Node GeneralParse
           return null();
         }
 
         JSOp op = JSOP_CALL;
         bool maybeAsyncArrow = false;
         if (PropertyName* prop = handler.maybeDottedProperty(lhs)) {
           // Use the JSOP_FUN{APPLY,CALL} optimizations given the
           // right syntax.
-          if (prop == context->names().apply) {
+          if (prop == cx_->names().apply) {
             op = JSOP_FUNAPPLY;
             if (pc->isFunctionBox()) {
               pc->functionBox()->usesApply = true;
             }
-          } else if (prop == context->names().call) {
+          } else if (prop == cx_->names().call) {
             op = JSOP_FUNCALL;
           }
         } else if (tt == TokenKind::LeftParen) {
-          if (handler.isAsyncKeyword(lhs, context)) {
+          if (handler.isAsyncKeyword(lhs, cx_)) {
             // |async (| can be the start of an async arrow
             // function, so we need to defer reporting possible
             // errors from destructuring syntax. To give better
             // error messages, we only allow the AsyncArrowHead
             // part of the CoverCallExpressionAndAsyncArrowHead
             // syntax when the initial name is "async".
             maybeAsyncArrow = true;
-          } else if (handler.isEvalName(lhs, context)) {
+          } else if (handler.isEvalName(lhs, cx_)) {
             // Select the right EVAL op and flag pc as having a
             // direct eval.
             op = pc->sc()->strict() ? JSOP_STRICTEVAL : JSOP_EVAL;
             pc->sc()->setBindingsAccessedDynamically();
             pc->sc()->setHasDirectEval();
 
             // In non-strict mode code, direct calls to eval can
             // add variables to the call object.
@@ -9054,17 +9053,17 @@ template <class ParseHandler>
 inline typename ParseHandler::NameNodeType
 PerHandlerParser<ParseHandler>::newName(PropertyName* name) {
   return newName(name, pos());
 }
 
 template <class ParseHandler>
 inline typename ParseHandler::NameNodeType
 PerHandlerParser<ParseHandler>::newName(PropertyName* name, TokenPos pos) {
-  return handler.newName(name, pos, context);
+  return handler.newName(name, pos, cx_);
 }
 
 template <class ParseHandler, typename Unit>
 bool GeneralParser<ParseHandler, Unit>::checkLabelOrIdentifierReference(
     PropertyName* ident, uint32_t offset, YieldHandling yieldHandling,
     TokenKind hint /* = TokenKind::Limit */) {
   TokenKind tt;
   if (hint == TokenKind::Limit) {
@@ -9135,24 +9134,24 @@ bool GeneralParser<ParseHandler, Unit>::
   return false;
 }
 
 template <class ParseHandler, typename Unit>
 bool GeneralParser<ParseHandler, Unit>::checkBindingIdentifier(
     PropertyName* ident, uint32_t offset, YieldHandling yieldHandling,
     TokenKind hint /* = TokenKind::Limit */) {
   if (pc->sc()->needStrictChecks()) {
-    if (ident == context->names().arguments) {
+    if (ident == cx_->names().arguments) {
       if (!strictModeErrorAt(offset, JSMSG_BAD_STRICT_ASSIGN, "arguments")) {
         return false;
       }
       return true;
     }
 
-    if (ident == context->names().eval) {
+    if (ident == cx_->names().eval) {
       if (!strictModeErrorAt(offset, JSMSG_BAD_STRICT_ASSIGN, "eval")) {
         return false;
       }
       return true;
     }
   }
 
   return checkLabelOrIdentifierReference(ident, offset, yieldHandling, hint);
@@ -9168,31 +9167,31 @@ PropertyName* GeneralParser<ParseHandler
   //
   // Use PropertyName* instead of TokenKind to reflect the normalization.
 
   // Unless the name contains escapes, we can reuse the current TokenKind
   // to determine if the name is a restricted identifier.
   TokenKind hint = !anyChars.currentNameHasEscapes()
                        ? anyChars.currentToken().type
                        : TokenKind::Limit;
-  RootedPropertyName ident(context, anyChars.currentName());
+  RootedPropertyName ident(cx_, anyChars.currentName());
   if (!checkLabelOrIdentifierReference(ident, pos().begin, yieldHandling,
                                        hint)) {
     return nullptr;
   }
   return ident;
 }
 
 template <class ParseHandler, typename Unit>
 PropertyName* GeneralParser<ParseHandler, Unit>::bindingIdentifier(
     YieldHandling yieldHandling) {
   TokenKind hint = !anyChars.currentNameHasEscapes()
                        ? anyChars.currentToken().type
                        : TokenKind::Limit;
-  RootedPropertyName ident(context, anyChars.currentName());
+  RootedPropertyName ident(cx_, anyChars.currentName());
   if (!checkBindingIdentifier(ident, pos().begin, yieldHandling, hint)) {
     return nullptr;
   }
   return ident;
 }
 
 template <class ParseHandler>
 typename ParseHandler::NameNodeType
@@ -9242,18 +9241,18 @@ GeneralParser<ParseHandler, Unit>::noSub
 template <typename Unit>
 RegExpLiteral* Parser<FullParseHandler, Unit>::newRegExp() {
   MOZ_ASSERT(!options().selfHostingMode);
 
   // Create the regexp and check its syntax.
   const auto& chars = tokenStream.getCharBuffer();
   RegExpFlag flags = anyChars.currentToken().regExpFlags();
 
-  Rooted<RegExpObject*> reobj(context);
-  reobj = RegExpObject::create(context, chars.begin(), chars.length(), flags,
+  Rooted<RegExpObject*> reobj(cx_);
+  reobj = RegExpObject::create(cx_, chars.begin(), chars.length(), flags,
                                anyChars, TenuredObject);
   if (!reobj) {
     return null();
   }
 
   return handler.newRegExp(reobj, pos(), *this);
 }
 
@@ -9288,17 +9287,17 @@ template <typename Unit>
 BigIntLiteral* Parser<FullParseHandler, Unit>::newBigInt() {
   // The token's charBuffer contains the DecimalIntegerLiteral or
   // NumericLiteralBase production, and as such does not include the
   // BigIntLiteralSuffix (the trailing "n").  Note that NumericLiteralBase
   // productions may start with 0[bBoOxX], indicating binary/octal/hex.
   const auto& chars = tokenStream.getCharBuffer();
   mozilla::Range<const char16_t> source(chars.begin(), chars.length());
 
-  BigInt* b = js::ParseBigIntLiteral(context, source);
+  BigInt* b = js::ParseBigIntLiteral(cx_, source);
   if (!b) {
     return null();
   }
 
   // newBigInt immediately puts "b" in a BigIntBox, which is allocated using
   // tempLifoAlloc, avoiding any potential GC.  Therefore it's OK to pass a
   // raw pointer.
   return handler.newBigInt(b, pos(), *this);
@@ -9382,28 +9381,28 @@ void GeneralParser<ParseHandler, Unit>::
 #endif
 
   // Return early if a pending destructuring error is already present.
   if (possibleError->hasPendingDestructuringError()) {
     return;
   }
 
   if (pc->sc()->needStrictChecks()) {
-    if (handler.isArgumentsName(name, context)) {
+    if (handler.isArgumentsName(name, cx_)) {
       if (pc->sc()->strict()) {
         possibleError->setPendingDestructuringErrorAt(
             namePos, JSMSG_BAD_STRICT_ASSIGN_ARGUMENTS);
       } else {
         possibleError->setPendingDestructuringWarningAt(
             namePos, JSMSG_BAD_STRICT_ASSIGN_ARGUMENTS);
       }
       return;
     }
 
-    if (handler.isEvalName(name, context)) {
+    if (handler.isEvalName(name, cx_)) {
       if (pc->sc()->strict()) {
         possibleError->setPendingDestructuringErrorAt(
             namePos, JSMSG_BAD_STRICT_ASSIGN_EVAL);
       } else {
         possibleError->setPendingDestructuringWarningAt(
             namePos, JSMSG_BAD_STRICT_ASSIGN_EVAL);
       }
       return;
@@ -9614,17 +9613,17 @@ typename ParseHandler::Node GeneralParse
       return null();
     }
   }
 
   propAtom.set(nullptr);
   Node propName;
   switch (ltok) {
     case TokenKind::Number:
-      propAtom.set(NumberToAtom(context, anyChars.currentToken().number()));
+      propAtom.set(NumberToAtom(cx_, anyChars.currentToken().number()));
       if (!propAtom.get()) {
         return null();
       }
       propName = newNumber(anyChars.currentToken());
       if (!propName) {
         return null();
       }
       break;
@@ -9688,28 +9687,28 @@ typename ParseHandler::Node GeneralParse
       }
       if (tt == TokenKind::String) {
         tokenStream.consumeKnownToken(TokenKind::String);
 
         propAtom.set(anyChars.currentToken().atom());
 
         uint32_t index;
         if (propAtom->isIndex(&index)) {
-          propAtom.set(NumberToAtom(context, index));
+          propAtom.set(NumberToAtom(cx_, index));
           if (!propAtom.get()) {
             return null();
           }
           return handler.newNumber(index, NoDecimal, pos());
         }
         return stringLiteral();
       }
       if (tt == TokenKind::Number) {
         tokenStream.consumeKnownToken(TokenKind::Number);
 
-        propAtom.set(NumberToAtom(context, anyChars.currentToken().number()));
+        propAtom.set(NumberToAtom(cx_, anyChars.currentToken().number()));
         if (!propAtom.get()) {
           return null();
         }
         return newNumber(anyChars.currentToken());
       }
       if (tt == TokenKind::LeftBracket) {
         tokenStream.consumeKnownToken(TokenKind::LeftBracket);
 
@@ -9826,17 +9825,17 @@ GeneralParser<ParseHandler, Unit>::objec
   ListNodeType literal = handler.newObjectLiteral(pos().begin);
   if (!literal) {
     return null();
   }
 
   bool seenPrototypeMutation = false;
   bool seenCoverInitializedName = false;
   Maybe<DeclarationKind> declKind = Nothing();
-  RootedAtom propAtom(context);
+  RootedAtom propAtom(cx_);
   for (;;) {
     TokenKind tt;
     if (!tokenStream.peekToken(&tt)) {
       return null();
     }
     if (tt == TokenKind::RightCurly) {
       anyChars.addModifierException(TokenStream::OperandIsNone);
       break;
@@ -9888,17 +9887,17 @@ GeneralParser<ParseHandler, Unit>::objec
           return null();
         }
 
         if (!checkDestructuringAssignmentElement(
                 propExpr, exprPos, &possibleErrorInner, possibleError)) {
           return null();
         }
 
-        if (propAtom == context->names().proto) {
+        if (propAtom == cx_->names().proto) {
           if (seenPrototypeMutation) {
             // Directly report the error when we're definitely not
             // in a destructuring context.
             if (!possibleError) {
               errorAt(namePos.begin, JSMSG_DUPLICATE_PROTO_PROPERTY);
               return null();
             }
 
@@ -9927,17 +9926,17 @@ GeneralParser<ParseHandler, Unit>::objec
           handler.addPropertyDefinition(literal, propDef);
         }
       } else if (propType == PropertyType::Shorthand) {
         /*
          * Support, e.g., |({x, y} = o)| as destructuring shorthand
          * for |({x: x, y: y} = o)|, and |var o = {x, y}| as
          * initializer shorthand for |var o = {x: x, y: y}|.
          */
-        Rooted<PropertyName*> name(context, identifierReference(yieldHandling));
+        Rooted<PropertyName*> name(cx_, identifierReference(yieldHandling));
         if (!name) {
           return null();
         }
 
         NameNodeType nameExpr = identifierReference(name);
         if (!nameExpr) {
           return null();
         }
@@ -9950,17 +9949,17 @@ GeneralParser<ParseHandler, Unit>::objec
                                   nameExpr)) {
           return null();
         }
       } else if (propType == PropertyType::CoverInitializedName) {
         /*
          * Support, e.g., |({x=1, y=2} = o)| as destructuring
          * shorthand with default values, as per ES6 12.14.5
          */
-        Rooted<PropertyName*> name(context, identifierReference(yieldHandling));
+        Rooted<PropertyName*> name(cx_, identifierReference(yieldHandling));
         if (!name) {
           return null();
         }
 
         Node lhs = identifierReference(name);
         if (!lhs) {
           return null();
         }
@@ -10008,17 +10007,17 @@ GeneralParser<ParseHandler, Unit>::objec
         if (!propExpr) {
           return null();
         }
 
         if (!handler.addPropertyDefinition(literal, propName, propExpr)) {
           return null();
         }
       } else {
-        RootedAtom funName(context);
+        RootedAtom funName(cx_);
         if (!anyChars.isCurrentTokenType(TokenKind::RightBracket)) {
           funName = propAtom;
 
           if (propType == PropertyType::Getter ||
               propType == PropertyType::Setter) {
             funName = prefixAccessorName(propType, propAtom);
             if (!funName) {
               return null();
@@ -10218,17 +10217,17 @@ GeneralParser<ParseHandler, Unit>::impor
       return null();
     }
 
     if (!mustMatchToken(TokenKind::RightParen, TokenStream::Operand,
                         JSMSG_PAREN_AFTER_ARGS)) {
       return null();
     }
 
-    if (!context->runtime()->moduleDynamicImportHook) {
+    if (!cx_->runtime()->moduleDynamicImportHook) {
       error(JSMSG_NO_DYNAMIC_IMPORT);
       return null();
     }
 
     return handler.newCallImport(importHolder, arg);
   } else {
     error(JSMSG_UNEXPECTED_TOKEN_NO_EXPECT, TokenKindToDesc(next));
     return null();
@@ -10236,17 +10235,17 @@ GeneralParser<ParseHandler, Unit>::impor
 }
 
 template <class ParseHandler, typename Unit>
 typename ParseHandler::Node GeneralParser<ParseHandler, Unit>::primaryExpr(
     YieldHandling yieldHandling, TripledotHandling tripledotHandling,
     TokenKind tt, PossibleError* possibleError,
     InvokedPrediction invoked /* = PredictUninvoked */) {
   MOZ_ASSERT(anyChars.isCurrentTokenType(tt));
-  if (!CheckRecursionLimit(context)) {
+  if (!CheckRecursionLimit(cx_)) {
     return null();
   }
 
   switch (tt) {
     case TokenKind::Function:
       return functionExpr(pos().begin, invoked,
                           FunctionAsyncKind::SyncFunction);
 
@@ -10323,17 +10322,17 @@ typename ParseHandler::Node GeneralParse
         if (nextSameLine == TokenKind::Function) {
           uint32_t toStringStart = pos().begin;
           tokenStream.consumeKnownToken(TokenKind::Function);
           return functionExpr(toStringStart, PredictUninvoked,
                               FunctionAsyncKind::AsyncFunction);
         }
       }
 
-      Rooted<PropertyName*> name(context, identifierReference(yieldHandling));
+      Rooted<PropertyName*> name(cx_, identifierReference(yieldHandling));
       if (!name) {
         return null();
       }
 
       return identifierReference(name);
     }
 
     case TokenKind::RegExp:
--- a/js/src/frontend/Parser.h
+++ b/js/src/frontend/Parser.h
@@ -196,18 +196,18 @@ 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->context, prs->pc, sc, prs->tokenStream,
-                     prs->usedNames, newDirectives,
+      : 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,
   Shorthand,
@@ -242,17 +242,17 @@ class MOZ_STACK_CLASS ParserBase : priva
  private:
   ParserBase* thisForCtor() { return this; }
 
   // This is needed to cast a parser to JS::AutoGCRooter.
   friend void js::frontend::TraceParser(JSTracer* trc,
                                         JS::AutoGCRooter* parser);
 
  public:
-  JSContext* const context;
+  JSContext* const cx_;
 
   LifoAlloc& alloc;
 
   TokenStreamAnyChars anyChars;
   LifoAlloc::Mark tempPoolMark;
 
   /* list of parsed objects and BigInts for GC tracing */
   TraceListNode* traceListHead;
@@ -321,17 +321,17 @@ class MOZ_STACK_CLASS ParserBase : priva
   bool setLocalStrictMode(bool strict) {
     MOZ_ASSERT(anyChars.debugHasNoLookahead());
     return pc->sc()->setLocalStrictMode(strict);
   }
 
  public:
   // Implement ErrorReportMixin.
 
-  JSContext* getContext() const override { return context; }
+  JSContext* getContext() const override { return cx_; }
 
   bool strictMode() const override { return pc->sc()->strict(); }
 
   const JS::ReadOnlyCompileOptions& options() const override {
     return anyChars.options();
   }
 
   using Base::error;
@@ -778,17 +778,17 @@ class MOZ_STACK_CLASS GeneralParser : pu
   using Base::warningAt;
   using Base::warningNoOffset;
   using Base::warningWithNotes;
   using Base::warningWithNotesAt;
   using Base::warningWithNotesNoOffset;
 
  public:
   using Base::anyChars;
-  using Base::context;
+  using Base::cx_;
   using Base::handler;
   using Base::isValidSimpleAssignmentTarget;
   using Base::pc;
   using Base::usedNames;
 
  private:
   using Base::checkAndMarkSuperScope;
   using Base::declareDotGeneratorName;
@@ -1448,17 +1448,17 @@ class MOZ_STACK_CLASS Parser<SyntaxParse
   using typename Base::Position;
   using typename Base::TokenStream;
 
   // Inherited functions, listed here to have non-dependent names.
 
  public:
   using Base::anyChars;
   using Base::clearAbortedSyntaxParse;
-  using Base::context;
+  using Base::cx_;
   using Base::hadAbortedSyntaxParse;
   using Base::innerFunctionForFunctionBox;
   using Base::tokenStream;
 
  public:
   // ErrorReportMixin.
 
   using Base::error;
@@ -1636,17 +1636,17 @@ class MOZ_STACK_CLASS Parser<FullParseHa
   using Base::warningWithNotesNoOffset;
 
  private:
   using Base::alloc;
   using Base::checkLabelOrIdentifierReference;
 #if DEBUG
   using Base::checkOptionsCalled;
 #endif
-  using Base::context;
+  using Base::cx_;
   using Base::finishFunctionScopes;
   using Base::finishLexicalScope;
   using Base::innerFunction;
   using Base::innerFunctionForFunctionBox;
   using Base::keepAtoms;
   using Base::matchOrInsertSemicolon;
   using Base::mustMatchToken;
   using Base::newEvalScopeData;
--- a/js/src/frontend/SharedContext.cpp
+++ b/js/src/frontend/SharedContext.cpp
@@ -101,17 +101,17 @@ EvalSharedContext::EvalSharedContext(JSC
       }
 
       env = env->enclosingEnvironment();
     }
   }
 }
 
 #ifdef DEBUG
-bool FunctionBox::atomsAreKept() { return context->zone()->hasKeptAtoms(); }
+bool FunctionBox::atomsAreKept() { return cx_->zone()->hasKeptAtoms(); }
 #endif
 
 FunctionBox::FunctionBox(JSContext* cx, TraceListNode* traceListHead,
                          JSFunction* fun, uint32_t toStringStart,
                          Directives directives, bool extraWarnings,
                          GeneratorKind generatorKind,
                          FunctionAsyncKind asyncKind)
     : ObjectBox(fun, traceListHead),
--- a/js/src/frontend/SharedContext.h
+++ b/js/src/frontend/SharedContext.h
@@ -92,17 +92,17 @@ class ModuleSharedContext;
 
 /*
  * The struct SharedContext is part of the current parser context (see
  * ParseContext). It stores information that is reused between the parser and
  * the bytecode emitter.
  */
 class SharedContext {
  public:
-  JSContext* const context;
+  JSContext* const cx_;
 
  protected:
   enum class Kind : uint8_t { FunctionBox, Global, Eval, Module };
 
   Kind kind_;
 
   ThisBinding thisBinding_;
 
@@ -150,17 +150,17 @@ class SharedContext {
 
   void computeAllowSyntax(Scope* scope);
   void computeInWith(Scope* scope);
   void computeThisBinding(Scope* scope);
 
  public:
   SharedContext(JSContext* cx, Kind kind, Directives directives,
                 bool extraWarnings)
-      : context(cx),
+      : cx_(cx),
         kind_(kind),
         thisBinding_(ThisBinding::Global),
         strictScript(directives.strict()),
         localStrict(false),
         extraWarnings(extraWarnings),
         allowNewTarget_(false),
         allowSuperProperty_(false),
         allowSuperCall_(false),