Bug 1422362: Remove unused parameters from various methods in js/src. r=tcampbell
authorAndré Bargull <andre.bargull@gmail.com>
Fri, 01 Dec 2017 10:04:31 -0800
changeset 395031 e39d8a15596a0c97ea1ce19194ce43af59cfbb60
parent 395030 f54b084de4f907a0d5edc220179ca3a1ea5f1349
child 395032 96940dc4db4491f6feec04cb19a812a81b94b9e2
push id98009
push userarchaeopteryx@coole-files.de
push dateTue, 05 Dec 2017 18:44:37 +0000
treeherdermozilla-inbound@e39d8a15596a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstcampbell
bugs1422362
milestone59.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1422362: Remove unused parameters from various methods in js/src. r=tcampbell
js/src/builtin/Intl.cpp
js/src/builtin/MapObject.cpp
js/src/builtin/MapObject.h
js/src/builtin/RegExp.cpp
js/src/builtin/WeakSetObject.cpp
js/src/builtin/WeakSetObject.h
js/src/frontend/Parser.cpp
js/src/frontend/Parser.h
js/src/frontend/SharedContext.h
js/src/frontend/TokenStream.cpp
js/src/frontend/TokenStream.h
js/src/gc/Zone.h
js/src/jit/BaselineCacheIRCompiler.cpp
js/src/jit/BaselineCompiler.cpp
js/src/jit/CacheIRCompiler.cpp
js/src/jit/CacheIRCompiler.h
js/src/jit/CodeGenerator.cpp
js/src/jit/IonCacheIRCompiler.cpp
js/src/jit/MCallOptimize.cpp
js/src/jit/MIR.h
js/src/jit/SharedIC.cpp
js/src/jit/VMFunctions.cpp
js/src/jit/VMFunctions.h
js/src/jsapi.cpp
js/src/jscompartment.cpp
js/src/jscompartment.h
js/src/jsdtoa.cpp
js/src/jsdtoa.h
js/src/jsnum.cpp
js/src/vm/EnvironmentObject.cpp
js/src/vm/EnvironmentObject.h
js/src/vm/Interpreter-inl.h
js/src/vm/Interpreter.cpp
js/src/vm/Interpreter.h
js/src/vm/NativeObject-inl.h
js/src/vm/NativeObject.h
js/src/vm/RegExpObject.cpp
js/src/vm/RegExpShared.h
js/src/vm/RegExpStatics.h
js/src/vm/Runtime.cpp
js/src/vm/Scope.cpp
js/src/vm/Shape-inl.h
js/src/vm/Shape.cpp
js/src/vm/Shape.h
js/src/vm/Stack-inl.h
js/src/vm/Stack.cpp
js/src/vm/Stack.h
js/src/vm/Stopwatch.h
js/src/vm/StructuredClone.cpp
js/src/wasm/WasmTextToBinary.cpp
--- a/js/src/builtin/Intl.cpp
+++ b/js/src/builtin/Intl.cpp
@@ -4403,19 +4403,17 @@ enum class DisplayNameStyle
     Narrow,
     Short,
     Long,
 };
 
 template<typename ConstChar>
 static JSString*
 ComputeSingleDisplayName(JSContext* cx, UDateFormat* fmt, UDateTimePatternGenerator* dtpg,
-                         DisplayNameStyle style,
-                         Vector<char16_t, INITIAL_CHAR_BUFFER_SIZE>& chars,
-                         const Range<ConstChar>& pattern)
+                         DisplayNameStyle style, const Range<ConstChar>& pattern)
 {
     RangedPtr<ConstChar> iter = pattern.begin();
     const RangedPtr<ConstChar> end = pattern.end();
 
     auto MatchSlash = [cx, pattern, &iter, end]() {
         if (MOZ_LIKELY(iter != end && *iter == '/')) {
             iter++;
             return true;
@@ -4642,20 +4640,16 @@ js::intl_ComputeDisplayNames(JSContext* 
     // time fields like "month", "week", "day" etc.
     UDateTimePatternGenerator* dtpg = udatpg_open(icuLocale(locale.ptr()), &status);
     if (U_FAILURE(status)) {
         JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, JSMSG_INTERNAL_INTL_ERROR);
         return false;
     }
     ScopedICUObject<UDateTimePatternGenerator, udatpg_close> datPgToClose(dtpg);
 
-    Vector<char16_t, INITIAL_CHAR_BUFFER_SIZE> chars(cx);
-    if (!chars.resize(INITIAL_CHAR_BUFFER_SIZE))
-        return false;
-
     // 5. For each element of keys,
     RootedString keyValStr(cx);
     RootedValue v(cx);
     for (uint32_t i = 0; i < keys->length(); i++) {
         if (!GetElement(cx, keys, keys, i, &v))
             return false;
 
         keyValStr = v.toString();
@@ -4663,20 +4657,18 @@ js::intl_ComputeDisplayNames(JSContext* 
         AutoStableStringChars stablePatternChars(cx);
         if (!stablePatternChars.init(cx, keyValStr))
             return false;
 
         // 5.a. Perform an implementation dependent algorithm to map a key to a
         //      corresponding display name.
         JSString* displayName =
             stablePatternChars.isLatin1()
-            ? ComputeSingleDisplayName(cx, fmt, dtpg, dnStyle, chars,
-                                       stablePatternChars.latin1Range())
-            : ComputeSingleDisplayName(cx, fmt, dtpg, dnStyle, chars,
-                                       stablePatternChars.twoByteRange());
+            ? ComputeSingleDisplayName(cx, fmt, dtpg, dnStyle, stablePatternChars.latin1Range())
+            : ComputeSingleDisplayName(cx, fmt, dtpg, dnStyle, stablePatternChars.twoByteRange());
         if (!displayName)
             return false;
 
         // 5.b. Append the result string to result.
         v.setString(displayName);
         if (!DefineDataElement(cx, result, i, v))
             return false;
     }
--- a/js/src/builtin/MapObject.cpp
+++ b/js/src/builtin/MapObject.cpp
@@ -586,17 +586,17 @@ WriteBarrierPost(JSRuntime* rt, MapObjec
 
 inline static MOZ_MUST_USE bool
 WriteBarrierPost(JSRuntime* rt, SetObject* set, const Value& key)
 {
     return WriteBarrierPostImpl(rt, set, key);
 }
 
 bool
-MapObject::getKeysAndValuesInterleaved(JSContext* cx, HandleObject obj,
+MapObject::getKeysAndValuesInterleaved(HandleObject obj,
                                        JS::MutableHandle<GCVector<JS::Value>> entries)
 {
     ValueMap* map = obj->as<MapObject>().getData();
     if (!map)
         return false;
 
     for (ValueMap::Range r = map->all(); !r.empty(); r.popFront()) {
         if (!entries.append(r.front().key.get()) ||
@@ -1367,17 +1367,17 @@ SetObject::sweepAfterMinorGC(FreeOp* fop
     }
 
     setobj = MaybeForwarded(setobj);
     setobj->getData()->destroyNurseryRanges();
     SetHasNurseryMemory(setobj, false);
 }
 
 bool
-SetObject::isBuiltinAdd(HandleValue add, JSContext* cx)
+SetObject::isBuiltinAdd(HandleValue add)
 {
     return IsNativeFunction(add, SetObject::add);
 }
 
 bool
 SetObject::construct(JSContext* cx, unsigned argc, Value* vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
--- a/js/src/builtin/MapObject.h
+++ b/js/src/builtin/MapObject.h
@@ -103,17 +103,17 @@ class MapObject : public NativeObject {
                   "IteratorKind Entries must match self-hosting define for item kind "
                   "key-and-value.");
 
     static const Class class_;
     static const Class protoClass_;
 
     enum { NurseryKeysSlot, HasNurseryMemorySlot, SlotCount };
 
-    static MOZ_MUST_USE bool getKeysAndValuesInterleaved(JSContext* cx, HandleObject obj,
+    static MOZ_MUST_USE bool getKeysAndValuesInterleaved(HandleObject obj,
                                             JS::MutableHandle<GCVector<JS::Value>> entries);
     static MOZ_MUST_USE bool entries(JSContext* cx, unsigned argc, Value* vp);
     static MOZ_MUST_USE bool has(JSContext* cx, unsigned argc, Value* vp);
     static MapObject* create(JSContext* cx, HandleObject proto = nullptr);
 
     // Publicly exposed Map calls for JSAPI access (webidl maplike/setlike
     // interfaces, etc.)
     static uint32_t size(JSContext *cx, HandleObject obj);
@@ -252,17 +252,17 @@ class SetObject : public NativeObject {
     static ValueSet& extract(const CallArgs& args);
     static void trace(JSTracer* trc, JSObject* obj);
     static void finalize(FreeOp* fop, JSObject* obj);
     static bool construct(JSContext* cx, unsigned argc, Value* vp);
 
     static bool is(HandleValue v);
     static bool is(HandleObject o);
 
-    static bool isBuiltinAdd(HandleValue add, JSContext* cx);
+    static bool isBuiltinAdd(HandleValue add);
 
     static MOZ_MUST_USE bool iterator_impl(JSContext* cx, const CallArgs& args, IteratorKind kind);
 
     static MOZ_MUST_USE bool size_impl(JSContext* cx, const CallArgs& args);
     static MOZ_MUST_USE bool size(JSContext* cx, unsigned argc, Value* vp);
     static MOZ_MUST_USE bool has_impl(JSContext* cx, const CallArgs& args);
     static MOZ_MUST_USE bool add_impl(JSContext* cx, const CallArgs& args);
     static MOZ_MUST_USE bool add(JSContext* cx, unsigned argc, Value* vp);
@@ -300,17 +300,17 @@ class SetIteratorObject : public NativeO
 
     static JSObject* createResult(JSContext* cx);
 
   private:
     inline SetObject::IteratorKind kind() const;
 };
 
 using SetInitGetPrototypeOp = NativeObject* (*)(JSContext*, Handle<GlobalObject*>);
-using SetInitIsBuiltinOp = bool (*)(HandleValue, JSContext*);
+using SetInitIsBuiltinOp = bool (*)(HandleValue);
 
 template <SetInitGetPrototypeOp getPrototypeOp, SetInitIsBuiltinOp isBuiltinOp>
 static MOZ_MUST_USE bool
 IsOptimizableInitForSet(JSContext* cx, HandleObject setObject, HandleValue iterable, bool* optimized)
 {
     MOZ_ASSERT(!*optimized);
 
     if (!iterable.isObject())
@@ -331,17 +331,17 @@ IsOptimizableInitForSet(JSContext* cx, H
 
     // Look up the 'add' value on the prototype object.
     Shape* addShape = setProto->lookup(cx, cx->names().add);
     if (!addShape || !addShape->isDataProperty())
         return true;
 
     // Get the referred value, ensure it holds the canonical add function.
     RootedValue add(cx, setProto->getSlot(addShape->slot()));
-    if (!isBuiltinOp(add, cx))
+    if (!isBuiltinOp(add))
         return true;
 
     ForOfPIC::Chain* stubChain = ForOfPIC::getOrCreate(cx);
     if (!stubChain)
         return false;
 
     return stubChain->tryOptimizeArray(cx, array.as<ArrayObject>(), optimized);
 }
--- a/js/src/builtin/RegExp.cpp
+++ b/js/src/builtin/RegExp.cpp
@@ -103,17 +103,17 @@ js::CreateRegExpMatchResult(JSContext* c
 #endif
 
     /* Step 25. */
     rval.setObject(*arr);
     return true;
 }
 
 static int32_t
-CreateRegExpSearchResult(JSContext* cx, const MatchPairs& matches)
+CreateRegExpSearchResult(const MatchPairs& matches)
 {
     /* Fit the start and limit of match into a int32_t. */
     uint32_t position = matches[0].start;
     uint32_t lastIndex = matches[0].limit;
     MOZ_ASSERT(position < 0x8000);
     MOZ_ASSERT(lastIndex < 0x8000);
     return position | (lastIndex << 15);
 }
@@ -1073,17 +1073,17 @@ RegExpSearcherImpl(JSContext* cx, Handle
 
     /* Steps 12.a, 12.c. */
     if (status == RegExpRunStatus_Success_NotFound) {
         *result = -1;
         return true;
     }
 
     /* Steps 16-25 */
-    *result = CreateRegExpSearchResult(cx, matches);
+    *result = CreateRegExpSearchResult(matches);
     return true;
 }
 
 /*
  * ES 2017 draft rev 6a13789aa9e7c6de4e96b7d3e24d9e6eba6584ad 21.2.5.2.2
  * steps 3, 9-25, except 12.a.i, 12.c.i.1, 15.
  */
 bool
@@ -1118,17 +1118,17 @@ bool
 js::RegExpSearcherRaw(JSContext* cx, HandleObject regexp, HandleString input,
                       int32_t lastIndex, MatchPairs* maybeMatches, int32_t* result)
 {
     MOZ_ASSERT(lastIndex >= 0);
 
     // The MatchPairs will always be passed in, but RegExp execution was
     // successful only if the pairs have actually been filled in.
     if (maybeMatches && maybeMatches->pairsRaw()[0] >= 0) {
-        *result = CreateRegExpSearchResult(cx, *maybeMatches);
+        *result = CreateRegExpSearchResult(*maybeMatches);
         return true;
     }
     return RegExpSearcherImpl(cx, regexp, input, lastIndex,
                               UpdateRegExpStatics, result);
 }
 
 bool
 js::regexp_exec_no_statics(JSContext* cx, unsigned argc, Value* vp)
--- a/js/src/builtin/WeakSetObject.cpp
+++ b/js/src/builtin/WeakSetObject.cpp
@@ -173,17 +173,17 @@ WeakSetObject::initClass(JSContext* cx, 
 
 WeakSetObject*
 WeakSetObject::create(JSContext* cx, HandleObject proto /* = nullptr */)
 {
     return NewObjectWithClassProto<WeakSetObject>(cx, proto);
 }
 
 bool
-WeakSetObject::isBuiltinAdd(HandleValue add, JSContext* cx)
+WeakSetObject::isBuiltinAdd(HandleValue add)
 {
     return IsNativeFunction(add, WeakSet_add);
 }
 
 bool
 WeakSetObject::construct(JSContext* cx, unsigned argc, Value* vp)
 {
     // Based on our "Set" implementation instead of the more general ES6 steps.
--- a/js/src/builtin/WeakSetObject.h
+++ b/js/src/builtin/WeakSetObject.h
@@ -19,17 +19,17 @@ class WeakSetObject : public WeakCollect
 
   private:
     static const JSPropertySpec properties[];
     static const JSFunctionSpec methods[];
 
     static WeakSetObject* create(JSContext* cx, HandleObject proto = nullptr);
     static MOZ_MUST_USE bool construct(JSContext* cx, unsigned argc, Value* vp);
 
-    static bool isBuiltinAdd(HandleValue add, JSContext* cx);
+    static bool isBuiltinAdd(HandleValue add);
 };
 
 extern JSObject*
 InitWeakSetClass(JSContext* cx, HandleObject obj);
 
 } // namespace js
 
 template<>
--- a/js/src/frontend/Parser.cpp
+++ b/js/src/frontend/Parser.cpp
@@ -445,17 +445,17 @@ UsedNameTracker::rewind(RewindToken toke
 {
     scriptCounter_ = token.scriptId;
     scopeCounter_ = token.scopeId;
 
     for (UsedNameMap::Range r = map_.all(); !r.empty(); r.popFront())
         r.front().value().resetToScope(token.scriptId, token.scopeId);
 }
 
-FunctionBox::FunctionBox(JSContext* cx, LifoAlloc& alloc, ObjectBox* traceListHead,
+FunctionBox::FunctionBox(JSContext* cx, ObjectBox* traceListHead,
                          JSFunction* fun, uint32_t toStringStart,
                          Directives directives, bool extraWarnings,
                          GeneratorKind generatorKind, FunctionAsyncKind asyncKind)
   : ObjectBox(fun, traceListHead),
     SharedContext(cx, Kind::FunctionBox, directives, extraWarnings),
     enclosingScope_(nullptr),
     namedLambdaBindings_(nullptr),
     functionScopeBindings_(nullptr),
@@ -830,18 +830,17 @@ Parser<SyntaxParseHandler, char16_t>::ab
 }
 
 #undef ABORTED_SYNTAX_PARSE_SENTINEL
 
 ParserBase::ParserBase(JSContext* cx, LifoAlloc& alloc,
                        const ReadOnlyCompileOptions& options,
                        const char16_t* chars, size_t length,
                        bool foldConstants,
-                       UsedNameTracker& usedNames,
-                       LazyScript* lazyOuterFunction)
+                       UsedNameTracker& usedNames)
   : context(cx),
     alloc(alloc),
     tokenStream(cx, options, chars, length, thisForCtor()),
     traceListHead(nullptr),
     pc(nullptr),
     usedNames(usedNames),
     ss(nullptr),
     keepAtoms(cx),
@@ -873,17 +872,17 @@ ParserBase::~ParserBase()
 template <class ParseHandler, typename CharT>
 Parser<ParseHandler, CharT>::Parser(JSContext* cx, LifoAlloc& alloc,
                                     const ReadOnlyCompileOptions& options,
                                     const CharT* chars, size_t length,
                                     bool foldConstants,
                                     UsedNameTracker& usedNames,
                                     SyntaxParser* syntaxParser,
                                     LazyScript* lazyOuterFunction)
-  : ParserBase(cx, alloc, options, chars, length, foldConstants, usedNames, lazyOuterFunction),
+  : ParserBase(cx, alloc, options, chars, length, foldConstants, usedNames),
     AutoGCRooter(cx, PARSER),
     syntaxParser_(syntaxParser),
     handler(cx, alloc, lazyOuterFunction)
 {
     // The Mozilla specific JSOPTION_EXTRA_WARNINGS option adds extra warnings
     // which are not generated if functions are parsed lazily. Note that the
     // standard "use strict" does not inhibit lazy parsing.
     if (options.extraWarningsOption)
@@ -959,17 +958,17 @@ Parser<ParseHandler, CharT>::newFunction
     /*
      * 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, alloc, traceListHead, fun, toStringStart,
+        alloc.new_<FunctionBox>(context, traceListHead, fun, toStringStart,
                                 inheritedDirectives, options().extraWarningsOption,
                                 generatorKind, asyncKind);
     if (!funbox) {
         ReportOutOfMemory(context);
         return nullptr;
     }
 
     traceListHead = funbox;
@@ -3463,19 +3462,18 @@ Parser<FullParseHandler, char16_t>::tryS
         // the syntax parser cannot attach one to it.
         FunctionBox* funbox = newFunctionBox(pn, fun, toStringStart, inheritedDirectives,
                                              generatorKind, asyncKind);
         if (!funbox)
             return false;
         funbox->initWithEnclosingParseContext(pc, kind);
 
         if (!syntaxParser_->innerFunction(SyntaxParseHandler::NodeGeneric,
-                                          pc, funbox, toStringStart,
-                                          inHandling, yieldHandling, kind,
-                                          inheritedDirectives, newDirectives))
+                                          pc, funbox, inHandling, yieldHandling, kind,
+                                          newDirectives))
         {
             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(),
@@ -3521,19 +3519,18 @@ Parser<SyntaxParseHandler, char16_t>::tr
     // This is already a syntax parser, so just parse the inner function.
     return innerFunction(pn, pc, fun, toStringStart, inHandling, yieldHandling, kind,
                          generatorKind, asyncKind, tryAnnexB, inheritedDirectives, newDirectives);
 }
 
 template <class ParseHandler, typename CharT>
 bool
 Parser<ParseHandler, CharT>::innerFunction(Node pn, ParseContext* outerpc, FunctionBox* funbox,
-                                           uint32_t toStringStart, InHandling inHandling,
+                                           InHandling inHandling,
                                            YieldHandling yieldHandling, FunctionSyntaxKind kind,
-                                           Directives inheritedDirectives,
                                            Directives* newDirectives)
 {
     // Note that it is possible for outerpc != this->pc, as we may be
     // attempting to syntax parse an inner function from an outer full
     // parser. In that case, outerpc is a SourceParseContext from the full parser
     // instead of the current top of the stack of the syntax parser.
 
     // Push a new ParseContext.
@@ -3563,21 +3560,18 @@ Parser<ParseHandler, CharT>::innerFuncti
     // instead of the current top of the stack of the syntax parser.
 
     FunctionBox* funbox = newFunctionBox(pn, fun, toStringStart, inheritedDirectives,
                                          generatorKind, asyncKind);
     if (!funbox)
         return false;
     funbox->initWithEnclosingParseContext(outerpc, kind);
 
-    if (!innerFunction(pn, outerpc, funbox, toStringStart, inHandling, yieldHandling, kind,
-                       inheritedDirectives, newDirectives))
-    {
+    if (!innerFunction(pn, outerpc, funbox, inHandling, yieldHandling, kind, newDirectives))
         return false;
-    }
 
     // Append possible Annex B function box only upon successfully parsing.
     if (tryAnnexB && !pc->innermostScope()->addPossibleAnnexBFunctionBox(pc, funbox))
         return false;
 
     return true;
 }
 
@@ -4721,17 +4715,17 @@ Parser<ParseHandler, CharT>::expressionA
     Node pn = forHeadKind == PNK_FOROF
            ? assignExpr(InAllowed, yieldHandling, TripledotProhibited)
            : expr(InAllowed, yieldHandling, TripledotProhibited);
     return pn;
 }
 
 template <class ParseHandler, typename CharT>
 typename ParseHandler::Node
-Parser<ParseHandler, CharT>::declarationPattern(Node decl, DeclarationKind declKind, TokenKind tt,
+Parser<ParseHandler, CharT>::declarationPattern(DeclarationKind declKind, TokenKind tt,
                                                 bool initialDeclaration,
                                                 YieldHandling yieldHandling,
                                                 ParseNodeKind* forHeadKind,
                                                 Node* forInOrOfExpression)
 {
     MOZ_ASSERT(tokenStream.isCurrentTokenType(TOK_LB) ||
                tokenStream.isCurrentTokenType(TOK_LC));
 
@@ -4774,18 +4768,17 @@ Parser<ParseHandler, CharT>::declaration
 
     handler.checkAndSetIsDirectRHSAnonFunction(init);
 
     return handler.newAssignment(PNK_ASSIGN, pattern, init);
 }
 
 template <class ParseHandler, typename CharT>
 bool
-Parser<ParseHandler, CharT>::initializerInNameDeclaration(Node decl, Node binding,
-                                                          Handle<PropertyName*> name,
+Parser<ParseHandler, CharT>::initializerInNameDeclaration(Node binding,
                                                           DeclarationKind declKind,
                                                           bool initialDeclaration,
                                                           YieldHandling yieldHandling,
                                                           ParseNodeKind* forHeadKind,
                                                           Node* forInOrOfExpression)
 {
     MOZ_ASSERT(tokenStream.isCurrentTokenType(TOK_ASSIGN));
 
@@ -4836,17 +4829,17 @@ Parser<ParseHandler, CharT>::initializer
         }
     }
 
     return handler.finishInitializerAssignment(binding, initializer);
 }
 
 template <class ParseHandler, typename CharT>
 typename ParseHandler::Node
-Parser<ParseHandler, CharT>::declarationName(Node decl, DeclarationKind declKind, TokenKind tt,
+Parser<ParseHandler, CharT>::declarationName(DeclarationKind declKind, TokenKind tt,
                                              bool initialDeclaration, YieldHandling yieldHandling,
                                              ParseNodeKind* forHeadKind, Node* forInOrOfExpression)
 {
     // Anything other than possible identifier is an error.
     if (!TokenKindIsPossibleIdentifier(tt)) {
         error(JSMSG_NO_VARIABLE_NAME);
         return null();
     }
@@ -4868,17 +4861,17 @@ Parser<ParseHandler, CharT>::declaration
     //  /bar/g;   // ExpressionStatement
     //
     // Therefore get the token here as Operand.
     bool matched;
     if (!tokenStream.matchToken(&matched, TOK_ASSIGN, TokenStream::Operand))
         return null();
 
     if (matched) {
-        if (!initializerInNameDeclaration(decl, binding, name, declKind, initialDeclaration,
+        if (!initializerInNameDeclaration(binding, declKind, initialDeclaration,
                                           yieldHandling, forHeadKind, forInOrOfExpression))
         {
             return null();
         }
     } else {
         if (initialDeclaration && forHeadKind) {
             bool isForIn, isForOf;
             if (!matchInOrOf(&isForIn, &isForOf))
@@ -4953,19 +4946,19 @@ Parser<ParseHandler, CharT>::declaration
         MOZ_ASSERT_IF(!initialDeclaration && forHeadKind,
                       *forHeadKind == PNK_FORHEAD);
 
         TokenKind tt;
         if (!tokenStream.getToken(&tt))
             return null();
 
         Node binding = (tt == TOK_LB || tt == TOK_LC)
-                       ? declarationPattern(decl, declKind, tt, initialDeclaration, yieldHandling,
+                       ? declarationPattern(declKind, tt, initialDeclaration, yieldHandling,
                                             forHeadKind, forInOrOfExpression)
-                       : declarationName(decl, declKind, tt, initialDeclaration, yieldHandling,
+                       : declarationName(declKind, tt, initialDeclaration, yieldHandling,
                                          forHeadKind, forInOrOfExpression);
         if (!binding)
             return null();
 
         handler.addList(decl, binding);
 
         // If we have a for-in/of loop, the above call matches the entirety
         // of the loop head (up to the closing parenthesis).
@@ -6024,17 +6017,16 @@ Parser<ParseHandler, CharT>::matchInOrOf
 
     MOZ_ASSERT_IF(*isForInp || *isForOfp, *isForInp != *isForOfp);
     return true;
 }
 
 template <class ParseHandler, typename CharT>
 bool
 Parser<ParseHandler, CharT>::forHeadStart(YieldHandling yieldHandling,
-                                          IteratorKind iterKind,
                                           ParseNodeKind* forHeadKind,
                                           Node* forInitialPart,
                                           Maybe<ParseContext::Scope>& forLoopLexicalScope,
                                           Node* forInOrOfExpression)
 {
     MOZ_ASSERT(tokenStream.isCurrentTokenType(TOK_LP));
 
     TokenKind tt;
@@ -6238,21 +6230,18 @@ Parser<ParseHandler, CharT>::forStatemen
     //
     // ...OR, parse up to the first ';' in a C-style for-loop:
     //
     //   for (...; ...; ...) ...
     //           ^next token
     //
     // In either case the subsequent token can be consistently accessed using
     // TokenStream::None semantics.
-    if (!forHeadStart(yieldHandling, iterKind, &headKind, &startNode, forLoopLexicalScope,
-                      &iteratedExpr))
-    {
-        return null();
-    }
+    if (!forHeadStart(yieldHandling, &headKind, &startNode, forLoopLexicalScope, &iteratedExpr))
+        return null();
 
     MOZ_ASSERT(headKind == PNK_FORIN || headKind == PNK_FOROF || headKind == PNK_FORHEAD);
 
     if (iterKind == IteratorKind::Async && headKind != PNK_FOROF) {
         errorAt(begin, JSMSG_FOR_AWAIT_NOT_OF);
         return null();
     }
 
--- a/js/src/frontend/Parser.h
+++ b/js/src/frontend/Parser.h
@@ -159,17 +159,17 @@ class ParserBase : public StrictModeGett
 
   public:
     bool awaitIsKeyword() const {
       return awaitHandling_ != AwaitIsName;
     }
 
     ParserBase(JSContext* cx, LifoAlloc& alloc, const ReadOnlyCompileOptions& options,
                const char16_t* chars, size_t length, bool foldConstants,
-               UsedNameTracker& usedNames, LazyScript* lazyOuterFunction);
+               UsedNameTracker& usedNames);
     ~ParserBase();
 
     const char* getFilename() const { return tokenStream.getFilename(); }
     TokenPos pos() const { return tokenStream.currentToken().pos; }
 
     // Determine whether |yield| is a valid name in the current context.
     bool yieldExpressionsSupported() const {
         return pc->isGenerator();
@@ -553,19 +553,19 @@ class Parser final : public ParserBase, 
 
     // Parse a function, given only its arguments and body. Used for lazily
     // parsed functions.
     Node standaloneLazyFunction(HandleFunction fun, uint32_t toStringStart, bool strict,
                                 GeneratorKind generatorKind, FunctionAsyncKind asyncKind);
 
     // Parse an inner function given an enclosing ParseContext and a
     // FunctionBox for the inner function.
-    bool innerFunction(Node pn, ParseContext* outerpc, FunctionBox* funbox, uint32_t toStringStart,
+    bool innerFunction(Node pn, ParseContext* outerpc, FunctionBox* funbox,
                        InHandling inHandling, YieldHandling yieldHandling, FunctionSyntaxKind kind,
-                       Directives inheritedDirectives, Directives* newDirectives);
+                       Directives* newDirectives);
 
     // Parse a function's formal parameters and its body assuming its function
     // ParseContext is already on the stack.
     bool functionFormalParametersAndBody(InHandling inHandling, YieldHandling yieldHandling,
                                          Node pn, FunctionSyntaxKind kind,
                                          const mozilla::Maybe<uint32_t>& parameterListEnd = mozilla::Nothing(),
                                          bool isStandaloneFunction = false);
 
@@ -603,17 +603,16 @@ class Parser final : public ParserBase, 
 
     Node blockStatement(YieldHandling yieldHandling,
                         unsigned errorNumber = JSMSG_CURLY_IN_COMPOUND);
     Node doWhileStatement(YieldHandling yieldHandling);
     Node whileStatement(YieldHandling yieldHandling);
 
     Node forStatement(YieldHandling yieldHandling);
     bool forHeadStart(YieldHandling yieldHandling,
-                      IteratorKind iterKind,
                       ParseNodeKind* forHeadKind,
                       Node* forInitialPart,
                       mozilla::Maybe<ParseContext::Scope>& forLetImpliedScope,
                       Node* forInOrOfExpression);
     Node expressionAfterForInOrOf(ParseNodeKind forHeadKind, YieldHandling yieldHandling);
 
     Node switchStatement(YieldHandling yieldHandling);
     Node continueStatement(YieldHandling yieldHandling);
@@ -693,29 +692,29 @@ class Parser final : public ParserBase, 
     // without initializers.  These two methods parse a single pattern/name and
     // any associated initializer -- and if parsing an |initialDeclaration|
     // will, if parsing in a for-loop head (as specified by |forHeadKind| being
     // non-null), consume additional tokens up to the closing ')' in a
     // for-in/of loop head, returning the iterated expression in
     // |*forInOrOfExpression|.  (An "initial declaration" is the first
     // declaration in a declaration list: |a| but not |b| in |var a, b|, |{c}|
     // but not |d| in |let {c} = 3, d|.)
-    Node declarationPattern(Node decl, DeclarationKind declKind, TokenKind tt,
+    Node declarationPattern(DeclarationKind declKind, TokenKind tt,
                             bool initialDeclaration, YieldHandling yieldHandling,
                             ParseNodeKind* forHeadKind, Node* forInOrOfExpression);
-    Node declarationName(Node decl, DeclarationKind declKind, TokenKind tt,
+    Node declarationName(DeclarationKind declKind, TokenKind tt,
                          bool initialDeclaration, YieldHandling yieldHandling,
                          ParseNodeKind* forHeadKind, Node* forInOrOfExpression);
 
     // Having parsed a name (not found in a destructuring pattern) declared by
     // a declaration, with the current token being the '=' separating the name
     // from its initializer, parse and bind that initializer -- and possibly
     // consume trailing in/of and subsequent expression, if so directed by
     // |forHeadKind|.
-    bool initializerInNameDeclaration(Node decl, Node binding, Handle<PropertyName*> name,
+    bool initializerInNameDeclaration(Node binding,
                                       DeclarationKind declKind, bool initialDeclaration,
                                       YieldHandling yieldHandling, ParseNodeKind* forHeadKind,
                                       Node* forInOrOfExpression);
 
     Node expr(InHandling inHandling, YieldHandling yieldHandling,
               TripledotHandling tripledotHandling, PossibleError* possibleError = nullptr,
               InvokedPrediction invoked = PredictUninvoked);
     Node assignExpr(InHandling inHandling, YieldHandling yieldHandling,
--- a/js/src/frontend/SharedContext.h
+++ b/js/src/frontend/SharedContext.h
@@ -392,17 +392,17 @@ class FunctionBox : public ObjectBox, pu
 
     // Whether this function has a .this binding. If true, we need to emit
     // JSOP_FUNCTIONTHIS in the prologue to initialize it.
     bool hasThisBinding_:1;
 
     // Whether this function has nested functions.
     bool hasInnerFunctions_:1;
 
-    FunctionBox(JSContext* cx, LifoAlloc& alloc, ObjectBox* traceListHead, JSFunction* fun,
+    FunctionBox(JSContext* cx, ObjectBox* traceListHead, JSFunction* fun,
                 uint32_t toStringStart, Directives directives, bool extraWarnings,
                 GeneratorKind generatorKind, FunctionAsyncKind asyncKind);
 
     MutableHandle<LexicalScope::Data*> namedLambdaBindings() {
         MOZ_ASSERT(context->keepAtoms);
         return MutableHandle<LexicalScope::Data*>::fromMarkedLocation(&namedLambdaBindings_);
     }
 
--- a/js/src/frontend/TokenStream.cpp
+++ b/js/src/frontend/TokenStream.cpp
@@ -418,17 +418,17 @@ TokenStreamAnyChars::TokenStreamAnyChars
     mutedErrors(options.mutedErrors()),
     strictModeGetter(smg)
 {
 }
 
 TokenStream::TokenStream(JSContext* cx, const ReadOnlyCompileOptions& options,
                          const CharT* base, size_t length, StrictModeGetter* smg)
   : TokenStreamAnyChars(cx, options, smg),
-    userbuf(cx, base, length, options.scriptSourceOffset),
+    userbuf(base, length, options.scriptSourceOffset),
     tokenbuf(cx)
 {
     // Nb: the following tables could be static, but initializing them here is
     // much easier.  Don't worry, the time to initialize them for each
     // TokenStream is trivial.  See bug 639420.
 
     // See Parser::assignExpr() for an explanation of isExprEnding[].
     memset(isExprEnding, 0, sizeof(isExprEnding));
--- a/js/src/frontend/TokenStream.h
+++ b/js/src/frontend/TokenStream.h
@@ -947,17 +947,17 @@ class MOZ_STACK_CLASS TokenStream final 
     // chars" refers to the lack of EOL sequence normalization.)
     //
     // buf[0..length-1] often represents a substring of some larger source,
     // where we have only the substring in memory. The |startOffset| argument
     // indicates the offset within this larger string at which our string
     // begins, the offset of |buf[0]|.
     class TokenBuf {
       public:
-        TokenBuf(JSContext* cx, const CharT* buf, size_t length, size_t startOffset)
+        TokenBuf(const CharT* buf, size_t length, size_t startOffset)
           : base_(buf),
             startOffset_(startOffset),
             limit_(buf + length),
             ptr(buf)
         { }
 
         bool hasRawChars() const {
             return ptr < limit_;
--- a/js/src/gc/Zone.h
+++ b/js/src/gc/Zone.h
@@ -817,20 +817,16 @@ class ZonesIter
   public:
     ZonesIter(JSRuntime* rt, ZoneSelector selector)
       : group(rt), atomsZone(selector == WithAtoms ? rt->gc.atomsZone.ref() : nullptr)
     {
         if (!atomsZone && !done())
             next();
     }
 
-    bool atAtomsZone(JSRuntime* rt) const {
-        return !!atomsZone;
-    }
-
     bool done() const { return !atomsZone && group.done(); }
 
     void next() {
         MOZ_ASSERT(!done());
         if (atomsZone)
             atomsZone = nullptr;
         while (!group.done()) {
             if (zone.isSome())
--- a/js/src/jit/BaselineCacheIRCompiler.cpp
+++ b/js/src/jit/BaselineCacheIRCompiler.cpp
@@ -851,17 +851,17 @@ BaselineCacheIRCompiler::emitLoadTypedOb
     // Get the object's data pointer.
     LoadTypedThingData(masm, layout, obj, scratch1);
 
     // Get the address being written to.
     masm.load32(fieldOffset, scratch2);
     masm.addPtr(scratch2, scratch1);
 
     Address fieldAddr(scratch1, 0);
-    emitLoadTypedObjectResultShared(fieldAddr, scratch2, layout, typeDescr, output);
+    emitLoadTypedObjectResultShared(fieldAddr, scratch2, typeDescr, output);
     return true;
 }
 
 bool
 BaselineCacheIRCompiler::emitLoadFrameArgumentResult()
 {
     AutoOutputRegister output(*this);
     Register index = allocator.useRegister(masm, reader.int32OperandId());
--- a/js/src/jit/BaselineCompiler.cpp
+++ b/js/src/jit/BaselineCompiler.cpp
@@ -1425,17 +1425,17 @@ BaselineCompiler::emit_JSOP_CHECKISCALLA
     return true;
 }
 
 typedef bool (*ThrowUninitializedThisFn)(JSContext*, BaselineFrame* frame);
 static const VMFunction ThrowUninitializedThisInfo =
     FunctionInfo<ThrowUninitializedThisFn>(BaselineThrowUninitializedThis,
                                            "BaselineThrowUninitializedThis");
 
-typedef bool (*ThrowInitializedThisFn)(JSContext*, BaselineFrame* frame);
+typedef bool (*ThrowInitializedThisFn)(JSContext*);
 static const VMFunction ThrowInitializedThisInfo =
     FunctionInfo<ThrowInitializedThisFn>(BaselineThrowInitializedThis,
                                          "BaselineThrowInitializedThis");
 
 bool
 BaselineCompiler::emit_JSOP_CHECKTHIS()
 {
     frame.syncStack(0);
@@ -1459,23 +1459,23 @@ BaselineCompiler::emitCheckThis(ValueOpe
     Label thisOK;
     if (reinit)
         masm.branchTestMagic(Assembler::Equal, val, &thisOK);
     else
         masm.branchTestMagic(Assembler::NotEqual, val, &thisOK);
 
     prepareVMCall();
 
-    masm.loadBaselineFramePtr(BaselineFrameReg, val.scratchReg());
-    pushArg(val.scratchReg());
-
     if (reinit) {
         if (!callVM(ThrowInitializedThisInfo))
             return false;
     } else {
+        masm.loadBaselineFramePtr(BaselineFrameReg, val.scratchReg());
+        pushArg(val.scratchReg());
+
         if (!callVM(ThrowUninitializedThisInfo))
             return false;
     }
 
     masm.bind(&thisOK);
     return true;
 }
 
@@ -4008,17 +4008,17 @@ BaselineCompiler::emit_JSOP_RETRVAL()
         masm.branchTest32(Assembler::Zero, flags, Imm32(BaselineFrame::HAS_RVAL), &done);
         masm.loadValue(frame.addressOfReturnValue(), JSReturnOperand);
         masm.bind(&done);
     }
 
     return emitReturn();
 }
 
-typedef bool (*ToIdFn)(JSContext*, HandleScript, jsbytecode*, HandleValue, MutableHandleValue);
+typedef bool (*ToIdFn)(JSContext*, HandleValue, MutableHandleValue);
 static const VMFunction ToIdInfo = FunctionInfo<ToIdFn>(js::ToIdOperation, "ToIdOperation");
 
 bool
 BaselineCompiler::emit_JSOP_TOID()
 {
     // Load index in R0, but keep values on the stack for the decompiler.
     frame.syncStack(0);
     masm.loadValue(frame.addressOfStackValue(frame.peek(-1)), R0);
@@ -4027,18 +4027,16 @@ BaselineCompiler::emit_JSOP_TOID()
     Label done;
     masm.branchTestInt32(Assembler::Equal, R0, &done);
     masm.branchTestString(Assembler::Equal, R0, &done);
     masm.branchTestSymbol(Assembler::Equal, R0, &done);
 
     prepareVMCall();
 
     pushArg(R0);
-    pushArg(ImmPtr(pc));
-    pushArg(ImmGCPtr(script));
 
     if (!callVM(ToIdInfo))
         return false;
 
     masm.bind(&done);
     frame.pop(); // Pop index.
     frame.push(R0);
     return true;
--- a/js/src/jit/CacheIRCompiler.cpp
+++ b/js/src/jit/CacheIRCompiler.cpp
@@ -2143,17 +2143,17 @@ CacheIRCompiler::emitLoadTypedElementRes
             masm.loadFromTypedArray(type, source, output.typedReg(), scratch, failure->label());
         }
     }
     return true;
 }
 
 void
 CacheIRCompiler::emitLoadTypedObjectResultShared(const Address& fieldAddr, Register scratch,
-                                                 TypedThingLayout layout, uint32_t typeDescr,
+                                                 uint32_t typeDescr,
                                                  const AutoOutputRegister& output)
 {
     MOZ_ASSERT(output.hasValue());
 
     if (SimpleTypeDescrKeyIsScalar(typeDescr)) {
         Scalar::Type type = ScalarTypeFromSimpleTypeDescrKey(typeDescr);
         masm.loadFromTypedArray(type, fieldAddr, output.valueReg(),
                                 /* allowDouble = */ true, scratch, nullptr);
--- a/js/src/jit/CacheIRCompiler.h
+++ b/js/src/jit/CacheIRCompiler.h
@@ -555,17 +555,17 @@ class MOZ_RAII CacheIRCompiler
 
     // Returns the set of volatile float registers that are live. These
     // registers need to be saved when making non-GC calls with callWithABI.
     FloatRegisterSet liveVolatileFloatRegs() const {
         return FloatRegisterSet::Intersect(liveFloatRegs_.set(), FloatRegisterSet::Volatile());
     }
 
     void emitLoadTypedObjectResultShared(const Address& fieldAddr, Register scratch,
-                                         TypedThingLayout layout, uint32_t typeDescr,
+                                         uint32_t typeDescr,
                                          const AutoOutputRegister& output);
 
     void emitStoreTypedObjectReferenceProp(ValueOperand val, ReferenceTypeDescr::Type type,
                                            const Address& dest, Register scratch);
 
     void emitRegisterEnumerator(Register enumeratorsList, Register iter, Register scratch);
 
   private:
--- a/js/src/jit/CodeGenerator.cpp
+++ b/js/src/jit/CodeGenerator.cpp
@@ -10692,32 +10692,29 @@ static const VMFunction ToAsyncIterInfo 
 
 void
 CodeGenerator::visitToAsyncIter(LToAsyncIter* lir)
 {
     pushArg(ToRegister(lir->unwrapped()));
     callVM(ToAsyncIterInfo, lir);
 }
 
-typedef bool (*ToIdFn)(JSContext*, HandleScript, jsbytecode*, HandleValue,
-                       MutableHandleValue);
+typedef bool (*ToIdFn)(JSContext*, HandleValue, MutableHandleValue);
 static const VMFunction ToIdInfo = FunctionInfo<ToIdFn>(ToIdOperation, "ToIdOperation");
 
 void
 CodeGenerator::visitToIdV(LToIdV* lir)
 {
     Label notInt32;
     FloatRegister temp = ToFloatRegister(lir->tempFloat());
     const ValueOperand out = ToOutValue(lir);
     ValueOperand input = ToValue(lir, LToIdV::Input);
 
     OutOfLineCode* ool = oolCallVM(ToIdInfo, lir,
-                                   ArgList(ImmGCPtr(current->mir()->info().script()),
-                                           ImmPtr(lir->mir()->resumePoint()->pc()),
-                                           ToValue(lir, LToIdV::Input)),
+                                   ArgList(ToValue(lir, LToIdV::Input)),
                                    StoreValueTo(out));
 
     Register tag = masm.splitTagForTest(input);
 
     masm.branchTestInt32(Assembler::NotEqual, tag, &notInt32);
     masm.moveValue(input, out);
     masm.jump(ool->rejoin());
 
--- a/js/src/jit/IonCacheIRCompiler.cpp
+++ b/js/src/jit/IonCacheIRCompiler.cpp
@@ -2185,17 +2185,17 @@ IonCacheIRCompiler::emitLoadTypedObjectR
     TypedThingLayout layout = reader.typedThingLayout();
     uint32_t typeDescr = reader.typeDescrKey();
     uint32_t fieldOffset = int32StubField(reader.stubOffset());
 
     // Get the object's data pointer.
     LoadTypedThingData(masm, layout, obj, scratch1);
 
     Address fieldAddr(scratch1, fieldOffset);
-    emitLoadTypedObjectResultShared(fieldAddr, scratch2, layout, typeDescr, output);
+    emitLoadTypedObjectResultShared(fieldAddr, scratch2, typeDescr, output);
     return true;
 }
 
 bool
 IonCacheIRCompiler::emitTypeMonitorResult()
 {
     return emitReturnFromIC();
 }
--- a/js/src/jit/MCallOptimize.cpp
+++ b/js/src/jit/MCallOptimize.cpp
@@ -972,17 +972,17 @@ IonBuilder::inlineArraySlice(CallInfo& c
     } else if (clasp == &ArrayObject::class_) {
         MElements* elements = MElements::New(alloc(), obj);
         current->add(elements);
 
         end = MArrayLength::New(alloc(), elements);
         current->add(end->toInstruction());
     }
 
-    MArraySlice* ins = MArraySlice::New(alloc(), constraints(),
+    MArraySlice* ins = MArraySlice::New(alloc(),
                                         obj, begin, end,
                                         templateObj,
                                         templateObj->group()->initialHeap(constraints()));
     current->add(ins);
     current->push(ins);
 
     MOZ_TRY(resumeAfter(ins));
     MOZ_TRY(pushTypeBarrier(ins, getInlineReturnTypeSet(), BarrierKind::TypeSet));
--- a/js/src/jit/MIR.h
+++ b/js/src/jit/MIR.h
@@ -10107,18 +10107,17 @@ class MArrayPush
 // Array.prototype.slice on a dense array.
 class MArraySlice
   : public MTernaryInstruction,
     public MixPolicy<ObjectPolicy<0>, IntPolicy<1>, IntPolicy<2>>::Data
 {
     CompilerObject templateObj_;
     gc::InitialHeap initialHeap_;
 
-    MArraySlice(CompilerConstraintList* constraints, MDefinition* obj,
-                MDefinition* begin, MDefinition* end,
+    MArraySlice(MDefinition* obj, MDefinition* begin, MDefinition* end,
                 JSObject* templateObj, gc::InitialHeap initialHeap)
       : MTernaryInstruction(classOpcode, obj, begin, end),
         templateObj_(templateObj),
         initialHeap_(initialHeap)
     {
         setResultType(MIRType::Object);
     }
 
--- a/js/src/jit/SharedIC.cpp
+++ b/js/src/jit/SharedIC.cpp
@@ -1248,17 +1248,16 @@ ICBinaryArith_DoubleWithInt32::Compiler:
 //
 
 static bool
 DoUnaryArithFallback(JSContext* cx, void* payload, ICUnaryArith_Fallback* stub_,
                      HandleValue val, MutableHandleValue res)
 {
     SharedStubInfo info(cx, payload, stub_->icEntry());
     ICStubCompiler::Engine engine = info.engine();
-    HandleScript script = info.innerScript();
 
     // This fallback stub may trigger debug mode toggling.
     DebugModeOSRVolatileStub<ICUnaryArith_Fallback*> stub(engine, info.maybeFrame(), stub_);
 
     jsbytecode* pc = info.pc();
     JSOp op = JSOp(*pc);
     FallbackICSpew(cx, stub, "UnaryArith(%s)", CodeName[op]);
 
@@ -1266,17 +1265,17 @@ DoUnaryArithFallback(JSContext* cx, void
       case JSOP_BITNOT: {
         int32_t result;
         if (!BitNot(cx, val, &result))
             return false;
         res.setInt32(result);
         break;
       }
       case JSOP_NEG:
-        if (!NegOperation(cx, script, pc, val, res))
+        if (!NegOperation(cx, val, res))
             return false;
         break;
       default:
         MOZ_CRASH("Unexpected op");
     }
 
     // Check if debug mode toggling made the stub invalid.
     if (stub.invalid())
--- a/js/src/jit/VMFunctions.cpp
+++ b/js/src/jit/VMFunctions.cpp
@@ -1514,19 +1514,19 @@ ThrowBadDerivedReturn(JSContext* cx, Han
 
 bool
 BaselineThrowUninitializedThis(JSContext* cx, BaselineFrame* frame)
 {
     return ThrowUninitializedThis(cx, frame);
 }
 
 bool
-BaselineThrowInitializedThis(JSContext* cx, BaselineFrame* frame)
+BaselineThrowInitializedThis(JSContext* cx)
 {
-    return ThrowInitializedThis(cx, frame);
+    return ThrowInitializedThis(cx);
 }
 
 
 bool
 ThrowObjectCoercible(JSContext* cx, HandleValue v)
 {
     MOZ_ASSERT(v.isUndefined() || v.isNull());
     MOZ_ALWAYS_FALSE(ToObjectSlow(cx, v, true));
--- a/js/src/jit/VMFunctions.h
+++ b/js/src/jit/VMFunctions.h
@@ -883,17 +883,17 @@ ThrowRuntimeLexicalError(JSContext* cx, 
 
 MOZ_MUST_USE bool
 ThrowReadOnlyError(JSContext* cx, HandleObject obj, int32_t index);
 
 MOZ_MUST_USE bool
 BaselineThrowUninitializedThis(JSContext* cx, BaselineFrame* frame);
 
 MOZ_MUST_USE bool
-BaselineThrowInitializedThis(JSContext* cx, BaselineFrame* frame);
+BaselineThrowInitializedThis(JSContext* cx);
 
 MOZ_MUST_USE bool
 ThrowBadDerivedReturn(JSContext* cx, HandleValue v);
 
 MOZ_MUST_USE bool
 ThrowObjectCoercible(JSContext* cx, HandleValue v);
 
 MOZ_MUST_USE bool
--- a/js/src/jsapi.cpp
+++ b/js/src/jsapi.cpp
@@ -6643,17 +6643,17 @@ JS_SetRegExpInput(JSContext* cx, HandleO
     CHECK_REQUEST(cx);
     assertSameCompartment(cx, input);
 
     Handle<GlobalObject*> global = obj.as<GlobalObject>();
     RegExpStatics* res = GlobalObject::getRegExpStatics(cx, global);
     if (!res)
         return false;
 
-    res->reset(cx, input);
+    res->reset(input);
     return true;
 }
 
 JS_PUBLIC_API(bool)
 JS_ClearRegExpStatics(JSContext* cx, HandleObject obj)
 {
     AssertHeapIsIdle();
     CHECK_REQUEST(cx);
--- a/js/src/jscompartment.cpp
+++ b/js/src/jscompartment.cpp
@@ -62,17 +62,17 @@ JSCompartment::JSCompartment(Zone* zone,
     global_(nullptr),
     enterCompartmentDepth(0),
     globalHolds(0),
     performanceMonitoring(runtime_),
     data(nullptr),
     realmData(nullptr),
     allocationMetadataBuilder(nullptr),
     lastAnimationTime(0),
-    regExps(zone),
+    regExps(),
     globalWriteBarriered(0),
     detachedTypedObjects(0),
     objectMetadataState(ImmediateMetadata()),
     selfHostingScriptSource(nullptr),
     objectMetadataTable(nullptr),
     innerViews(zone),
     lazyArrayBuffers(nullptr),
     wasm(zone),
@@ -869,25 +869,24 @@ JSCompartment::sweepJitCompartment(FreeO
 void
 JSCompartment::sweepRegExps()
 {
     /*
      * JIT code increments activeWarmUpCounter for any RegExpShared used by jit
      * code for the lifetime of the JIT script. Thus, we must perform
      * sweeping after clearing jit code.
      */
-    regExps.sweep(runtimeFromAnyThread());
+    regExps.sweep();
 }
 
 void
 JSCompartment::sweepDebugEnvironments()
 {
-    JSRuntime* rt = runtimeFromAnyThread();
     if (debugEnvs)
-        debugEnvs->sweep(rt);
+        debugEnvs->sweep();
 }
 
 void
 JSCompartment::sweepNativeIterators()
 {
     /* Sweep list of native iterators. */
     NativeIterator* ni = enumerators->next();
     while (ni != enumerators) {
--- a/js/src/jscompartment.h
+++ b/js/src/jscompartment.h
@@ -822,19 +822,16 @@ struct JSCompartment
 
     // The realm's [[TemplateMap]], used for mapping template literals to
     // unique template objects used in evaluation of tagged template literals.
     //
     // See ES 12.2.9.3.
     js::TemplateRegistry templateLiteralMap_;
 
   public:
-    /* During GC, stores the index of this compartment in rt->compartments. */
-    unsigned                     gcIndex;
-
     /*
      * During GC, stores the head of a list of incoming pointers from gray cells.
      *
      * The objects in the list are either cross-compartment wrappers, or
      * debugger wrapper objects.  The list link is either in the second extra
      * slot for the former, or a special slot for the latter.
      */
     JSObject*                    gcIncomingGrayPointers;
--- a/js/src/jsdtoa.cpp
+++ b/js/src/jsdtoa.cpp
@@ -68,23 +68,19 @@ static inline void dtoa_free(void* p)
 static const uint8_t dtoaModes[] = {
     0,   /* DTOSTR_STANDARD */
     0,   /* DTOSTR_STANDARD_EXPONENTIAL, */
     3,   /* DTOSTR_FIXED, */
     2,   /* DTOSTR_EXPONENTIAL, */
     2};  /* DTOSTR_PRECISION */
 
 double
-js_strtod_harder(DtoaState* state, const char* s00, char** se, int* err)
+js_strtod_harder(DtoaState* state, const char* s00, char** se)
 {
-    double retval;
-    if (err)
-        *err = 0;
-    retval = _strtod(state, s00, se);
-    return retval;
+    return _strtod(state, s00, se);
 }
 
 char*
 js_dtostr(DtoaState* state, char* buffer, size_t bufferSize, JSDToStrMode mode, int precision,
           double dinput)
 {
     U d;
     int decPt;        /* Offset of decimal point from first digit */
--- a/js/src/jsdtoa.h
+++ b/js/src/jsdtoa.h
@@ -31,22 +31,19 @@ DestroyDtoaState(DtoaState* state);
  * value represented by the character string pointed to by s00. The string is
  * scanned up to the first unrecognized character.
  *
  * If se is not nullptr, *se receives a pointer to the character terminating
  * the scan. If no number can be formed, *se receives a pointer to the first
  * unparseable character in s00, and zero is returned.
  *
  * On overflow, this function returns infinity and does not indicate an error.
- *
- * *err is set to zero on success; it's set to JS_DTOA_ENOMEM on memory failure.
  */
-#define JS_DTOA_ENOMEM 2
 double
-js_strtod_harder(DtoaState* state, const char* s00, char** se, int* err);
+js_strtod_harder(DtoaState* state, const char* s00, char** se);
 
 /*
  * Modes for converting floating-point numbers to strings.
  *
  * Some of the modes can round-trip; this means that if the number is converted to
  * a string using one of these mode and then converted back to a number, the result
  * will be identical to the original number (except that, due to ECMA, -0 will get converted
  * to +0).  These round-trip modes return the minimum number of significand digits that
--- a/js/src/jsnum.cpp
+++ b/js/src/jsnum.cpp
@@ -89,22 +89,17 @@ ComputeAccurateDecimalInteger(JSContext*
         cstr[i] = c;
     }
     cstr[length] = 0;
 
     if (!EnsureDtoaState(cx))
         return false;
 
     char* estr;
-    int err = 0;
-    *dp = js_strtod_harder(cx->dtoaState, cstr, &estr, &err);
-    if (err == JS_DTOA_ENOMEM) {
-        ReportOutOfMemory(cx);
-        return false;
-    }
+    *dp = js_strtod_harder(cx->dtoaState, cstr, &estr);
 
     return true;
 }
 
 namespace {
 
 template <typename CharT>
 class BinaryDigitReader
@@ -1841,19 +1836,18 @@ js_strtod(JSContext* cx, const CharT* be
             return true;
         }
     }
 
     if (!EnsureDtoaState(cx))
         return false;
 
     /* Everything else. */
-    int err;
     char* ep;
-    *d = js_strtod_harder(cx->dtoaState, chars.begin(), &ep, &err);
+    *d = js_strtod_harder(cx->dtoaState, chars.begin(), &ep);
 
     MOZ_ASSERT(ep >= chars.begin());
 
     if (ep == chars.begin())
         *dEnd = begin;
     else
         *dEnd = s + (ep - chars.begin());
 
--- a/js/src/vm/EnvironmentObject.cpp
+++ b/js/src/vm/EnvironmentObject.cpp
@@ -2435,17 +2435,17 @@ DebugEnvironments::init()
 
 void
 DebugEnvironments::trace(JSTracer* trc)
 {
     proxiedEnvs.trace(trc);
 }
 
 void
-DebugEnvironments::sweep(JSRuntime* rt)
+DebugEnvironments::sweep()
 {
     /*
      * missingEnvs points to debug envs weakly so that debug envs can be
      * released more eagerly.
      */
     for (MissingEnvironmentMap::Enum e(missingEnvs); !e.empty(); e.popFront()) {
         if (IsAboutToBeFinalized(&e.front().value())) {
             /*
--- a/js/src/vm/EnvironmentObject.h
+++ b/js/src/vm/EnvironmentObject.h
@@ -980,17 +980,17 @@ class DebugEnvironments
 
     static DebugEnvironments* ensureCompartmentData(JSContext* cx);
 
     template <typename Environment, typename Scope>
     static void onPopGeneric(JSContext* cx, const EnvironmentIter& ei);
 
   public:
     void trace(JSTracer* trc);
-    void sweep(JSRuntime* rt);
+    void sweep();
     void finish();
 #ifdef JS_GC_ZEAL
     void checkHashTablesAfterMovingGC(JSRuntime* rt);
 #endif
 
     // If a live frame has a synthesized entry in missingEnvs, make sure it's not
     // collected.
     void traceLiveFrame(JSTracer* trc, AbstractFramePtr frame);
--- a/js/src/vm/Interpreter-inl.h
+++ b/js/src/vm/Interpreter-inl.h
@@ -442,18 +442,17 @@ DefVarOperation(JSContext* cx, HandleObj
         if (!varobj->compartment()->addToVarNames(cx, dn))
             return false;
     }
 
     return true;
 }
 
 static MOZ_ALWAYS_INLINE bool
-NegOperation(JSContext* cx, HandleScript script, jsbytecode* pc, HandleValue val,
-             MutableHandleValue res)
+NegOperation(JSContext* cx, HandleValue val, MutableHandleValue res)
 {
     /*
      * When the operand is int jsval, INT32_FITS_IN_JSVAL(i) implies
      * INT32_FITS_IN_JSVAL(-i) unless i is 0 or INT32_MIN when the
      * results, -0.0 or INT32_MAX + 1, are double values.
      */
     int32_t i;
     if (val.isInt32() && (i = val.toInt32()) != 0 && i != INT32_MIN) {
@@ -464,18 +463,17 @@ NegOperation(JSContext* cx, HandleScript
             return false;
         res.setNumber(-d);
     }
 
     return true;
 }
 
 static MOZ_ALWAYS_INLINE bool
-ToIdOperation(JSContext* cx, HandleScript script, jsbytecode* pc, HandleValue idval,
-              MutableHandleValue res)
+ToIdOperation(JSContext* cx, HandleValue idval, MutableHandleValue res)
 {
     if (idval.isInt32()) {
         res.set(idval);
         return true;
     }
 
     RootedId id(cx);
     if (!ToPropertyKey(cx, idval, &id))
--- a/js/src/vm/Interpreter.cpp
+++ b/js/src/vm/Interpreter.cpp
@@ -2645,17 +2645,17 @@ CASE(JSOP_BITNOT)
     REGS.sp[-1].setInt32(i);
 }
 END_CASE(JSOP_BITNOT)
 
 CASE(JSOP_NEG)
 {
     ReservedRooted<Value> val(&rootValue0, REGS.sp[-1]);
     MutableHandleValue res = REGS.stackHandleAt(-1);
-    if (!NegOperation(cx, script, REGS.pc, val, res))
+    if (!NegOperation(cx, val, res))
         goto error;
 }
 END_CASE(JSOP_NEG)
 
 CASE(JSOP_POS)
     if (!ToNumber(cx, REGS.stackHandleAt(-1)))
         goto error;
 END_CASE(JSOP_POS)
@@ -2725,17 +2725,17 @@ CASE(JSOP_TOID)
 {
     /*
      * Increment or decrement requires use to lookup the same property twice,
      * but we need to avoid the observable stringification the second time.
      * There must be an object value below the id, which will not be popped.
      */
     ReservedRooted<Value> idval(&rootValue1, REGS.sp[-1]);
     MutableHandleValue res = REGS.stackHandleAt(-1);
-    if (!ToIdOperation(cx, script, REGS.pc, idval, res))
+    if (!ToIdOperation(cx, idval, res))
         goto error;
 }
 END_CASE(JSOP_TOID)
 
 CASE(JSOP_TYPEOFEXPR)
 CASE(JSOP_TYPEOF)
 {
     REGS.sp[-1].setString(TypeOfOperation(REGS.sp[-1], cx->runtime()));
@@ -2788,17 +2788,17 @@ CASE(JSOP_CHECKTHIS)
         goto error;
     }
 }
 END_CASE(JSOP_CHECKTHIS)
 
 CASE(JSOP_CHECKTHISREINIT)
 {
     if (!REGS.sp[-1].isMagic(JS_UNINITIALIZED_LEXICAL)) {
-        MOZ_ALWAYS_FALSE(ThrowInitializedThis(cx, REGS.fp()));
+        MOZ_ALWAYS_FALSE(ThrowInitializedThis(cx));
         goto error;
     }
 }
 END_CASE(JSOP_CHECKTHISREINIT)
 
 CASE(JSOP_CHECKRETURN)
 {
     if (!REGS.fp()->checkReturn(cx, REGS.stackHandleAt(-1)))
@@ -5251,17 +5251,17 @@ js::SuperFunOperation(JSContext* cx, Han
         ReportIsNotFunction(cx, superFunVal, JSDVG_IGNORE_STACK, CONSTRUCT);
         return nullptr;
     }
 
     return superFun;
 }
 
 bool
-js::ThrowInitializedThis(JSContext* cx, AbstractFramePtr frame)
+js::ThrowInitializedThis(JSContext* cx)
 {
     JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, JSMSG_REINIT_THIS);
     return false;
 }
 
 bool
 js::SetPropertySuper(JSContext* cx, HandleObject obj, HandleValue receiver,
                      HandlePropertyName name, HandleValue rval, bool strict)
--- a/js/src/vm/Interpreter.h
+++ b/js/src/vm/Interpreter.h
@@ -578,17 +578,17 @@ enum class CheckIsCallableKind : uint8_t
 
 bool
 ThrowCheckIsCallable(JSContext* cx, CheckIsCallableKind kind);
 
 bool
 ThrowUninitializedThis(JSContext* cx, AbstractFramePtr frame);
 
 bool
-ThrowInitializedThis(JSContext* cx, AbstractFramePtr frame);
+ThrowInitializedThis(JSContext* cx);
 
 bool
 DefaultClassConstructor(JSContext* cx, unsigned argc, Value* vp);
 
 bool
 Debug_CheckSelfHosted(JSContext* cx, HandleValue v);
 
 bool
--- a/js/src/vm/NativeObject-inl.h
+++ b/js/src/vm/NativeObject-inl.h
@@ -275,18 +275,17 @@ NativeObject::moveDenseElementsNoPreBarr
     MOZ_ASSERT(!denseElementsAreCopyOnWrite());
     MOZ_ASSERT(!denseElementsAreFrozen());
 
     memmove(elements_ + dstStart, elements_ + srcStart, count * sizeof(HeapSlot));
     elementsRangeWriteBarrierPost(dstStart, count);
 }
 
 inline void
-NativeObject::ensureDenseInitializedLengthNoPackedCheck(JSContext* cx, uint32_t index,
-                                                        uint32_t extra)
+NativeObject::ensureDenseInitializedLengthNoPackedCheck(uint32_t index, uint32_t extra)
 {
     MOZ_ASSERT(!denseElementsAreCopyOnWrite());
     MOZ_ASSERT(!denseElementsAreFrozen());
 
     /*
      * Ensure that the array's contents have been initialized up to index, and
      * mark the elements through 'index + extra' as initialized in preparation
      * for a write.
@@ -307,17 +306,17 @@ NativeObject::ensureDenseInitializedLeng
     }
 }
 
 inline void
 NativeObject::ensureDenseInitializedLength(JSContext* cx, uint32_t index, uint32_t extra)
 {
     if (writeToIndexWouldMarkNotPacked(index))
         markDenseElementsNotPacked(cx);
-    ensureDenseInitializedLengthNoPackedCheck(cx, index, extra);
+    ensureDenseInitializedLengthNoPackedCheck(index, extra);
 }
 
 DenseElementResult
 NativeObject::extendDenseElements(JSContext* cx,
                                   uint32_t requiredCapacity, uint32_t extra)
 {
     MOZ_ASSERT(!denseElementsAreCopyOnWrite());
     MOZ_ASSERT(!denseElementsAreFrozen());
@@ -367,41 +366,41 @@ NativeObject::ensureDenseElements(JSCont
         return DenseElementResult::Failure;
 
     uint32_t currentCapacity = getDenseCapacity();
 
     uint32_t requiredCapacity;
     if (extra == 1) {
         /* Optimize for the common case. */
         if (index < currentCapacity) {
-            ensureDenseInitializedLengthNoPackedCheck(cx, index, 1);
+            ensureDenseInitializedLengthNoPackedCheck(index, 1);
             return DenseElementResult::Success;
         }
         requiredCapacity = index + 1;
         if (requiredCapacity == 0) {
             /* Overflow. */
             return DenseElementResult::Incomplete;
         }
     } else {
         requiredCapacity = index + extra;
         if (requiredCapacity < index) {
             /* Overflow. */
             return DenseElementResult::Incomplete;
         }
         if (requiredCapacity <= currentCapacity) {
-            ensureDenseInitializedLengthNoPackedCheck(cx, index, extra);
+            ensureDenseInitializedLengthNoPackedCheck(index, extra);
             return DenseElementResult::Success;
         }
     }
 
     DenseElementResult result = extendDenseElements(cx, requiredCapacity, extra);
     if (result != DenseElementResult::Success)
         return result;
 
-    ensureDenseInitializedLengthNoPackedCheck(cx, index, extra);
+    ensureDenseInitializedLengthNoPackedCheck(index, extra);
     return DenseElementResult::Success;
 }
 
 inline DenseElementResult
 NativeObject::setOrExtendDenseElements(JSContext* cx, uint32_t start, const Value* vp,
                                        uint32_t count,
                                        ShouldUpdateTypes updateTypes)
 {
--- a/js/src/vm/NativeObject.h
+++ b/js/src/vm/NativeObject.h
@@ -1169,18 +1169,17 @@ class NativeObject : public ShapedObject
 
     bool maybeCopyElementsForWrite(JSContext* cx) {
         if (denseElementsAreCopyOnWrite())
             return CopyElementsForWrite(cx, this);
         return true;
     }
 
   private:
-    inline void ensureDenseInitializedLengthNoPackedCheck(JSContext* cx,
-                                                          uint32_t index, uint32_t extra);
+    inline void ensureDenseInitializedLengthNoPackedCheck(uint32_t index, uint32_t extra);
 
     // Run a post write barrier that encompasses multiple contiguous elements in a
     // single step.
     inline void elementsRangeWriteBarrierPost(uint32_t start, uint32_t count);
 
     // See the comment over setDenseElementUnchecked, this applies in the same way.
     void setDenseInitializedLengthUnchecked(uint32_t length) {
         MOZ_ASSERT(length <= getDenseCapacity());
--- a/js/src/vm/RegExpObject.cpp
+++ b/js/src/vm/RegExpObject.cpp
@@ -1191,17 +1191,17 @@ RegExpShared::sizeOfExcludingThis(mozill
     for (size_t i = 0; i < tables.length(); i++)
         n += mallocSizeOf(tables[i].get());
 
     return n;
 }
 
 /* RegExpCompartment */
 
-RegExpCompartment::RegExpCompartment(Zone* zone)
+RegExpCompartment::RegExpCompartment()
   : matchResultTemplateObject_(nullptr),
     optimizableRegExpPrototypeShape_(nullptr),
     optimizableRegExpInstanceShape_(nullptr)
 {}
 
 ArrayObject*
 RegExpCompartment::createMatchResultTemplateObject(JSContext* cx)
 {
@@ -1255,17 +1255,17 @@ RegExpZone::init()
 {
     if (!set_.init(0))
         return false;
 
     return true;
 }
 
 void
-RegExpCompartment::sweep(JSRuntime* rt)
+RegExpCompartment::sweep()
 {
     if (matchResultTemplateObject_ &&
         IsAboutToBeFinalized(&matchResultTemplateObject_))
     {
         matchResultTemplateObject_.set(nullptr);
     }
 
     if (optimizableRegExpPrototypeShape_ &&
--- a/js/src/vm/RegExpShared.h
+++ b/js/src/vm/RegExpShared.h
@@ -319,19 +319,19 @@ class RegExpCompartment
      *   * lastProperty is lastIndex
      *   * prototype is RegExp.prototype
      */
     ReadBarriered<Shape*> optimizableRegExpInstanceShape_;
 
     ArrayObject* createMatchResultTemplateObject(JSContext* cx);
 
   public:
-    explicit RegExpCompartment(Zone* zone);
+    explicit RegExpCompartment();
 
-    void sweep(JSRuntime* rt);
+    void sweep();
 
     /* Get or create template object used to base the result of .exec() on. */
     ArrayObject* getOrCreateMatchResultTemplateObject(JSContext* cx) {
         if (matchResultTemplateObject_)
             return matchResultTemplateObject_;
         return createMatchResultTemplateObject(cx);
     }
 
--- a/js/src/vm/RegExpStatics.h
+++ b/js/src/vm/RegExpStatics.h
@@ -63,17 +63,17 @@ class RegExpStatics
     /* Mutators. */
     inline void updateLazily(JSContext* cx, JSLinearString* input,
                              RegExpShared* shared, size_t lastIndex);
     inline bool updateFromMatchPairs(JSContext* cx, JSLinearString* input, MatchPairs& newPairs);
 
     inline void clear();
 
     /* Corresponds to JSAPI functionality to set the pending RegExp input. */
-    void reset(JSContext* cx, JSString* newInput) {
+    void reset(JSString* newInput) {
         clear();
         pendingInput = newInput;
         checkInvariants();
     }
 
     inline void setPendingInput(JSString* newInput);
 
   public:
--- a/js/src/vm/Runtime.cpp
+++ b/js/src/vm/Runtime.cpp
@@ -169,17 +169,17 @@ JSRuntime::JSRuntime(JSRuntime* parentRu
     jitSupportsUnalignedAccesses(false),
     jitSupportsSimd(false),
     offthreadIonCompilationEnabled_(true),
     parallelParsingEnabled_(true),
     autoWritableJitCodeActive_(false),
     oomCallback(nullptr),
     debuggerMallocSizeOf(ReturnZeroSize),
     lastAnimationTime(0),
-    performanceMonitoring_(thisFromCtor()),
+    performanceMonitoring_(),
     stackFormat_(parentRuntime ? js::StackFormat::Default
                                : js::StackFormat::SpiderMonkey)
 {
     liveRuntimesCount++;
 
     /* Initialize infallibly first, so we can goto bad and JS_DestroyRuntime. */
 
     PodZero(&asmJSCacheOps);
--- a/js/src/vm/Scope.cpp
+++ b/js/src/vm/Scope.cpp
@@ -123,17 +123,17 @@ static Shape*
 CreateEnvironmentShape(JSContext* cx, BindingIter& bi, const Class* cls,
                        uint32_t numSlots, uint32_t baseShapeFlags)
 {
     RootedShape shape(cx, EmptyEnvironmentShape(cx, cls, numSlots, baseShapeFlags));
     if (!shape)
         return nullptr;
 
     RootedAtom name(cx);
-    StackBaseShape stackBase(cx, cls, baseShapeFlags);
+    StackBaseShape stackBase(cls, baseShapeFlags);
     for (; bi; bi++) {
         BindingLocation loc = bi.location();
         if (loc.kind() == BindingLocation::Kind::Environment) {
             name = bi.name();
             cx->markAtom(name);
             shape = NextEnvironmentShape(cx, name, bi.kind(), loc.slot(), stackBase, shape);
             if (!shape)
                 return nullptr;
--- a/js/src/vm/Shape-inl.h
+++ b/js/src/vm/Shape-inl.h
@@ -33,17 +33,17 @@ AutoKeepShapeTables::AutoKeepShapeTables
 
 inline
 AutoKeepShapeTables::~AutoKeepShapeTables()
 {
     cx_->zone()->setKeepShapeTables(prev_);
 }
 
 inline
-StackBaseShape::StackBaseShape(JSContext* cx, const Class* clasp, uint32_t objectFlags)
+StackBaseShape::StackBaseShape(const Class* clasp, uint32_t objectFlags)
   : flags(objectFlags),
     clasp(clasp)
 {}
 
 MOZ_ALWAYS_INLINE Shape*
 Shape::search(JSContext* cx, jsid id)
 {
     return search(cx, this, id);
--- a/js/src/vm/Shape.cpp
+++ b/js/src/vm/Shape.cpp
@@ -2110,17 +2110,17 @@ EmptyShape::getInitialShape(JSContext* c
             shape = keyPointer.ref()->shape;
             MOZ_ASSERT(shape);
         } else {
             insertKey = true;
         }
     }
 
     if (!shape) {
-        StackBaseShape base(cx, clasp, objectFlags);
+        StackBaseShape base(clasp, objectFlags);
         Rooted<UnownedBaseShape*> nbase(cx, BaseShape::getUnowned(cx, base));
         if (!nbase)
             return nullptr;
 
         shape = EmptyShape::new_(cx, nbase, nfixed);
         if (!shape)
             return nullptr;
     }
--- a/js/src/vm/Shape.h
+++ b/js/src/vm/Shape.h
@@ -631,17 +631,17 @@ struct StackBaseShape : public DefaultHa
     uint32_t flags;
     const Class* clasp;
 
     explicit StackBaseShape(BaseShape* base)
       : flags(base->flags & BaseShape::OBJECT_FLAG_MASK),
         clasp(base->clasp_)
     {}
 
-    inline StackBaseShape(JSContext* cx, const Class* clasp, uint32_t objectFlags);
+    inline StackBaseShape(const Class* clasp, uint32_t objectFlags);
     explicit inline StackBaseShape(Shape* shape);
 
     struct Lookup
     {
         uint32_t flags;
         const Class* clasp;
 
         MOZ_IMPLICIT Lookup(const StackBaseShape& base)
--- a/js/src/vm/Stack-inl.h
+++ b/js/src/vm/Stack-inl.h
@@ -51,17 +51,17 @@ InterpreterFrame::varObj() const
 
 inline LexicalEnvironmentObject&
 InterpreterFrame::extensibleLexicalEnvironment() const
 {
     return NearestEnclosingExtensibleLexicalEnvironment(environmentChain());
 }
 
 inline void
-InterpreterFrame::initCallFrame(JSContext* cx, InterpreterFrame* prev, jsbytecode* prevpc,
+InterpreterFrame::initCallFrame(InterpreterFrame* prev, jsbytecode* prevpc,
                                 Value* prevsp, JSFunction& callee, JSScript* script, Value* argv,
                                 uint32_t nactual, MaybeConstruct constructing)
 {
     MOZ_ASSERT(callee.nonLazyScript() == script);
 
     /* Initialize stack frame members. */
     flags_ = 0;
     if (constructing)
@@ -305,17 +305,17 @@ InterpreterStack::pushInlineFrame(JSCont
     Value* argv;
     InterpreterFrame* fp = getCallFrame(cx, args, script, constructing, &argv);
     if (!fp)
         return false;
 
     fp->mark_ = mark;
 
     /* Initialize frame, locals, regs. */
-    fp->initCallFrame(cx, prev, prevpc, prevsp, *callee, script, argv, args.length(),
+    fp->initCallFrame(prev, prevpc, prevsp, *callee, script, argv, args.length(),
                       constructing);
 
     regs.prepareToRun(*fp, script);
     return true;
 }
 
 MOZ_ALWAYS_INLINE bool
 InterpreterStack::resumeGeneratorCallFrame(JSContext* cx, InterpreterRegs& regs,
@@ -347,17 +347,17 @@ InterpreterStack::resumeGeneratorCallFra
     argv[-2] = ObjectValue(*callee);
     argv[-1] = UndefinedValue();
     SetValueRangeToUndefined(argv, nformal);
     if (constructing)
         argv[nformal] = newTarget;
 
     InterpreterFrame* fp = reinterpret_cast<InterpreterFrame*>(argv + nformal + constructing);
     fp->mark_ = mark;
-    fp->initCallFrame(cx, prev, prevpc, prevsp, *callee, script, argv, 0, constructing);
+    fp->initCallFrame(prev, prevpc, prevsp, *callee, script, argv, 0, constructing);
     fp->resumeGeneratorFrame(envChain);
 
     regs.prepareToRun(*fp, script);
     return true;
 }
 
 MOZ_ALWAYS_INLINE void
 InterpreterStack::popInlineFrame(InterpreterRegs& regs)
--- a/js/src/vm/Stack.cpp
+++ b/js/src/vm/Stack.cpp
@@ -440,17 +440,17 @@ InterpreterStack::pushInvokeFrame(JSCont
     RootedScript script(cx, fun->nonLazyScript());
 
     Value* argv;
     InterpreterFrame* fp = getCallFrame(cx, args, script, constructing, &argv);
     if (!fp)
         return nullptr;
 
     fp->mark_ = mark;
-    fp->initCallFrame(cx, nullptr, nullptr, nullptr, *fun, script, argv, args.length(),
+    fp->initCallFrame(nullptr, nullptr, nullptr, *fun, script, argv, args.length(),
                       constructing);
     return fp;
 }
 
 InterpreterFrame*
 InterpreterStack::pushExecuteFrame(JSContext* cx, HandleScript script, const Value& newTargetValue,
                                    HandleObject envChain, AbstractFramePtr evalInFrame)
 {
--- a/js/src/vm/Stack.h
+++ b/js/src/vm/Stack.h
@@ -393,17 +393,17 @@ class InterpreterFrame
     friend class jit::BaselineFrame;
 
     /*
      * Frame initialization, called by InterpreterStack operations after acquiring
      * the raw memory for the frame:
      */
 
     /* Used for Invoke and Interpret. */
-    void initCallFrame(JSContext* cx, InterpreterFrame* prev, jsbytecode* prevpc, Value* prevsp,
+    void initCallFrame(InterpreterFrame* prev, jsbytecode* prevpc, Value* prevsp,
                        JSFunction& callee, JSScript* script, Value* argv, uint32_t nactual,
                        MaybeConstruct constructing);
 
     /* Used for global and eval frames. */
     void initExecuteFrame(JSContext* cx, HandleScript script, AbstractFramePtr prev,
                           const Value& newTargetValue, HandleObject envChain);
 
   public:
--- a/js/src/vm/Stopwatch.h
+++ b/js/src/vm/Stopwatch.h
@@ -66,17 +66,17 @@ struct PerformanceGroupHolder {
 struct PerformanceMonitoring {
     /**
      * The number of the current iteration of the event loop.
      */
     uint64_t iteration() {
         return iteration_;
     }
 
-    explicit PerformanceMonitoring(JSRuntime* runtime)
+    explicit PerformanceMonitoring()
       : totalCPOWTime(0)
       , stopwatchStartCallback(nullptr)
       , stopwatchStartClosure(nullptr)
       , stopwatchCommitCallback(nullptr)
       , stopwatchCommitClosure(nullptr)
       , getGroupsCallback(nullptr)
       , getGroupsClosure(nullptr)
       , isMonitoringJank_(false)
--- a/js/src/vm/StructuredClone.cpp
+++ b/js/src/vm/StructuredClone.cpp
@@ -1347,17 +1347,17 @@ bool
 JSStructuredCloneWriter::traverseMap(HandleObject obj)
 {
     Rooted<GCVector<Value>> newEntries(context(), GCVector<Value>(context()));
     {
         // If there is no wrapper, the compartment munging is a no-op.
         RootedObject unwrapped(context(), CheckedUnwrap(obj));
         MOZ_ASSERT(unwrapped);
         JSAutoCompartment ac(context(), unwrapped);
-        if (!MapObject::getKeysAndValuesInterleaved(context(), unwrapped, &newEntries))
+        if (!MapObject::getKeysAndValuesInterleaved(unwrapped, &newEntries))
             return false;
     }
     if (!context()->compartment()->wrap(context(), &newEntries))
         return false;
 
     for (size_t i = newEntries.length(); i > 0; --i) {
         if (!entries.append(newEntries[i - 1]))
             return false;
--- a/js/src/wasm/WasmTextToBinary.cpp
+++ b/js/src/wasm/WasmTextToBinary.cpp
@@ -2150,19 +2150,18 @@ ParseFloatLiteral(WasmParseContext& c, W
         LifoAlloc::Mark mark = c.lifo.mark();
         char* buffer = c.lifo.newArray<char>(end - cur + 1);
         if (!buffer)
             return nullptr;
         for (ptrdiff_t i = 0; i < end - cur; ++i)
             buffer[i] = char(cur[i]);
         buffer[end - cur] = '\0';
         char* strtod_end;
-        int err;
-        result = (Float)js_strtod_harder(c.dtoaState, buffer, &strtod_end, &err);
-        if (err != 0 || strtod_end == buffer) {
+        result = (Float)js_strtod_harder(c.dtoaState, buffer, &strtod_end);
+        if (strtod_end == buffer) {
             c.lifo.release(mark);
             c.ts.generateError(token, c.error);
             return nullptr;
         }
         c.lifo.release(mark);
         break;
       }
     }