Bug 1569924 - Run ./mach clang-format -p js/src r=sfink
authorPaul Bone <pbone@mozilla.com>
Mon, 12 Aug 2019 03:27:23 +0000
changeset 487400 7434139de6062722110472a91f6718e7d380fcbe
parent 487399 c6e2e040e385d76318dfd0eb32c935ef3452da5e
child 487401 f719a2df1b9620b000575eb2ddb289988904f634
push id36420
push useraiakab@mozilla.com
push dateMon, 12 Aug 2019 09:55:30 +0000
treeherdermozilla-central@f719a2df1b96 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssfink
bugs1569924
milestone70.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 1569924 - Run ./mach clang-format -p js/src r=sfink # ignore-this-changeset Differential Revision: https://phabricator.services.mozilla.com/D39987
js/src/debugger/DebugAPI-inl.h
js/src/debugger/DebugAPI.h
js/src/debugger/DebugScript.cpp
js/src/debugger/DebugScript.h
js/src/debugger/Debugger.cpp
js/src/debugger/Debugger.h
js/src/debugger/Frame.cpp
js/src/debugger/Object.cpp
js/src/debugger/Source.cpp
js/src/frontend/TryEmitter.cpp
js/src/gc/FreeOp.h
js/src/gc/GC.cpp
js/src/gc/Scheduling.h
js/src/vm/CompilationAndEvaluation.cpp
js/src/vm/EnvironmentObject.cpp
js/src/vm/Instrumentation.cpp
js/src/vm/Instrumentation.h
js/src/vm/Interpreter.cpp
js/src/vm/JSAtom.cpp
js/src/vm/JSFunction.cpp
js/src/vm/JSScript-inl.h
--- a/js/src/debugger/DebugAPI-inl.h
+++ b/js/src/debugger/DebugAPI-inl.h
@@ -42,18 +42,17 @@ void DebugAPI::onNewScript(JSContext* cx
   }
 
   if (script->realm()->isDebuggee()) {
     slowPathOnNewScript(cx, script);
   }
 }
 
 /* static */
-void DebugAPI::onNewGlobalObject(JSContext* cx,
-                                 Handle<GlobalObject*> global) {
+void DebugAPI::onNewGlobalObject(JSContext* cx, Handle<GlobalObject*> global) {
   MOZ_ASSERT(!global->realm()->firedOnNewGlobalObject);
 #ifdef DEBUG
   global->realm()->firedOnNewGlobalObject = true;
 #endif
   if (!cx->runtime()->onNewGlobalObjectWatchers().isEmpty()) {
     slowPathOnNewGlobalObject(cx, global);
   }
 }
@@ -175,11 +174,11 @@ void DebugAPI::onPromiseSettled(JSContex
 
 /* static */
 void DebugAPI::sweepBreakpoints(FreeOp* fop, JSScript* script) {
   if (script->hasDebugScript()) {
     sweepBreakpointsSlow(fop, script);
   }
 }
 
-} // namespace js
+}  // namespace js
 
 #endif /* debugger_DebugAPI_inl_h */
