Bug 1508255 - Use |clang-format off| for some js/src comments r=jandem
authorTed Campbell <tcampbell@mozilla.com>
Tue, 20 Nov 2018 10:06:02 +0000
changeset 447233 c86b9e22b393d97c6d4e4dc0fc33bc6cd3c2172c
parent 447232 4b78e1686da9ba317be1796cf241db3231f9cb75
child 447234 cf2b7ca307b68da20bfdd196e8dc1a4e99e62a2d
push id73368
push usertcampbell@mozilla.com
push dateTue, 20 Nov 2018 15:22:26 +0000
treeherderautoland@2d8d64aff05a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjandem
bugs1508255
milestone65.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 1508255 - Use |clang-format off| for some js/src comments r=jandem These comments get mangled by clang-format so use |clang-format off| around them for now. In the future they can be rewritten if desired. Differential Revision: https://phabricator.services.mozilla.com/D12385
js/src/builtin/Promise.h
js/src/frontend/ParseNode.h
js/src/gc/GC-inl.h
js/src/gc/Marking.cpp
js/src/jit/BaselineBailouts.cpp
js/src/jit/BaselineIC.cpp
js/src/jit/CodeGenerator.cpp
js/src/jit/IonAnalysis.cpp
js/src/jit/JitFrames.h
js/src/jit/JitcodeMap.h
js/src/jit/OptimizationTracking.h
js/src/jit/arm/Architecture-arm.h
js/src/jit/mips-shared/Assembler-mips-shared.h
js/src/jit/x86-shared/BaseAssembler-x86-shared.h
js/src/vm/EnvironmentObject.h
js/src/vm/StringType.h
js/src/vm/TraceLoggingGraph.h
--- a/js/src/builtin/Promise.h
+++ b/js/src/builtin/Promise.h
@@ -273,16 +273,17 @@ MOZ_MUST_USE bool
 AsyncGeneratorEnqueue(JSContext* cx, HandleValue asyncGenVal, CompletionKind completionKind,
                       HandleValue completionValue, MutableHandleValue result);
 
 bool
 AsyncFromSyncIteratorMethod(JSContext* cx, CallArgs& args, CompletionKind completionKind);
 
 class MOZ_NON_TEMPORARY_CLASS PromiseLookup final
 {
+    // clang-format off
     /*
      * A PromiseLookup holds the following:
      *
      *  Promise's shape (promiseConstructorShape_)
      *       To ensure that Promise has not been modified.
      *
      *  Promise.prototype's shape (promiseProtoShape_)
      *      To ensure that Promise.prototype has not been modified.
@@ -298,16 +299,17 @@ class MOZ_NON_TEMPORARY_CLASS PromiseLoo
      *
      *  Promise.prototype's slot number for then (promiseProtoThenSlot_)
      *      To quickly retrieve the Promise.prototype.then function.
      *
      * MOZ_INIT_OUTSIDE_CTOR fields below are set in |initialize()|.  The
      * constructor only initializes a |state_| field, that defines whether the
      * other fields are accessible.
      */
+    // clang-format on
 
     // Shape of matching Promise object.
     MOZ_INIT_OUTSIDE_CTOR Shape* promiseConstructorShape_;
 
 #ifdef DEBUG
     // Accessor Shape containing the @@species property.
     // See isPromiseStateStillSane() for why this field is debug-only.
     MOZ_INIT_OUTSIDE_CTOR Shape* promiseSpeciesShape_;
--- a/js/src/frontend/ParseNode.h
+++ b/js/src/frontend/ParseNode.h
@@ -12,16 +12,18 @@
 #include "frontend/TokenStream.h"
 #ifdef ENABLE_BIGINT
 #include "vm/BigIntType.h"
 #endif
 #include "vm/BytecodeUtil.h"
 #include "vm/Printer.h"
 #include "vm/Scope.h"
 
+/* clang-format off */
+//
 // A few notes on lifetime of ParseNode trees:
 //
 // - All the `ParseNode` instances MUST BE explicitly allocated in the context's `LifoAlloc`.
 //   This is typically implemented by the `FullParseHandler` or it can be reimplemented with
 //   a custom `new_`.
 //
 // - The tree is bulk-deallocated when the parser is deallocated. Consequently, references
 //   to a subtree MUST NOT exist once the parser has been deallocated.
@@ -31,16 +33,18 @@
 // - Instances of `LexicalScope::Data` MUST BE allocated as instances of `ParseNode`, in the same
 //   `LifoAlloc`. They are bulk-deallocated alongside the rest of the tree.
 //
 // - Instances of `JSAtom` used throughout the tree (including instances of `PropertyName`) MUST
 //   be kept alive by the parser. This is done through an instance of `AutoKeepAtoms` held by
 //   the parser.
 //
 // - Once the parser is deallocated, the `JSAtom` instances MAY be garbage-collected.
+//
+/* clang-format on */
 
 
 namespace js {
 namespace frontend {
 
 class ParseContext;
 class FullParseHandler;
 class FunctionBox;
--- a/js/src/gc/GC-inl.h
+++ b/js/src/gc/GC-inl.h
@@ -281,16 +281,18 @@ class ZoneCellIter<TenuredCell> {
 
     void next() {
         MOZ_ASSERT(!done());
         cellIter.next();
         settle();
     }
 };
 
+/* clang-format off */
+//
 // Iterator over the cells in a Zone, where the GC type (JSString, JSObject) is
 // known, for a single AllocKind. Example usages:
 //
 //   for (auto obj = zone->cellIter<JSObject>(AllocKind::OBJECT0); !obj.done(); obj.next()) {
 //       ...
 //   }
 //
 //   for (auto script = zone->cellIter<JSScript>(); !script.done(); script.next()) {
@@ -315,16 +317,17 @@ class ZoneCellIter<TenuredCell> {
 // remove themselves from the store buffer on deletion, but currently for
 // subtle reasons that isn't good enough.)
 //
 // If the iterator is used within a GC, then there is no need to evict the
 // nursery (again). You may select a variant that will skip the eviction either
 // by specializing on a GCType that is never allocated in the nursery, or
 // explicitly by passing in a trailing AutoAssertEmptyNursery argument.
 //
+/* clang-format on */
 template <typename GCType>
 class ZoneCellIter : public ZoneCellIter<TenuredCell> {
   public:
     // Non-nursery allocated (equivalent to having an entry in
     // MapTypeToFinalizeKind). The template declaration here is to discard this
     // constructor overload if MapTypeToFinalizeKind<GCType>::kind does not
     // exist. Note that there will be no remaining overloads that will work,
     // which makes sense given that you haven't specified which of the
--- a/js/src/gc/Marking.cpp
+++ b/js/src/gc/Marking.cpp
@@ -74,16 +74,17 @@ using mozilla::PodCopy;
 // --------
 //
 // The secondary JSTracer is the CallbackTracer. This simply invokes a callback
 // on each edge in a child.
 //
 // The following is a rough outline of the general struture of the tracing
 // internals.
 //
+/* clang-format off */
 //                                                                                              //
 //   .---------.    .---------.    .--------------------------.       .----------.              //
 //   |TraceEdge|    |TraceRoot|    |TraceManuallyBarrieredEdge|  ...  |TraceRange|   ... etc.   //
 //   '---------'    '---------'    '--------------------------'       '----------'              //
 //        \              \                        /                        /                    //
 //         \              \  .-----------------. /                        /                     //
 //          o------------->o-|TraceEdgeInternal|-o<----------------------o                      //
 //                           '-----------------'                                                //
@@ -114,16 +115,17 @@ using mozilla::PodCopy;
 //      o<-----------------o<========================OO============Oo                           //
 //                                                                                              //
 //                                                                                              //
 //   Legend:                                                                                    //
 //     ------  Direct calls                                                                     //
 //     . . .   Static dispatch                                                                  //
 //     ======  Dispatch through a manual stack.                                                 //
 //                                                                                              //
+/* clang-format on */
 
 
 /*** Tracing Invariants **************************************************************************/
 
 #if defined(DEBUG)
 template<typename T>
 static inline bool
 IsThingPoisoned(T* thing)
--- a/js/src/jit/BaselineBailouts.cpp
+++ b/js/src/jit/BaselineBailouts.cpp
@@ -538,16 +538,17 @@ IsPrologueBailout(const SnapshotIterator
 {
     // If we are propagating an exception for debug mode, we will not resume
     // into baseline code, but instead into HandleExceptionBaseline (i.e.,
     // never before the prologue).
     return iter.pcOffset() == 0 && !iter.resumeAfter() &&
            (!excInfo || !excInfo->propagatingIonExceptionForDebugMode());
 }
 
+/* clang-format off */
 // For every inline frame, we write out the following data:
 //
 //                      |      ...      |
 //                      +---------------+
 //                      |  Descr(???)   |  --- Descr size here is (PREV_FRAME_SIZE)
 //                      +---------------+
 //                      |  ReturnAddr   |
 //             --       +===============+  --- OVERWRITE STARTS HERE  (START_STACK_ADDR)
@@ -613,17 +614,17 @@ IsPrologueBailout(const SnapshotIterator
 //         |            |  ActualArgC   |
 //         |            +---------------+
 //         |            |  CalleeToken  |
 //         |            +---------------+
 //         +------------|  Descr(Rect)  |
 //                      +---------------+
 //                      |  ReturnAddr   | <-- return into ArgumentsRectifier after call
 //                      +===============+
-//
+/* clang-format on */
 static bool
 InitFromBailout(JSContext* cx, size_t frameNo,
                 HandleFunction fun, HandleScript script,
                 SnapshotIterator& iter, bool invalidate, BaselineStackBuilder& builder,
                 MutableHandle<GCVector<Value>> startFrameFormals, MutableHandleFunction nextCallee,
                 const ExceptionBailoutInfo* excInfo)
 {
     // The Baseline frames we will reconstruct on the heap are not rooted, so GC
--- a/js/src/jit/BaselineIC.cpp
+++ b/js/src/jit/BaselineIC.cpp
@@ -361,17 +361,17 @@ TryAttachStub(const char *name, JSContex
 }
 
 
 //
 // WarmUpCounter_Fallback
 //
 
 
-//
+/* clang-format off */
 // The following data is kept in a temporary heap-allocated buffer, stored in
 // JitRuntime (high memory addresses at top, low at bottom):
 //
 //     +----->+=================================+  --      <---- High Address
 //     |      |                                 |   |
 //     |      |     ...BaselineFrame...         |   |-- Copy of BaselineFrame + stack values
 //     |      |                                 |   |
 //     |      +---------------------------------+   |
@@ -381,16 +381,17 @@ TryAttachStub(const char *name, JSContex
 //     |      +=================================+  --
 //     |      |     Padding(Maybe Empty)        |
 //     |      +=================================+  --
 //     +------|-- baselineFrame                 |   |-- IonOsrTempData
 //            |   jitcode                       |   |
 //            +=================================+  --      <---- Low Address
 //
 // A pointer to the IonOsrTempData is returned.
+/* clang-format on */
 
 struct IonOsrTempData
 {
     void* jitcode;
     uint8_t* baselineFrame;
 };
 
 static IonOsrTempData*
--- a/js/src/jit/CodeGenerator.cpp
+++ b/js/src/jit/CodeGenerator.cpp
@@ -1461,16 +1461,17 @@ PrepareAndExecuteRegExp(JSContext* cx, M
                         Register temp1, Register temp2, Register temp3,
                         size_t inputOutputDataStartOffset,
                         RegExpShared::CompilationMode mode,
                         bool stringsCanBeInNursery,
                         Label* notFound, Label* failure)
 {
     JitSpew(JitSpew_Codegen, "# Emitting PrepareAndExecuteRegExp");
 
+    // clang-format off
     /*
      * [SMDOC] Stack layout for PrepareAndExecuteRegExp
      *
      * inputOutputDataStartOffset +-----> +---------------+
      *                                    |InputOutputData|
      *          inputStartAddress +---------->  inputStart|
      *            inputEndAddress +---------->    inputEnd|
      *          startIndexAddress +---------->  startIndex|
@@ -1493,16 +1494,17 @@ PrepareAndExecuteRegExp(JSContext* cx, M
      *                                           .                   |
      *                                           .                   |
      *                                    +---------------+          |
      *                                    |   MatchPair   |          |
      *                                    |       start   |  <-------+
      *                                    |       limit   |
      *                                    +---------------+
      */
+    // clang-format on
 
     size_t matchPairsStartOffset = inputOutputDataStartOffset + sizeof(irregexp::InputOutputData);
     size_t pairsVectorStartOffset = RegExpPairsVectorStartOffset(inputOutputDataStartOffset);
 
     Address inputStartAddress(masm.getStackPointer(),
         inputOutputDataStartOffset + offsetof(irregexp::InputOutputData, inputStart));
     Address inputEndAddress(masm.getStackPointer(),
         inputOutputDataStartOffset + offsetof(irregexp::InputOutputData, inputEnd));
@@ -2128,16 +2130,17 @@ JitRealm::generateRegExpMatcherStub(JSCo
                   "Second slot holds the 'input' property");
 
     masm.loadPtr(Address(object, NativeObject::offsetOfSlots()), temp2);
     masm.storeValue(nativeTemplateObj.getSlot(RegExpRealm::MatchResultObjectIndexSlot),
                     Address(temp2, 0));
     masm.storeValue(nativeTemplateObj.getSlot(RegExpRealm::MatchResultObjectInputSlot),
                     Address(temp2, sizeof(Value)));
 
+    // clang-format off
    /*
     * [SMDOC] Stack layout for the RegExpMatcher stub
     *
     *                                    +---------------+
     *                                    |Return-Address |
     *                                    +---------------+
     * inputOutputDataStartOffset +-----> +---------------+
     *                                    |InputOutputData|
@@ -2157,16 +2160,17 @@ JitRealm::generateRegExpMatcherStub(JSCo
     *                                           .                   |
     *                                           .                   | `count` objects will be
     *                                    +---------------+          | initialized and can be
     *                                    |   MatchPair   |          | accessed below.
     *                                    |       start   |  <-------+
     *                                    |       limit   |
     *                                    +---------------+
     */
+    // clang-format on
 
     static_assert(sizeof(MatchPair) == 2 * sizeof(int32_t),
                   "MatchPair consists of two int32 values representing the start"
                   "and the end offset of the match");
 
     Address pairCountAddress = RegExpPairCountAddress(masm, inputOutputDataStartOffset);
 
     size_t pairsVectorStartOffset = RegExpPairsVectorStartOffset(inputOutputDataStartOffset);
@@ -2423,16 +2427,17 @@ JitRealm::generateRegExpSearcherStub(JSC
     if (!PrepareAndExecuteRegExp(cx, masm, regexp, input, lastIndex,
                                  temp1, temp2, temp3, inputOutputDataStartOffset,
                                  RegExpShared::Normal, stringsCanBeInNursery,
                                  &notFound, &oolEntry))
     {
         return nullptr;
     }
 
+    // clang-format off
     /*
      * [SMDOC] Stack layout for the RegExpSearcher stub
      *
      *                                    +---------------+
      *                                    |Return-Address |
      *                                    +---------------+
      * inputOutputDataStartOffset +-----> +---------------+
      *                                    |InputOutputData|
@@ -2452,16 +2457,17 @@ JitRealm::generateRegExpSearcherStub(JSC
      *                                           .                   |
      *                                           .                   | Only a single object will
      *                                    +---------------+          | be initialized and can be
      *                                    |   MatchPair   |          | accessed below.
      *                                    |       start   |  <-------+
      *                                    |       limit   |
      *                                    +---------------+
      */
+    // clang-format on
 
     size_t pairsVectorStartOffset = RegExpPairsVectorStartOffset(inputOutputDataStartOffset);
     Address matchPairStart(masm.getStackPointer(),
                            pairsVectorStartOffset + offsetof(MatchPair, start));
     Address matchPairLimit(masm.getStackPointer(),
                            pairsVectorStartOffset + offsetof(MatchPair, limit));
 
     masm.load32(matchPairStart, result);
--- a/js/src/jit/IonAnalysis.cpp
+++ b/js/src/jit/IonAnalysis.cpp
@@ -1974,16 +1974,18 @@ TypeAnalyzer::insertConversions()
             if (!adjustInputs(*iter)) {
                 return false;
             }
         }
     }
     return true;
 }
 
+/* clang-format off */
+//
 // This function tries to emit Float32 specialized operations whenever it's possible.
 // MIR nodes are flagged as:
 // - Producers, when they can create Float32 that might need to be coerced into a Double.
 //   Loads in Float32 arrays and conversions to Float32 are producers.
 // - Consumers, when they can have Float32 as inputs and validate a legal use of a Float32.
 //   Stores in Float32 arrays and conversions to Float32 are consumers.
 // - Float32 commutative, when using the Float32 instruction instead of the Double instruction
 //   does not result in a compound loss of precision. This is the case for +, -, /, * with 2
@@ -2009,16 +2011,18 @@ TypeAnalyzer::insertConversions()
 // 1 - Determine which phis are consumers. Each phi gets an initial value by making a global AND on
 // all its non-phi inputs. Then each phi propagates its value to other phis. If after propagation,
 // the flag value changed, we have to reapply the algorithm on all phi operands, as a phi is a
 // consumer if all of its uses are consumers.
 // 2 - Determine which phis are producers. It's the same algorithm, except that we have to reapply
 // the algorithm on all phi uses, as a phi is a producer if all of its operands are producers.
 // 3 - Go through all commutative operations and ensure their inputs are all producers and their
 // uses are all consumers.
+//
+/* clang-format on */
 bool
 TypeAnalyzer::markPhiConsumers()
 {
     MOZ_ASSERT(phiWorklist_.empty());
 
     // Iterate in postorder so worklist is initialized to RPO.
     for (PostorderIterator block(graph.poBegin()); block != graph.poEnd(); ++block) {
         if (mir->shouldCancel("Ensure Float32 commutativity - Consumer Phis - Initial state")) {
--- a/js/src/jit/JitFrames.h
+++ b/js/src/jit/JitFrames.h
@@ -891,27 +891,29 @@ class DirectWasmJitCallFrameLayout
   public:
     static ExitFrameType Type() { return ExitFrameType::DirectWasmJitCall; }
 };
 
 class ICStub;
 
 class JitStubFrameLayout : public CommonFrameLayout
 {
+    /* clang-format off */
     // Info on the stack
     //
     // --------------------
     // |JitStubFrameLayout|
     // +------------------+
     // | - Descriptor     | => Marks end of FrameType::IonJS
     // | - returnaddres   |
     // +------------------+
     // | - StubPtr        | => First thing pushed in a stub only when the stub will do
     // --------------------    a vmcall. Else we cannot have JitStubFrame. But technically
     //                         not a member of the layout.
+    /* clang-format on */
 
   public:
     static size_t Size() {
         return sizeof(JitStubFrameLayout);
     }
 
     static inline int reverseOffsetOfStubPtr() {
         return -int(sizeof(void*));
@@ -920,30 +922,32 @@ class JitStubFrameLayout : public Common
     inline ICStub* maybeStubPtr() {
         uint8_t* fp = reinterpret_cast<uint8_t*>(this);
         return *reinterpret_cast<ICStub**>(fp + reverseOffsetOfStubPtr());
     }
 };
 
 class BaselineStubFrameLayout : public JitStubFrameLayout
 {
+    /* clang-format off */
     // Info on the stack
     //
     // -------------------------
     // |BaselineStubFrameLayout|
     // +-----------------------+
     // | - Descriptor          | => Marks end of FrameType::BaselineJS
     // | - returnaddres        |
     // +-----------------------+
     // | - StubPtr             | => First thing pushed in a stub only when the stub will do
     // +-----------------------+    a vmcall. Else we cannot have BaselineStubFrame.
     // | - FramePtr            | => Baseline stubs also need to push the frame ptr when doing
     // -------------------------    a vmcall.
     //                              Technically these last two variables are not part of the
     //                              layout.
+    /* clang-format on */
 
   public:
     static inline size_t Size() {
         return sizeof(BaselineStubFrameLayout);
     }
 
     static inline int reverseOffsetOfSavedFramePtr() {
         return -int(2 * sizeof(void*));
--- a/js/src/jit/JitcodeMap.h
+++ b/js/src/jit/JitcodeMap.h
@@ -1185,16 +1185,17 @@ class JitcodeGlobalTable
         Enum(JitcodeGlobalTable& table, JSRuntime* rt);
 
         void popFront();
         void removeFront();
     };
 };
 
 
+// clang-format off
 /*
  * Container class for main jitcode table.
  * The Region table's memory is structured as follows:
  *
  *      +------------------------------------------------+   |
  *      |  Region 1 Run                                  |   |
  *      |------------------------------------------------|   |
  *      |  Region 2 Run                                  |   |
@@ -1255,16 +1256,17 @@ class JitcodeGlobalTable
  *          - We encode (2 * scriptDepth) VarUint32s here.  Each pair of uint32s are taken
  *            as an index into the scriptList in the global table entry, and a pcOffset
  *            respectively.
  *
  *      List<NativeAndBytecodeDelta> deltaRun;
  *          - The rest of the entry is a deltaRun that stores a series of variable-length
  *            encoded NativeAndBytecodeDelta datums.
  */
+// clang-format on
 class JitcodeRegionEntry
 {
   private:
     static const unsigned MAX_RUN_LENGTH = 100;
 
   public:
     static void WriteHead(CompactBufferWriter& writer,
                           uint32_t nativeOffset, uint8_t scriptDepth);
--- a/js/src/jit/OptimizationTracking.h
+++ b/js/src/jit/OptimizationTracking.h
@@ -186,16 +186,17 @@ class UniqueTrackedOptimizations
 
     MOZ_MUST_USE bool sortByFrequency(JSContext* cx);
     bool sorted() const { return !sorted_.empty(); }
     uint32_t count() const { MOZ_ASSERT(sorted()); return sorted_.length(); }
     const SortedVector& sortedVector() const { MOZ_ASSERT(sorted()); return sorted_; }
     uint8_t indexOf(const TrackedOptimizations* optimizations) const;
 };
 
+/* clang-format off */
 // A compact table of tracked optimization information. Pictorially,
 //
 //    +------------------------------------------------+
 //    |  Region 1                                      |  |
 //    |------------------------------------------------|  |
 //    |  Region 2                                      |  |
 //    |------------------------------------------------|  |-- PayloadR of list-of-list of
 //    |               ...                              |  |   range triples (see below)
@@ -243,16 +244,17 @@ class UniqueTrackedOptimizations
 //    | Optimization attempts 1                        |  |
 //    |   uint32_t entryOffset = size(PayloadA)        |  |
 //    +------------------------------------------------+  |-- Table
 //    |   ...                                          |  |
 //    +------------------------------------------------+  |
 //    | Optimization attempts N                        |  |
 //    |   uint32_t entryOffset                         |  |
 //    +------------------------------------------------+
+/* clang-format on */
 //
 // Abstractly, each region in the PayloadR section is a list of triples of the
 // following, in order of ascending startOffset:
 //
 //     (startOffset, endOffset, optimization attempts index)
 //
 // The range of [startOffset, endOffset) is the native machine code offsets
 // for which the optimization attempts referred to by the index applies.
--- a/js/src/jit/arm/Architecture-arm.h
+++ b/js/src/jit/arm/Architecture-arm.h
@@ -279,16 +279,17 @@ class FloatRegisters
     static const uint32_t Total = 48;
     static const uint32_t TotalDouble = 16;
     static const uint32_t TotalSingle = 32;
     static const uint32_t Allocatable = 45;
     // There are only 32 places that we can put values.
     static const uint32_t TotalPhys = 32;
     static uint32_t ActualTotalPhys();
 
+    /* clang-format off */
     // ARM float registers overlap in a way that for 1 double registers, in the
     // range d0-d15, we have 2 singles register in the range s0-s31. d16-d31
     // have no single register aliases.  The aliasing rule state that d{n}
     // aliases s{2n} and s{2n+1}, for n in [0 .. 15].
     //
     // The register set is used to represent either allocatable register or live
     // registers. The register maps d0-d15 and s0-s31 to a single bit each. The
     // registers d16-d31 are not used at the moment.
@@ -310,16 +311,17 @@ class FloatRegisters
     //
     // (*) Note that d{n} bit is set, but is not available because s{2n+1} bit
     // is not set, which is required as d{n} dominates s{2n+1}. The d{n} bit is
     // set, because s{2n} is aligned.
     //
     //        |        d{n}       |
     //        | s{2n+1} |  s{2n}  |
     //
+    /* clang-format on */
     typedef uint64_t SetType;
     static const SetType AllSingleMask = (1ull << TotalSingle) - 1;
     static const SetType AllDoubleMask = ((1ull << TotalDouble) - 1) << TotalSingle;
     static const SetType AllMask = AllDoubleMask | AllSingleMask;
 
     // d15 is the ScratchFloatReg.
     static const SetType NonVolatileDoubleMask =
          ((1ULL << d8) |
@@ -631,16 +633,17 @@ VFPRegister::AllocatableAsIndexableSet<R
     // is enough to convert an allocatable set into a set of register list all
     // single register available.
     return set & FloatRegisters::AllSingleMask;
 }
 
 template <> inline VFPRegister::SetType
 VFPRegister::AllocatableAsIndexableSet<RegTypeName::Float64>(SetType set)
 {
+    /* clang-format off */
     // An allocatable float register set is represented as follow:
     //
     // uuuu uuuu uuuu uuuu dddd dddd dddd dddd ssss ssss ssss ssss ssss ssss ssss ssss
     //                     ^                 ^ ^                                     ^
     //                     '-- d15      d0 --' '-- s31                          s0 --'
     //
     //     ...0...00... : s{2n}, s{2n+1} and d{n} are not available
     //     ...1...01... : s{2n} is available
@@ -651,16 +654,17 @@ VFPRegister::AllocatableAsIndexableSet<R
     // are available as an indexable bit set. This implies that iff a double bit
     // is set in the returned set, then the register is available.
     //
     // To do so, this functions converts the 32 bits set of single registers
     // into a 16 bits set of equivalent double registers. Then, we mask out
     // double registers which do not have all the single register that compose
     // them. As d{n} bit is set when s{2n} is available, we only need to take
     // s{2n+1} into account.
+    /* clang-format on */
 
     // Convert  s7s6s5s4 s3s2s1s0  into  s7s5s3s1, for all s0-s31.
     SetType s2d = AllocatableAsIndexableSet<RegTypeName::Float32>(set);
     static_assert(FloatRegisters::TotalSingle == 32, "Wrong mask");
     s2d = (0xaaaaaaaa & s2d) >> 1; // Filter s{2n+1} registers.
     // Group adjacent bits as follow:
     //     0.0.s3.s1 == ((0.s3.0.s1) >> 1 | (0.s3.0.s1)) & 0b0011;
     s2d = ((s2d >> 1) | s2d) & 0x33333333; // 0a0b --> 00ab
--- a/js/src/jit/mips-shared/Assembler-mips-shared.h
+++ b/js/src/jit/mips-shared/Assembler-mips-shared.h
@@ -125,31 +125,33 @@ static constexpr Register RegExpTesterLa
 static constexpr uint32_t CodeAlignment = 8;
 
 // This boolean indicates whether we support SIMD instructions flavoured for
 // this architecture or not. Rather than a method in the LIRGenerator, it is
 // here such that it is accessible from the entire codebase. Once full support
 // for SIMD is reached on all tier-1 platforms, this constant can be deleted.
 static constexpr bool SupportsSimd = false;
 
+/* clang-format off */
 // MIPS instruction types
 //                +---------------------------------------------------------------+
 //                |    6      |    5    |    5    |    5    |    5    |    6      |
 //                +---------------------------------------------------------------+
 // Register type  |  Opcode   |    Rs   |    Rt   |    Rd   |    Sa   | Function  |
 //                +---------------------------------------------------------------+
 //                |    6      |    5    |    5    |               16              |
 //                +---------------------------------------------------------------+
 // Immediate type |  Opcode   |    Rs   |    Rt   |    2's complement constant    |
 //                +---------------------------------------------------------------+
 //                |    6      |                        26                         |
 //                +---------------------------------------------------------------+
 // Jump type      |  Opcode   |                    jump_target                    |
 //                +---------------------------------------------------------------+
 //                31 bit                                                      bit 0
+/* clang-format on */
 
 // MIPS instruction encoding constants.
 static const uint32_t OpcodeShift = 26;
 static const uint32_t OpcodeBits = 6;
 static const uint32_t RSShift = 21;
 static const uint32_t RSBits = 5;
 static const uint32_t RTShift = 16;
 static const uint32_t RTBits = 5;
--- a/js/src/jit/x86-shared/BaseAssembler-x86-shared.h
+++ b/js/src/jit/x86-shared/BaseAssembler-x86-shared.h
@@ -4502,31 +4502,35 @@ threeByteOpImmSimd("vblendps", VEX_PD, O
             switch (ty) {
               case VEX_PS: break;
               case VEX_PD: prefix(PRE_SSE_66); break;
               case VEX_SS: prefix(PRE_SSE_F3); break;
               case VEX_SD: prefix(PRE_SSE_F2); break;
             }
         }
 
+        /* clang-format off */
+        //
         // Word-sized operands / no operand instruction formatters.
         //
         // In addition to the opcode, the following operand permutations are supported:
         //   * None - instruction takes no operands.
         //   * One register - the low three bits of the RegisterID are added into the opcode.
         //   * Two registers - encode a register form ModRm (for all ModRm formats, the reg field is passed first, and a GroupOpcodeID may be passed in its place).
         //   * Three argument ModRM - a register, and a register and an offset describing a memory operand.
         //   * Five argument ModRM - a register, and a base register, an index, scale, and offset describing a memory operand.
         //
         // For 32-bit x86 targets, the address operand may also be provided as a
         // void*.  On 64-bit targets REX prefixes will be planted as necessary,
         // where high numbered registers are used.
         //
         // The twoByteOp methods plant two-byte Intel instructions sequences
         // (first opcode byte 0x0F).
+        //
+        /* clang-format on */
 
         void oneByteOp(OneByteOpcodeID opcode)
         {
             m_buffer.ensureSpace(MaxInstructionSize);
             m_buffer.putByteUnchecked(opcode);
         }
 
         void oneByteOp(OneByteOpcodeID opcode, RegisterID reg)
--- a/js/src/vm/EnvironmentObject.h
+++ b/js/src/vm/EnvironmentObject.h
@@ -40,16 +40,17 @@ extern JSScript*
 EnvironmentCoordinateFunctionScript(JSScript* script, jsbytecode* pc);
 
 
 /*** Environment objects *****************************************************/
 
 
 /*** Environment objects *****************************************************/
 
+// clang-format off
 /*
  * [SMDOC] Environment Objects
  *
  * About environments
  * ------------------
  *
  * (See also: ecma262 rev c7952de (19 Aug 2016) 8.1 "Lexical Environments".)
  *
@@ -252,16 +253,17 @@ EnvironmentCoordinateFunctionScript(JSSc
  *       |
  *   WithEnvironmentObject wrapping e1
  *       |
  *   WithEnvironmentObject wrapping e0
  *       |
  *   LexicalEnvironmentObject
  *
  */
+// clang-format on
 
 class EnvironmentObject : public NativeObject
 {
   protected:
     // The enclosing environment. Either another EnvironmentObject, a
     // GlobalObject, or a non-syntactic environment object.
     static const uint32_t ENCLOSING_ENV_SLOT = 0;
 
--- a/js/src/vm/StringType.h
+++ b/js/src/vm/StringType.h
@@ -43,16 +43,17 @@ namespace js {
 class StaticStrings;
 class PropertyName;
 
 /* The buffer length required to contain any unsigned 32-bit integer. */
 static const size_t UINT32_CHAR_BUFFER_LENGTH = sizeof("4294967295") - 1;
 
 } /* namespace js */
 
+// clang-format off
 /*
  * [SMDOC] JavaScript Strings
  *
  * Conceptually, a JS string is just an array of chars and a length. This array
  * of chars may or may not be null-terminated and, if it is, the null character
  * is not included in the length.
  *
  * To improve performance of common operations, the following optimizations are
@@ -155,16 +156,17 @@ static const size_t UINT32_CHAR_BUFFER_L
  * is used as key in a JS Map/Set.
  *
  * Derived string types can be queried from ancestor types via isX() and
  * retrieved with asX() debug-only-checked casts.
  *
  * The ensureX() operations mutate 'this' in place to effectively the type to be
  * at least X (e.g., ensureLinear will change a JSRope to be a JSFlatString).
  */
+// clang-format on
 
 class JSString : public js::gc::Cell
 {
   protected:
     static const size_t NUM_INLINE_CHARS_LATIN1   = 2 * sizeof(void*) / sizeof(JS::Latin1Char);
     static const size_t NUM_INLINE_CHARS_TWO_BYTE = 2 * sizeof(void*) / sizeof(char16_t);
 
     /* Fields only apply to string types commented on the right. */
--- a/js/src/vm/TraceLoggingGraph.h
+++ b/js/src/vm/TraceLoggingGraph.h
@@ -8,16 +8,17 @@
 #define TraceLoggingGraph_h
 
 #include "mozilla/MemoryReporting.h"
 
 #include "js/TypeDecls.h"
 #include "vm/MutexIDs.h"
 #include "vm/TraceLoggingTypes.h"
 
+// clang-format off
 /*
  * The output of a tracelogging session is saved in /tmp/tl-data.json.
  * The format of that file is a JS array per tracelogger (=thread), with a map
  * containing:
  *  - dict:   Name of the file containing a json table with the log text.
  *            All other files only contain a index to this table when logging.
  *  - events: Name of the file containing a flat list of log events saved
  *            in binary format.
@@ -55,16 +56,17 @@
  *                      /----------------------------------\
  *                      |                                  |
  *       0xC0: [start, end, dictId, 0, 2]      0x180 [start, end, dictId, 1, 0]
  *                                                      |
  *                                  /----------------------------------\
  *                                  |                                  |
  *         0x240: [start, end, dictId, 0, 4]    0x300 [start, end, dictId, 0, 0]
  */
+// clang-format on
 
 namespace js {
 void DestroyTraceLoggerGraphState();
 size_t SizeOfTraceLogGraphState(mozilla::MallocSizeOf mallocSizeOf);
 } // namespace js
 
 class TraceLoggerGraphState
 {