--- a/js/src/debugger/DebugAPI.h
+++ b/js/src/debugger/DebugAPI.h
@@ -336,18 +336,17 @@ class DebugAPI {
   // Get the GlobalObject::DebuggerVector for an object allocated by
   // newGlobalDebuggersObject.
   static GlobalObject::DebuggerVector* getGlobalDebuggers(JSObject* holder);
 
   /*
    * Get any instrumentation ID which has been associated with a script using
    * the specified debugger object.
    */
-  static bool getScriptInstrumentationId(JSContext* cx,
-                                         HandleObject dbgObject,
+  static bool getScriptInstrumentationId(JSContext* cx, HandleObject dbgObject,
                                          HandleScript script,
                                          MutableHandleValue rval);
 
  private:
   static bool stepModeEnabledSlow(JSScript* script);
   static bool hasBreakpointsAtSlow(JSScript* script, jsbytecode* pc);
   static void sweepBreakpointsSlow(FreeOp* fop, JSScript* script);
   static void slowPathOnNewScript(JSContext* cx, HandleScript script);
--- a/js/src/debugger/DebugScript.cpp
+++ b/js/src/debugger/DebugScript.cpp
@@ -142,18 +142,18 @@ void DebugScript::destroyBreakpointSite(
 
   debug->numSites--;
   if (!debug->needed()) {
     DebugAPI::destroyDebugScript(fop, script);
   }
 }
 
 /* static */
-void DebugScript::clearBreakpointsIn(FreeOp* fop, Realm* realm,
-                                     Debugger* dbg, JSObject* handler) {
+void DebugScript::clearBreakpointsIn(FreeOp* fop, Realm* realm, Debugger* dbg,
+                                     JSObject* handler) {
   for (auto script = realm->zone()->cellIter<JSScript>(); !script.done();
        script.next()) {
     if (script->realm() == realm && script->hasDebugScript()) {
       clearBreakpointsIn(fop, script, dbg, handler);
     }
   }
 }
 
@@ -179,17 +179,17 @@ void DebugScript::clearBreakpointsIn(Fre
   }
 }
 
 #ifdef DEBUG
 /* static */
 uint32_t DebugScript::getStepperCount(JSScript* script) {
   return script->hasDebugScript() ? get(script)->stepperCount : 0;
 }
-#endif // DEBUG
+#endif  // DEBUG
 
 /* static */
 bool DebugScript::incrementStepperCount(JSContext* cx, JSScript* script) {
   cx->check(script);
   MOZ_ASSERT(cx->realm()->isDebuggee());
 
   AutoRealm ar(cx, script);
 
@@ -288,17 +288,17 @@ void DebugAPI::destroyDebugScript(FreeOp
 void DebugAPI::checkDebugScriptAfterMovingGC(DebugScript* ds) {
   for (uint32_t i = 0; i < ds->numSites; i++) {
     BreakpointSite* site = ds->breakpoints[i];
     if (site && site->type() == BreakpointSite::Type::JS) {
       CheckGCThingAfterMovingGC(site->asJS()->script);
     }
   }
 }
-#endif // JSGC_HASH_TABLE_CHECKS
+#endif  // JSGC_HASH_TABLE_CHECKS
 
 /* static */
 void DebugAPI::sweepBreakpointsSlow(FreeOp* fop, JSScript* script) {
   bool scriptGone = IsAboutToBeFinalizedUnbarriered(&script);
   for (unsigned i = 0; i < script->length(); i++) {
     BreakpointSite* site =
         DebugScript::getBreakpointSite(script, script->offsetToPC(i));
     if (!site) {
@@ -310,20 +310,20 @@ void DebugAPI::sweepBreakpointsSlow(Free
       nextbp = bp->nextInSite();
       GCPtrNativeObject& dbgobj = bp->debugger->toJSObjectRef();
 
       // If we are sweeping, then we expect the script and the
       // debugger object to be swept in the same sweep group, except
       // if the breakpoint was added after we computed the sweep
       // groups. In this case both script and debugger object must be
       // live.
-      MOZ_ASSERT_IF(script->zone()->isGCSweeping() &&
-                    dbgobj->zone()->isCollecting(),
-                    dbgobj->zone()->isGCSweeping() ||
-                        (!scriptGone && dbgobj->asTenured().isMarkedAny()));
+      MOZ_ASSERT_IF(
+          script->zone()->isGCSweeping() && dbgobj->zone()->isCollecting(),
+          dbgobj->zone()->isGCSweeping() ||
+              (!scriptGone && dbgobj->asTenured().isMarkedAny()));
 
       bool dying = scriptGone || IsAboutToBeFinalized(&dbgobj);
       MOZ_ASSERT_IF(!dying, !IsAboutToBeFinalized(&bp->getHandlerRef()));
       if (dying) {
         bp->destroy(fop);
       }
     }
   }
@@ -335,9 +335,9 @@ bool DebugAPI::stepModeEnabledSlow(JSScr
 }
 
 /* static */
 bool DebugAPI::hasBreakpointsAtSlow(JSScript* script, jsbytecode* pc) {
   BreakpointSite* site = DebugScript::getBreakpointSite(script, pc);
   return site && site->enabledCount > 0;
 }
 
-} // namespace js
+}  // namespace js
--- a/js/src/debugger/DebugScript.h
+++ b/js/src/debugger/DebugScript.h
@@ -83,18 +83,18 @@ class DebugScript {
   static BreakpointSite* getOrCreateBreakpointSite(JSContext* cx,
                                                    JSScript* script,
                                                    jsbytecode* pc);
   static void destroyBreakpointSite(FreeOp* fop, JSScript* script,
                                     jsbytecode* pc);
 
   static void clearBreakpointsIn(FreeOp* fop, JS::Realm* realm, Debugger* dbg,
                                  JSObject* handler);
-  static void clearBreakpointsIn(FreeOp* fop, JSScript* script,
-                                 Debugger* dbg, JSObject* handler);
+  static void clearBreakpointsIn(FreeOp* fop, JSScript* script, Debugger* dbg,
+                                 JSObject* handler);
 
 #ifdef DEBUG
   static uint32_t getStepperCount(JSScript* script);
 #endif
 
   /*
    * Increment or decrement the single-step count. If the count is non-zero
    * then the script is in single-step mode.
--- a/js/src/debugger/Debugger.cpp
+++ b/js/src/debugger/Debugger.cpp
@@ -526,35 +526,33 @@ DebuggerMemory& Debugger::memory() const
 static void GlobalDebuggerVectorHolder_finalize(FreeOp* fop, JSObject* obj) {
   MOZ_ASSERT(fop->maybeOnHelperThread());
   void* ptr = obj->as<NativeObject>().getPrivate();
   auto debuggers = static_cast<GlobalObject::DebuggerVector*>(ptr);
   fop->delete_(obj, debuggers, MemoryUse::GlobalDebuggerVector);
 }
 
 static const ClassOps GlobalDebuggerVectorHolder_classOps = {
-  nullptr,
-  nullptr,
-  nullptr,
-  nullptr,
-  nullptr,
-  nullptr,
-  GlobalDebuggerVectorHolder_finalize
-};
+    nullptr,
+    nullptr,
+    nullptr,
+    nullptr,
+    nullptr,
+    nullptr,
+    GlobalDebuggerVectorHolder_finalize};
 
 static const Class GlobalDebuggerVectorHolder_class = {
     "GlobalDebuggerVectorHolder",
     JSCLASS_HAS_PRIVATE | JSCLASS_BACKGROUND_FINALIZE,
     &GlobalDebuggerVectorHolder_classOps};
 
 /* static */
 JSObject* DebugAPI::newGlobalDebuggersHolder(JSContext* cx) {
-  NativeObject* obj =
-      NewNativeObjectWithGivenProto(cx, &GlobalDebuggerVectorHolder_class,
-                                    nullptr);
+  NativeObject* obj = NewNativeObjectWithGivenProto(
+      cx, &GlobalDebuggerVectorHolder_class, nullptr);
   if (!obj) {
     return nullptr;
   }
 
   GlobalObject::DebuggerVector* debuggers =
       cx->new_<GlobalObject::DebuggerVector>(cx->zone());
   if (!debuggers) {
     return nullptr;
@@ -659,18 +657,18 @@ bool Debugger::getFrame(JSContext* cx, c
       return false;
     }
   }
 
   result.set(&p->value()->as<DebuggerFrame>());
   return true;
 }
 
-static bool DebuggerExists(GlobalObject* global,
-                           const std::function<bool(Debugger* dbg)>& predicate) {
+static bool DebuggerExists(
+    GlobalObject* global, const std::function<bool(Debugger* dbg)>& predicate) {
   // The GC analysis can't determine that the predicate can't GC, so let it know
   // explicitly.
   JS::AutoSuppressGCAnalysis nogc;
 
   if (GlobalObject::DebuggerVector* debuggers = global->getDebuggers()) {
     for (auto p = debuggers->begin(); p != debuggers->end(); p++) {
       // Callbacks should not create new references to the debugger, so don't
       // use a barrier. This allows this method to be called during GC.
@@ -680,39 +678,36 @@ static bool DebuggerExists(GlobalObject*
     }
   }
   return false;
 }
 
 /* static */
 bool Debugger::hasLiveHook(GlobalObject* global, Hook which) {
   return DebuggerExists(global, [=](Debugger* dbg) {
-      return dbg->enabled && dbg->getHook(which);
-    });
+    return dbg->enabled && dbg->getHook(which);
+  });
 }
 
 /* static */
 bool DebugAPI::debuggerObservesAllExecution(GlobalObject* global) {
-  return DebuggerExists(global, [=](Debugger* dbg) {
-      return dbg->observesAllExecution();
-    });
+  return DebuggerExists(
+      global, [=](Debugger* dbg) { return dbg->observesAllExecution(); });
 }
 
 /* static */
 bool DebugAPI::debuggerObservesCoverage(GlobalObject* global) {
-  return DebuggerExists(global, [=](Debugger* dbg) {
-      return dbg->observesCoverage();
-    });
+  return DebuggerExists(global,
+                        [=](Debugger* dbg) { return dbg->observesCoverage(); });
 }
 
 /* static */
 bool DebugAPI::debuggerObservesAsmJS(GlobalObject* global) {
-  return DebuggerExists(global, [=](Debugger* dbg) {
-      return dbg->observesAsmJS();
-    });
+  return DebuggerExists(global,
+                        [=](Debugger* dbg) { return dbg->observesAsmJS(); });
 }
 
 /* static */
 bool DebugAPI::hasExceptionUnwindHook(GlobalObject* global) {
   return Debugger::hasLiveHook(global, Debugger::OnExceptionUnwind);
 }
 
 /* static */
@@ -1113,17 +1108,18 @@ ResumeMode DebugAPI::slowPathOnException
 
   // The Debugger API mustn't muck with frames from self-hosted scripts.
   if (frame.hasScript() && frame.script()->selfHosted()) {
     return ResumeMode::Continue;
   }
 
   RootedValue rval(cx);
   ResumeMode resumeMode = Debugger::dispatchHook(
-      cx, [](Debugger* dbg) -> bool {
+      cx,
+      [](Debugger* dbg) -> bool {
         return dbg->getHook(Debugger::OnExceptionUnwind);
       },
       [&](Debugger* dbg) -> ResumeMode {
         return dbg->fireExceptionUnwind(cx, &rval);
       });
 
   switch (resumeMode) {
     case ResumeMode::Continue:
@@ -2456,35 +2452,33 @@ ResumeMode DebugAPI::onSingleStep(JSCont
   if (iter.hasScript()) {
     uint32_t liveStepperCount = 0;
     uint32_t suspendedStepperCount = 0;
     JSScript* trappingScript = iter.script();
     GlobalObject* global = cx->global();
     if (GlobalObject::DebuggerVector* debuggers = global->getDebuggers()) {
       for (auto p = debuggers->begin(); p != debuggers->end(); p++) {
         Debugger* dbg = *p;
-        for (Debugger::FrameMap::Range r = dbg->frames.all();
-             !r.empty();
+        for (Debugger::FrameMap::Range r = dbg->frames.all(); !r.empty();
              r.popFront()) {
           AbstractFramePtr frame = r.front().key();
           NativeObject* frameobj = r.front().value();
           if (frame.isWasmDebugFrame()) {
             continue;
           }
           if (frame.script() == trappingScript &&
               !frameobj->getReservedSlot(DebuggerFrame::ONSTEP_HANDLER_SLOT)
                    .isUndefined()) {
             liveStepperCount++;
           }
         }
 
         // Also count hooks set on suspended generator frames.
         for (Debugger::GeneratorWeakMap::Range r = dbg->generatorFrames.all();
-             !r.empty();
-             r.popFront()) {
+             !r.empty(); r.popFront()) {
           AbstractGeneratorObject& genObj =
               r.front().key()->as<AbstractGeneratorObject>();
           DebuggerFrame& frameObj = r.front().value()->as<DebuggerFrame>();
           MOZ_ASSERT(&frameObj.unwrappedGenerator() == &genObj);
 
           // Live Debugger.Frames were already counted in dbg->frames loop.
           if (frameObj.isLive()) {
             continue;
@@ -2644,18 +2638,17 @@ void DebugAPI::slowPathOnNewGlobalObject
       }
     }
   }
   MOZ_ASSERT(!cx->isExceptionPending());
 }
 
 /* static */
 void DebugAPI::slowPathNotifyParticipatesInGC(
-    uint64_t majorGCNumber,
-    GlobalObject::DebuggerVector& dbgs) {
+    uint64_t majorGCNumber, GlobalObject::DebuggerVector& dbgs) {
   for (GlobalObject::DebuggerVector::Range r = dbgs.all(); !r.empty();
        r.popFront()) {
     if (!r.front().unbarrieredGet()->debuggeeIsBeingCollected(majorGCNumber)) {
 #ifdef DEBUG
       fprintf(stderr,
               "OOM while notifying observing Debuggers of a GC: The "
               "onGarbageCollection\n"
               "hook will not be fired for this GC for some Debuggers!\n");
@@ -3147,17 +3140,18 @@ static bool UpdateExecutionObservability
     }
   }
 
   return true;
 }
 
 /* static */
 bool Debugger::updateExecutionObservabilityOfScripts(
-    JSContext* cx, const DebugAPI::ExecutionObservableSet& obs, IsObserving observing) {
+    JSContext* cx, const DebugAPI::ExecutionObservableSet& obs,
+    IsObserving observing) {
   if (Zone* zone = obs.singleZone()) {
     return UpdateExecutionObservabilityOfScriptsInZone(cx, zone, obs,
                                                        observing);
   }
 
   typedef DebugAPI::ExecutionObservableSet::ZoneRange ZoneRange;
   for (ZoneRange r = obs.zones()->all(); !r.empty(); r.popFront()) {
     if (!UpdateExecutionObservabilityOfScriptsInZone(cx, r.front(), obs,
@@ -6173,18 +6167,18 @@ DebuggerScript* Debugger::wrapVariantRef
     } else {
       // If the JSScript doesn't have corresponding LazyScript, the script
       // is not lazifiable, and we can safely use JSScript as referent.
       obj = wrapVariantReferent(cx, scripts, referent);
     }
   } else if (referent.is<LazyScript*>()) {
     obj = wrapVariantReferent(cx, lazyScripts, referent);
   } else {
-        referent.template as<WasmInstanceObject*>();
-        obj = wrapVariantReferent(cx, wasmInstanceScripts, referent);
+    referent.template as<WasmInstanceObject*>();
+    obj = wrapVariantReferent(cx, wasmInstanceScripts, referent);
   }
   MOZ_ASSERT_IF(obj, obj->getReferent() == referent);
   return obj;
 }
 
 DebuggerScript* Debugger::wrapScript(JSContext* cx, HandleScript script) {
   Rooted<DebuggerScriptReferent> referent(cx, script.get());
   return wrapVariantReferent(cx, referent);
@@ -6372,20 +6366,18 @@ bool Debugger::replaceFrameGuts(JSContex
   removeToDebuggerFramesOnExit.release();
 
   return true;
 }
 
 /* static */
 bool DebugAPI::inFrameMaps(AbstractFramePtr frame) {
   bool foundAny = false;
-  Debugger::forEachDebuggerFrame(frame,
-                                 [&](DebuggerFrame* frameobj) {
-                                   foundAny = true;
-                                 });
+  Debugger::forEachDebuggerFrame(
+      frame, [&](DebuggerFrame* frameobj) { foundAny = true; });
   return foundAny;
 }
 
 /* static */
 void Debugger::removeFromFrameMapsAndClearBreakpointsIn(JSContext* cx,
                                                         AbstractFramePtr frame,
                                                         bool suspending) {
   forEachDebuggerFrame(frame, [&](DebuggerFrame* frameobj) {
--- a/js/src/debugger/Debugger.h
+++ b/js/src/debugger/Debugger.h
@@ -950,18 +950,18 @@ class Debugger : private mozilla::Linked
       JSContext* cx, AbstractFramePtr frame);
   static MOZ_MUST_USE bool ensureExecutionObservabilityOfRealm(
       JSContext* cx, JS::Realm* realm);
 
   static bool hookObservesAllExecution(Hook which);
 
   MOZ_MUST_USE bool updateObservesAllExecutionOnDebuggees(
       JSContext* cx, IsObserving observing);
-  MOZ_MUST_USE bool updateObservesCoverageOnDebuggees(
-      JSContext* cx, IsObserving observing);
+  MOZ_MUST_USE bool updateObservesCoverageOnDebuggees(JSContext* cx,
+                                                      IsObserving observing);
   void updateObservesAsmJSOnDebuggees(IsObserving observing);
 
   JSObject* getHook(Hook hook) const;
   bool hasAnyLiveHooks(JSRuntime* rt) const;
 
   static void slowPathPromiseHook(JSContext* cx, Hook hook,
                                   Handle<PromiseObject*> promise);
 
--- a/js/src/debugger/Frame.cpp
+++ b/js/src/debugger/Frame.cpp
@@ -401,17 +401,16 @@ void DebuggerFrame::clearGenerator(FreeO
 
 void DebuggerFrame::clearGenerator(
     FreeOp* fop, Debugger* owner,
     Debugger::GeneratorWeakMap::Enum* maybeGeneratorFramesEnum) {
   if (!hasGenerator()) {
     return;
   }
 
-
   // 2) generatorFrames must no longer map the AbstractGeneratorObject to the
   // DebuggerFrame.
   GeneratorInfo* info = generatorInfo();
   if (maybeGeneratorFramesEnum) {
     maybeGeneratorFramesEnum->removeFront();
   } else {
     owner->generatorFrames.remove(&info->unwrappedGenerator());
   }
--- a/js/src/debugger/Object.cpp
+++ b/js/src/debugger/Object.cpp
@@ -1259,17 +1259,17 @@ bool DebuggerObject::makeDebuggeeValueMe
 }
 
 /* static */
 bool DebuggerObject::makeDebuggeeNativeFunctionMethod(JSContext* cx,
                                                       unsigned argc,
                                                       Value* vp) {
   THIS_DEBUGOBJECT(cx, argc, vp, "makeDebuggeeNativeFunction", args, object);
   if (!args.requireAtLeast(
-           cx, "Debugger.Object.prototype.makeDebuggeeNativeFunction", 1)) {
+          cx, "Debugger.Object.prototype.makeDebuggeeNativeFunction", 1)) {
     return false;
   }
 
   return DebuggerObject::makeDebuggeeNativeFunction(cx, object, args[0],
                                                     args.rval());
 }
 
 /* static */
@@ -1299,18 +1299,18 @@ bool DebuggerObject::unwrapMethod(JSCont
   return true;
 }
 
 /* static */
 bool DebuggerObject::setInstrumentationMethod(JSContext* cx, unsigned argc,
                                               Value* vp) {
   THIS_DEBUGOBJECT(cx, argc, vp, "setInstrumentation", args, object);
 
-  if (!args.requireAtLeast(
-           cx, "Debugger.Object.prototype.setInstrumentation", 2)) {
+  if (!args.requireAtLeast(cx, "Debugger.Object.prototype.setInstrumentation",
+                           2)) {
     return false;
   }
 
   if (!DebuggerObject::requireGlobal(cx, object)) {
     return false;
   }
   RootedGlobalObject global(cx, &object->referent()->as<GlobalObject>());
 
@@ -1362,26 +1362,25 @@ bool DebuggerObject::setInstrumentationM
   }
 
   args.rval().setUndefined();
   return true;
 }
 
 /* static */
 bool DebuggerObject::setInstrumentationActiveMethod(JSContext* cx,
-                                                    unsigned argc,
-                                                    Value* vp) {
+                                                    unsigned argc, Value* vp) {
   THIS_DEBUGOBJECT(cx, argc, vp, "setInstrumentationActive", args, object);
 
   if (!DebuggerObject::requireGlobal(cx, object)) {
     return false;
   }
 
   if (!args.requireAtLeast(
-      cx, "Debugger.Object.prototype.setInstrumentationActive", 1)) {
+          cx, "Debugger.Object.prototype.setInstrumentationActive", 1)) {
     return false;
   }
 
   RootedGlobalObject global(cx, &object->referent()->as<GlobalObject>());
   bool active = ToBoolean(args[0]);
 
   {
     AutoRealm ar(cx, global);
--- a/js/src/debugger/Source.cpp
+++ b/js/src/debugger/Source.cpp
@@ -164,28 +164,29 @@ DebuggerSource* DebuggerSource::checkThi
     ReportValueError(cx, JSMSG_DEBUG_BAD_REFERENT, JSDVG_SEARCH_STACK,
                      args.thisv(), nullptr, refname);
     return nullptr;
   }
 
   return thisobj;
 }
 
-#define THIS_DEBUGSOURCE_REFERENT(cx, argc, vp, fnname, args, obj, referent)            \
-  CallArgs args = CallArgsFromVp(argc, vp);                                             \
-  RootedDebuggerSource obj(cx, DebuggerSource::check(cx, args.thisv(), fnname));        \
-  if (!obj) return false;                                                               \
+#define THIS_DEBUGSOURCE_REFERENT(cx, argc, vp, fnname, args, obj, referent) \
+  CallArgs args = CallArgsFromVp(argc, vp);                                  \
+  RootedDebuggerSource obj(cx,                                               \
+                           DebuggerSource::check(cx, args.thisv(), fnname)); \
+  if (!obj) return false;                                                    \
   Rooted<DebuggerSourceReferent> referent(cx, obj->getReferent())
 
-#define THIS_DEBUGSOURCE_SOURCE(cx, argc, vp, fnname, args, obj, sourceObject)  \
-  CallArgs args = CallArgsFromVp(argc, vp);                                     \
-  RootedDebuggerSource obj(cx, DebuggerSource::checkThis<ScriptSourceObject*>(  \
-                                   cx, args, fnname, "a JS source"));           \
-  if (!obj) return false;                                                       \
-  RootedScriptSourceObject sourceObject(                                        \
+#define THIS_DEBUGSOURCE_SOURCE(cx, argc, vp, fnname, args, obj, sourceObject) \
+  CallArgs args = CallArgsFromVp(argc, vp);                                    \
+  RootedDebuggerSource obj(cx, DebuggerSource::checkThis<ScriptSourceObject*>( \
+                                   cx, args, fnname, "a JS source"));          \
+  if (!obj) return false;                                                      \
+  RootedScriptSourceObject sourceObject(                                       \
       cx, obj->getReferent().as<ScriptSourceObject*>())
 
 class DebuggerSourceGetTextMatcher {
   JSContext* cx_;
 
  public:
   explicit DebuggerSourceGetTextMatcher(JSContext* cx) : cx_(cx) {}
 
--- a/js/src/frontend/TryEmitter.cpp
+++ b/js/src/frontend/TryEmitter.cpp
@@ -306,14 +306,13 @@ bool TryEmitter::emitEnd() {
   return true;
 }
 
 bool TryEmitter::instrumentEntryPoint() {
   // Frames for async functions can resume execution at catch or finally blocks
   // if an await operation threw an exception. While the frame might already be
   // on the stack, the Entry instrumentation kind only indicates that a new
   // frame *might* have been pushed.
-  if (bce_->sc->isFunctionBox() &&
-      bce_->sc->asFunctionBox()->isAsync()) {
+  if (bce_->sc->isFunctionBox() && bce_->sc->asFunctionBox()->isAsync()) {
     return bce_->emitInstrumentation(InstrumentationKind::Entry);
   }
   return true;
 }
--- a/js/src/gc/FreeOp.h
+++ b/js/src/gc/FreeOp.h
@@ -17,17 +17,17 @@
 #include "js/Vector.h"                // js::Vector
 
 struct JSRuntime;
 
 namespace js {
 
 namespace gc {
 class AutoSetThreadIsPerformingGC;
-} // namespace gc
+}  // namespace gc
 
 /*
  * A FreeOp can do one thing: free memory. For convenience, it has delete_
  * convenience methods that also call destructors.
  *
  * FreeOp is passed to finalizers and other sweep-phase hooks so that we do not
  * need to pass a JSContext to those hooks.
  */
--- a/js/src/gc/GC.cpp
+++ b/js/src/gc/GC.cpp
@@ -2134,18 +2134,18 @@ size_t ZoneHeapThreshold::computeZoneTri
 
 void ZoneHeapThreshold::updateAfterGC(size_t lastBytes,
                                       JSGCInvocationKind gckind,
                                       const GCSchedulingTunables& tunables,
                                       const GCSchedulingState& state,
                                       const AutoLockGC& lock) {
   float growthFactor =
       computeZoneHeapGrowthFactorForHeapSize(lastBytes, tunables, state);
-  gcTriggerBytes_ = computeZoneTriggerBytes(growthFactor, lastBytes, gckind,
-                                            tunables, lock);
+  gcTriggerBytes_ =
+      computeZoneTriggerBytes(growthFactor, lastBytes, gckind, tunables, lock);
 }
 
 /* static */
 size_t ZoneMallocThreshold::computeZoneTriggerBytes(float growthFactor,
                                                     size_t lastBytes,
                                                     size_t baseBytes,
                                                     const AutoLockGC& lock) {
   return size_t(float(Max(lastBytes, baseBytes)) * growthFactor);
--- a/js/src/gc/Scheduling.h
+++ b/js/src/gc/Scheduling.h
@@ -157,18 +157,19 @@
  *      This occurs if we allocate too much before returning to the event loop
  *      and calling maybeGC; this is extremely common in benchmarks and
  *      long-running Worker computations. Note that this uses a wildly
  *      different mechanism from the above in that it sets the interrupt flag
  *      and does the GC at the next loop head, before the next alloc, or
  *      maybeGC. The reason for this is that this check is made after the
  *      allocation and we cannot GC with an uninitialized thing in the heap.
  *
- *  11) Do an incremental, zonal GC with reason TOO_MUCH_MALLOC when the total amount
- *      of malloced memory is greater than the malloc trigger limit for the zone.
+ *  11) Do an incremental, zonal GC with reason TOO_MUCH_MALLOC when the total
+ * amount of malloced memory is greater than the malloc trigger limit for the
+ * zone.
  *
  *
  * Size Limitation Triggers Explanation
  * ------------------------------------
  *
  *  The GC internally is entirely unaware of the context of the execution of
  *  the mutator. It sees only:
  *
--- a/js/src/vm/CompilationAndEvaluation.cpp
+++ b/js/src/vm/CompilationAndEvaluation.cpp
@@ -29,17 +29,17 @@
 #include "js/Value.h"              // JS::Value
 #include "util/CompleteFile.h"     // js::FileContents, js::ReadCompleteFile
 #include "util/StringBuffer.h"     // js::StringBuffer
 #include "vm/EnvironmentObject.h"  // js::CreateNonSyntacticEnvironmentChain
 #include "vm/Interpreter.h"        // js::Execute
 #include "vm/JSContext.h"          // JSContext
 
 #include "debugger/DebugAPI-inl.h"  // js::DebugAPI
-#include "vm/JSContext-inl.h"  // JSContext::check
+#include "vm/JSContext-inl.h"       // JSContext::check
 
 using mozilla::Utf8Unit;
 
 using JS::CompileOptions;
 using JS::HandleObject;
 using JS::ReadOnlyCompileOptions;
 using JS::SourceOwnership;
 using JS::SourceText;
--- a/js/src/vm/EnvironmentObject.cpp
+++ b/js/src/vm/EnvironmentObject.cpp
@@ -15,30 +15,30 @@
 #include "vm/JSObject.h"
 #include "vm/ProxyObject.h"
 #include "vm/Realm.h"
 #include "vm/Shape.h"
 #include "vm/Xdr.h"
 #include "wasm/WasmInstance.h"
 
 #ifdef DEBUG
-#include "vm/BytecodeIterator.h"
-#include "vm/BytecodeLocation.h"
+#  include "vm/BytecodeIterator.h"
+#  include "vm/BytecodeLocation.h"
 #endif
 
 #include "gc/Marking-inl.h"
 #include "vm/JSAtom-inl.h"
 #include "vm/JSScript-inl.h"
 #include "vm/NativeObject-inl.h"
 #include "vm/Stack-inl.h"
 #include "vm/TypeInference-inl.h"
 
 #ifdef DEBUG
-#include "vm/BytecodeIterator-inl.h"
-#include "vm/BytecodeLocation-inl.h"
+#  include "vm/BytecodeIterator-inl.h"
+#  include "vm/BytecodeLocation-inl.h"
 #endif
 
 using namespace js;
 
 typedef Rooted<ArgumentsObject*> RootedArgumentsObject;
 typedef MutableHandle<ArgumentsObject*> MutableHandleArgumentsObject;
 
 /*****************************************************************************/
--- a/js/src/vm/Instrumentation.cpp
+++ b/js/src/vm/Instrumentation.cpp
@@ -42,64 +42,62 @@ void RealmInstrumentation::holderFinaliz
 
 /* static */
 void RealmInstrumentation::holderTrace(JSTracer* trc, JSObject* obj) {
   RealmInstrumentation* instrumentation = GetInstrumentation(obj);
   instrumentation->trace(trc);
 }
 
 static const ClassOps InstrumentationHolderClassOps = {
-  nullptr, /* addProperty */
-  nullptr, /* delProperty */
-  nullptr, /* enumerate */
-  nullptr, /* newEnumerate */
-  nullptr, /* resolve */
-  nullptr, /* mayResolve */
-  RealmInstrumentation::holderFinalize,
-  nullptr, /* call */
-  nullptr, /* hasInstance */
-  nullptr, /* construct */
-  RealmInstrumentation::holderTrace,
+    nullptr, /* addProperty */
+    nullptr, /* delProperty */
+    nullptr, /* enumerate */
+    nullptr, /* newEnumerate */
+    nullptr, /* resolve */
+    nullptr, /* mayResolve */
+    RealmInstrumentation::holderFinalize,
+    nullptr, /* call */
+    nullptr, /* hasInstance */
+    nullptr, /* construct */
+    RealmInstrumentation::holderTrace,
 };
 
 static const Class InstrumentationHolderClass = {
     "Instrumentation Holder",
     JSCLASS_HAS_RESERVED_SLOTS(ReservedSlotCount) | JSCLASS_FOREGROUND_FINALIZE,
-    &InstrumentationHolderClassOps, JS_NULL_CLASS_SPEC, JS_NULL_CLASS_EXT
-  };
+    &InstrumentationHolderClassOps, JS_NULL_CLASS_SPEC, JS_NULL_CLASS_EXT};
 
 static const char* instrumentationNames[] = {
 #define DEFINE_INSTRUMENTATION_STRING(_1, String, _2) String,
-  FOR_EACH_INSTRUMENTATION_KIND(DEFINE_INSTRUMENTATION_STRING)
+    FOR_EACH_INSTRUMENTATION_KIND(DEFINE_INSTRUMENTATION_STRING)
 #undef DEFINE_INSTRUMENTATION_STRING
 };
 
-static bool StringToInstrumentationKind(JSContext* cx,
-                                        HandleString str,
+static bool StringToInstrumentationKind(JSContext* cx, HandleString str,
                                         InstrumentationKind* result) {
   for (size_t i = 0; i < mozilla::ArrayLength(instrumentationNames); i++) {
     bool match;
     if (!JS_StringEqualsAscii(cx, str, instrumentationNames[i], &match)) {
       return false;
     }
     if (match) {
-      *result = (InstrumentationKind) (1 << i);
+      *result = (InstrumentationKind)(1 << i);
       return true;
     }
   }
 
   JS_ReportErrorASCII(cx, "Unknown instrumentation kind");
   return false;
 }
 
 /* static */
 JSAtom* RealmInstrumentation::getInstrumentationKindName(
     JSContext* cx, InstrumentationKind kind) {
   for (size_t i = 0; i < mozilla::ArrayLength(instrumentationNames); i++) {
-    if (kind == (InstrumentationKind) (1 << i)) {
+    if (kind == (InstrumentationKind)(1 << i)) {
       JSString* str = JS_AtomizeString(cx, instrumentationNames[i]);
       if (!str) {
         return nullptr;
       }
       return &str->asAtom();
     }
   }
   MOZ_CRASH("Unexpected instrumentation kind");
@@ -129,17 +127,17 @@ bool RealmInstrumentation::install(JSCon
 
   uint32_t kinds = 0;
   for (size_t i = 0; i < kindStrings.length(); i++) {
     HandleString str = kindStrings[i];
     InstrumentationKind kind;
     if (!StringToInstrumentationKind(cx, str, &kind)) {
       return false;
     }
-    kinds |= (uint32_t) kind;
+    kinds |= (uint32_t)kind;
   }
 
   Rooted<UniquePtr<RealmInstrumentation>> instrumentation(
       cx,
       MakeUnique<RealmInstrumentation>(cx->zone(), callback, dbgObject, kinds));
   if (!instrumentation) {
     ReportOutOfMemory(cx);
     return false;
@@ -155,18 +153,17 @@ bool RealmInstrumentation::install(JSCon
 
   global->setInstrumentationHolder(holder);
   return true;
 }
 
 /* static */
 bool RealmInstrumentation::setActive(JSContext* cx,
                                      Handle<GlobalObject*> global,
-                                     Debugger* dbg,
-                                     bool active) {
+                                     Debugger* dbg, bool active) {
   MOZ_ASSERT(global == cx->global());
 
   RootedObject holder(cx, global->getInstrumentationHolder());
   if (!holder) {
     JS_ReportErrorASCII(cx, "Global does not have instrumentation specified");
     return false;
   }
 
@@ -221,18 +218,17 @@ uint32_t RealmInstrumentation::getInstru
 
   RealmInstrumentation* instrumentation = GetInstrumentation(holder);
   return instrumentation->kinds;
 }
 
 /* static */
 bool RealmInstrumentation::getScriptId(JSContext* cx,
                                        Handle<GlobalObject*> global,
-                                       HandleScript script,
-                                       int32_t* id) {
+                                       HandleScript script, int32_t* id) {
   MOZ_ASSERT(global == cx->global());
   RootedObject holder(cx, global->getInstrumentationHolder());
   RealmInstrumentation* instrumentation = GetInstrumentation(holder);
 
   RootedObject dbgObject(cx, UncheckedUnwrap(instrumentation->dbgObject));
 
   if (IsDeadProxyObject(dbgObject)) {
     JS_ReportErrorASCII(cx, "Instrumentation debugger object is dead");
@@ -274,9 +270,9 @@ bool InstrumentationScriptIdOperation(JS
   return true;
 }
 
 bool GlobalHasInstrumentation(JSObject* global) {
   return global->is<js::GlobalObject>() &&
          global->as<js::GlobalObject>().getInstrumentationHolder();
 }
 
-} // namespace js
+}  // namespace js
--- a/js/src/vm/Instrumentation.h
+++ b/js/src/vm/Instrumentation.h
@@ -9,30 +9,30 @@
 
 #include "js/UniquePtr.h"
 #include "vm/GlobalObject.h"
 
 namespace js {
 
 // Logic related to instrumentation which can be performed in a realm.
 
-#define FOR_EACH_INSTRUMENTATION_KIND(MACRO) \
-  /* The main entry point of a script. */ \
-  MACRO(Main, "main", 1 << 0) \
+#define FOR_EACH_INSTRUMENTATION_KIND(MACRO)                                \
+  /* The main entry point of a script. */                                   \
+  MACRO(Main, "main", 1 << 0)                                               \
   /* Points other than the main entry point where a frame for the script */ \
-  /* might start executing. */ \
-  MACRO(Entry, "entry", 1 << 1) \
-  /* Points at which a script's frame will be popped or suspended. */ \
-  MACRO(Exit, "exit", 1 << 2) \
-  /* Breakpoint sites. */ \
-  MACRO(Breakpoint, "breakpoint", 1 << 3) \
-  /* Property access operations. */ \
-  MACRO(GetProperty, "getProperty", 1 << 4) \
-  MACRO(SetProperty, "setProperty", 1 << 5) \
-  MACRO(GetElement, "getElement", 1 << 6) \
+  /* might start executing. */                                              \
+  MACRO(Entry, "entry", 1 << 1)                                             \
+  /* Points at which a script's frame will be popped or suspended. */       \
+  MACRO(Exit, "exit", 1 << 2)                                               \
+  /* Breakpoint sites. */                                                   \
+  MACRO(Breakpoint, "breakpoint", 1 << 3)                                   \
+  /* Property access operations. */                                         \
+  MACRO(GetProperty, "getProperty", 1 << 4)                                 \
+  MACRO(SetProperty, "setProperty", 1 << 5)                                 \
+  MACRO(GetElement, "getElement", 1 << 6)                                   \
   MACRO(SetElement, "setElement", 1 << 7)
 
 // Points at which instrumentation can be added on the scripts in a realm.
 enum class InstrumentationKind {
 #define DEFINE_INSTRUMENTATION_ENUM(Name, _1, Value) Name = Value,
   FOR_EACH_INSTRUMENTATION_KIND(DEFINE_INSTRUMENTATION_ENUM)
 #undef DEFINE_INSTRUMENTATION_ENUM
 };
@@ -50,18 +50,17 @@ class RealmInstrumentation {
   uint32_t kinds = 0;
 
   // Whether instrumentation is currently active in the realm. This is an
   // int32_t so it can be directly accessed from JIT code.
   int32_t active = 0;
 
  public:
   static bool install(JSContext* cx, Handle<GlobalObject*> global,
-                      HandleObject callback,
-                      HandleObject dbgObject,
+                      HandleObject callback, HandleObject dbgObject,
                       Handle<StringVector> kinds);
 
   static JSObject* getCallback(GlobalObject* global);
 
   // Get the mask of operation kinds which should be instrumented.
   static uint32_t getInstrumentationKinds(GlobalObject* global);
 
   // Get the string name of an instrumentation kind.
@@ -94,17 +93,17 @@ enum class ShouldInstrument {
   Yes,
 };
 
 bool InstrumentationActiveOperation(JSContext* cx, MutableHandleValue rv);
 JSObject* InstrumentationCallbackOperation(JSContext* cx);
 bool InstrumentationScriptIdOperation(JSContext* cx, HandleScript script,
                                       MutableHandleValue rv);
 
-} // namespace js
+}  // namespace js
 
 namespace JS {
 
 template <>
 struct DeletePolicy<js::RealmInstrumentation>
     : public js::GCManagedDeletePolicy<js::RealmInstrumentation> {};
 
 } /* namespace JS */
--- a/js/src/vm/Interpreter.cpp
+++ b/js/src/vm/Interpreter.cpp
@@ -1788,22 +1788,23 @@ static MOZ_NEVER_INLINE JS_HAZ_JSNATIVE_
   JS_END_MACRO
 
 #define COUNT_COVERAGE()                              \
   JS_BEGIN_MACRO                                      \
     MOZ_ASSERT(BytecodeIsJumpTarget(JSOp(*REGS.pc))); \
     COUNT_COVERAGE_PC(REGS.pc);                       \
   JS_END_MACRO
 
-#define SET_SCRIPT(s)                                                       \
-  JS_BEGIN_MACRO                                                            \
-    script = (s);                                                           \
-    MOZ_ASSERT(cx->realm() == script->realm());                             \
-    if (DebugAPI::hasAnyBreakpointsOrStepMode(script) || script->hasScriptCounts()) \
-      activation.enableInterruptsUnconditionally();                         \
+#define SET_SCRIPT(s)                                    \
+  JS_BEGIN_MACRO                                         \
+    script = (s);                                        \
+    MOZ_ASSERT(cx->realm() == script->realm());          \
+    if (DebugAPI::hasAnyBreakpointsOrStepMode(script) || \
+        script->hasScriptCounts())                       \
+      activation.enableInterruptsUnconditionally();      \
   JS_END_MACRO
 
 #define SANITY_CHECKS()              \
   JS_BEGIN_MACRO                     \
     js::gc::MaybeVerifyBarriers(cx); \
   JS_END_MACRO
 
   gc::MaybeVerifyBarriers(cx, true);
--- a/js/src/vm/JSAtom.cpp
+++ b/js/src/vm/JSAtom.cpp
@@ -584,17 +584,18 @@ void AtomsTable::mergeAtomsAddedWhileSwe
                            r.front())) {
       oomUnsafe.crash("Adding atom from secondary table after sweep");
     }
   }
 
   js_delete(newAtoms);
 }
 
-bool AtomsTable::traceWeakIncrementally(JSTracer* trc, SweepIterator& atomsToSweep,
+bool AtomsTable::traceWeakIncrementally(JSTracer* trc,
+                                        SweepIterator& atomsToSweep,
                                         SliceBudget& budget) {
   // Sweep the table incrementally until we run out of work or budget.
   while (!atomsToSweep.empty()) {
     budget.step();
     if (budget.isOverBudget()) {
       return false;
     }
 
--- a/js/src/vm/JSFunction.cpp
+++ b/js/src/vm/JSFunction.cpp
@@ -575,18 +575,18 @@ XDRResult js::XDRInterpretedFunction(XDR
       script = fun->nonLazyScript();
     }
 
     if (fun->isSingleton()) {
       firstword |= HasSingletonType;
     }
 
     atom = fun->displayAtom();
-    flagsword =
-        (fun->nargs() << 16) | (fun->flags().toRaw() & ~FunctionFlags::NO_XDR_FLAGS);
+    flagsword = (fun->nargs() << 16) |
+                (fun->flags().toRaw() & ~FunctionFlags::NO_XDR_FLAGS);
 
     // The environment of any function which is not reused will always be
     // null, it is later defined when a function is cloned or reused to
     // mirror the scope chain.
     MOZ_ASSERT_IF(fun->isSingleton() && !((lazy && lazy->hasBeenCloned()) ||
                                           (script && script->hasBeenCloned())),
                   fun->environment() == nullptr);
   }
--- a/js/src/vm/JSScript-inl.h
+++ b/js/src/vm/JSScript-inl.h
@@ -178,17 +178,18 @@ inline void JSScript::setBaselineScript(
     AddCellMemory(this, baseline->allocBytes(), js::MemoryUse::BaselineScript);
   }
   resetWarmUpResetCounter();
   updateJitCodeRaw(fop->runtime());
 }
 
 inline void JSScript::clearBaselineScript(js::FreeOp* fop) {
   MOZ_ASSERT(hasBaselineScript());
-  fop->removeCellMemory(this, baseline->allocBytes(), js::MemoryUse::BaselineScript);
+  fop->removeCellMemory(this, baseline->allocBytes(),
+                        js::MemoryUse::BaselineScript);
   baseline = nullptr;
 }
 
 inline void JSScript::clearIonScript(js::FreeOp* fop) {
   MOZ_ASSERT(hasIonScript());
   fop->removeCellMemory(this, ion->allocBytes(), js::MemoryUse::IonScript);
   ion = nullptr;
 }