Backed out changeset 5c1893bd77c2 (bug 1499323) for linting failure at /builds/worker/checkouts/gecko/config/check_macroassembler_style.py:149:5 on a CLOSED TREE
authorDaniel Varga <dvarga@mozilla.com>
Thu, 29 Nov 2018 16:03:08 +0200
changeset 507952 09a9f71303cbe78c547216ecd3759cf0fa37a553
parent 507951 5c1893bd77c26d9fc69aa5df4820d76c0ba5100a
child 507953 a89d378954538f7fe0cad49681b409e80c3f8a0f
child 507984 871b06663b0d85566feecce311f9c77a31b279be
push id1905
push userffxbld-merge
push dateMon, 21 Jan 2019 12:33:13 +0000
treeherdermozilla-release@c2fca1944d8c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1499323
milestone65.0a1
backs out5c1893bd77c26d9fc69aa5df4820d76c0ba5100a
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
Backed out changeset 5c1893bd77c2 (bug 1499323) for linting failure at /builds/worker/checkouts/gecko/config/check_macroassembler_style.py:149:5 on a CLOSED TREE
config/check_macroassembler_style.py
js/src/jit/MacroAssembler-inl.h
js/src/jit/MacroAssembler.cpp
js/src/jit/MacroAssembler.h
js/src/jit/arm/MacroAssembler-arm-inl.h
js/src/jit/arm/MacroAssembler-arm.cpp
js/src/jit/arm64/MacroAssembler-arm64-inl.h
js/src/jit/arm64/MacroAssembler-arm64.cpp
js/src/jit/mips-shared/MacroAssembler-mips-shared-inl.h
js/src/jit/mips-shared/MacroAssembler-mips-shared.cpp
js/src/jit/mips32/MacroAssembler-mips32-inl.h
js/src/jit/mips32/MacroAssembler-mips32.cpp
js/src/jit/mips64/MacroAssembler-mips64-inl.h
js/src/jit/mips64/MacroAssembler-mips64.cpp
js/src/jit/x64/MacroAssembler-x64-inl.h
js/src/jit/x64/MacroAssembler-x64.cpp
js/src/jit/x86-shared/MacroAssembler-x86-shared-inl.h
js/src/jit/x86-shared/MacroAssembler-x86-shared.cpp
js/src/jit/x86/MacroAssembler-x86-inl.h
js/src/jit/x86/MacroAssembler-x86.cpp
--- a/config/check_macroassembler_style.py
+++ b/config/check_macroassembler_style.py
@@ -43,18 +43,16 @@ reMatchArg = re.compile(reBeforeArg + re
 
 def get_normalized_signatures(signature, fileAnnot=None):
     # Remove static
     signature = signature.replace('static', '')
     # Remove semicolon.
     signature = signature.replace(';', ' ')
     # Normalize spaces.
     signature = re.sub(r'\s+', ' ', signature).strip()
-    # Remove new-line induced spaces after opening braces.
-    signature = re.sub(r'\(\s+', '(', signature).strip()
     # Match arguments, and keep only the type.
     signature = reMatchArg.sub('\g<type>', signature)
     # Remove class name
     signature = signature.replace('MacroAssembler::', '')
 
     # Extract list of architectures
     archs = ['generic']
     if fileAnnot:
@@ -147,67 +145,49 @@ def get_macroassembler_definitions(filen
 
     style_section = False
     code_section = False
     lines = ''
     signatures = []
     with open(filename) as f:
         for line in f:
             if '//{{{ check_macroassembler_style' in line:
-                if style_section:
-                    raise 'check_macroassembler_style section already opened.'
                 style_section = True
-                braces_depth = 0
             elif '//}}} check_macroassembler_style' in line:
                 style_section = False
             if not style_section:
                 continue
 
-            # Remove comments from the processed line.
             line = re.sub(r'//.*', '', line)
-
-            # Locate and count curly braces.
-            open_curly_brace = line.find('{')
-            was_braces_depth = braces_depth
-            braces_depth = braces_depth + line.count('{') - line.count('}')
-
-            # Raise an error if the check_macroassembler_style macro is used
-            # across namespaces / classes scopes.
-            if braces_depth < 0:
-                raise 'check_macroassembler_style annotations are not well scoped.'
-
-            # If the current line contains an opening curly brace, check if
-            # this line combines with the previous one can be identified as a
-            # MacroAssembler function signature.
-            if open_curly_brace != -1 and was_braces_depth == 0:
-                lines = lines + line[:open_curly_brace]
+            if line.startswith('{') or line.strip() == "{}":
                 if 'MacroAssembler::' in lines:
                     signatures.extend(
                         get_normalized_signatures(lines, fileAnnot))
+                if line.strip() != "{}":  # Empty declaration, no need to declare
+                    # a new code section
+                    code_section = True
+                continue
+            if line.startswith('}'):
+                code_section = False
                 lines = ''
                 continue
+            if code_section:
+                continue
 
-            # We do not aggregate any lines if we are scanning lines which are
-            # in-between a set of curly braces.
-            if braces_depth > 0:
+            if len(line.strip()) == 0:
+                lines = ''
                 continue
-            if was_braces_depth != 0:
-                line = line[line.rfind('}') + 1:]
-
-            # This logic is used to remove template instantiation, static
-            # variable definitions and function declaration from the next
-            # function definition.
-            last_semi_colon = line.rfind(';')
-            if last_semi_colon != -1:
+            lines = lines + line
+            # Continue until we have a complete declaration
+            if '{' not in lines:
+                continue
+            # Skip variable declarations
+            if ')' not in lines:
                 lines = ''
-                line = line[last_semi_colon + 1:]
-
-            # Aggregate lines of non-braced text, which corresponds to the space
-            # where we are expecting to find function definitions.
-            lines = lines + line
+                continue
 
     return signatures
 
 
 def get_macroassembler_declaration(filename):
     style_section = False
     lines = ''
     signatures = []
@@ -216,27 +196,24 @@ def get_macroassembler_declaration(filen
             if '//{{{ check_macroassembler_decl_style' in line:
                 style_section = True
             elif '//}}} check_macroassembler_decl_style' in line:
                 style_section = False
             if not style_section:
                 continue
 
             line = re.sub(r'//.*', '', line)
-            if len(line.strip()) == 0 or 'public:' in line or 'private:' in line:
+            if len(line.strip()) == 0:
                 lines = ''
                 continue
             lines = lines + line
-
             # Continue until we have a complete declaration
             if ';' not in lines:
                 continue
-
-            # Skip member declarations: which are lines ending with a
-            # semi-colon without any list of arguments.
+            # Skip variable declarations
             if ')' not in lines:
                 lines = ''
                 continue
 
             signatures.extend(get_normalized_signatures(lines))
             lines = ''
 
     return signatures
--- a/js/src/jit/MacroAssembler-inl.h
+++ b/js/src/jit/MacroAssembler-inl.h
@@ -28,16 +28,17 @@
 # error "Unknown architecture!"
 #endif
 
 #include "wasm/WasmBuiltins.h"
 
 namespace js {
 namespace jit {
 
+// clang-format off
 //{{{ check_macroassembler_style
 // ===============================================================
 // Stack manipulation functions.
 
 CodeOffset
 MacroAssembler::PushWithPatch(ImmWord word)
 {
     framePushed_ += sizeof(word.value);
@@ -794,16 +795,17 @@ MacroAssembler::storeFloat32(FloatRegist
     canonicalizeFloatIfDeterministic(src);
     storeUncanonicalizedFloat32(src, dest);
 }
 
 template void MacroAssembler::storeFloat32(FloatRegister src, const Address& dest);
 template void MacroAssembler::storeFloat32(FloatRegister src, const BaseIndex& dest);
 
 //}}} check_macroassembler_style
+// clang-format on
 // ===============================================================
 
 #ifndef JS_CODEGEN_ARM64
 
 template <typename T>
 void
 MacroAssembler::branchTestStackPtr(Condition cond, T t, Label* label)
 {
--- a/js/src/jit/MacroAssembler.cpp
+++ b/js/src/jit/MacroAssembler.cpp
@@ -2949,16 +2949,17 @@ MacroAssembler::icBuildOOLFakeExitFrame(
 #ifndef JS_CODEGEN_ARM64
 void
 MacroAssembler::subFromStackPtr(Register reg)
 {
     subPtr(reg, getStackPointer());
 }
 #endif // JS_CODEGEN_ARM64
 
+// clang-format off
 //{{{ check_macroassembler_style
 // ===============================================================
 // Stack manipulation functions.
 
 void
 MacroAssembler::PushRegsInMask(LiveGeneralRegisterSet set)
 {
     PushRegsInMask(LiveRegisterSet(set.set(), FloatRegisterSet()));
@@ -3801,16 +3802,17 @@ MacroAssembler::boundsCheck32PowerOfTwo(
     // Note: it's fine to clobber the input register, as this is a no-op: it
     // only affects speculative execution.
     if (JitOptions.spectreIndexMasking) {
         and32(Imm32(length - 1), index);
     }
 }
 
 //}}} check_macroassembler_style
+// clang-format on
 
 void
 MacroAssembler::memoryBarrierBefore(const Synchronization& sync) {
     memoryBarrier(sync.barrierBefore);
 }
 
 void
 MacroAssembler::memoryBarrierAfter(const Synchronization& sync) {
--- a/js/src/jit/MacroAssembler.h
+++ b/js/src/jit/MacroAssembler.h
@@ -345,16 +345,17 @@ class MacroAssembler : public MacroAssem
     size_t instructionsSize() const {
         return size();
     }
 
 #ifdef JS_HAS_HIDDEN_SP
     void Push(RegisterOrSP reg);
 #endif
 
+    // clang-format off
     //{{{ check_macroassembler_decl_style
   public:
     // ===============================================================
     // MacroAssembler high-level usage.
 
     // Flushes the assembly buffer, on platforms that need it.
     void flush() PER_SHARED_ARCH;
 
@@ -2130,16 +2131,17 @@ class MacroAssembler : public MacroAssem
 
     // The length must be a power of two. Performs a bounds check and Spectre index
     // masking.
     void boundsCheck32PowerOfTwo(Register index, uint32_t length, Label* failure);
 
     void speculationBarrier() PER_SHARED_ARCH;
 
     //}}} check_macroassembler_decl_style
+    // clang-format on
   public:
 
     // Emits a test of a value against all types in a TypeSet. A scratch
     // register is required.
     template <typename Source>
     void guardTypeSet(const Source& address, const TypeSet* types, BarrierKind kind,
                       Register unboxScratch, Register objScratch, Register spectreRegToZero,
                       Label* miss);
@@ -2895,16 +2897,17 @@ class IonHeapMacroAssembler : public Mac
   public:
     IonHeapMacroAssembler()
       : MacroAssembler()
     {
         MOZ_ASSERT(CurrentThreadIsIonCompiling());
     }
 };
 
+// clang-format off
 //{{{ check_macroassembler_style
 inline uint32_t
 MacroAssembler::framePushed() const
 {
     return framePushed_;
 }
 
 inline void
@@ -2923,16 +2926,17 @@ MacroAssembler::adjustFrame(int32_t valu
 inline void
 MacroAssembler::implicitPop(uint32_t bytes)
 {
     MOZ_ASSERT(bytes % sizeof(intptr_t) == 0);
     MOZ_ASSERT(bytes <= INT32_MAX);
     adjustFrame(-int32_t(bytes));
 }
 //}}} check_macroassembler_style
+// clang-format on
 
 static inline Assembler::DoubleCondition
 JSOpToDoubleCondition(JSOp op)
 {
     switch (op) {
       case JSOP_EQ:
       case JSOP_STRICTEQ:
         return Assembler::DoubleEqual;
--- a/js/src/jit/arm/MacroAssembler-arm-inl.h
+++ b/js/src/jit/arm/MacroAssembler-arm-inl.h
@@ -7,16 +7,17 @@
 #ifndef jit_arm_MacroAssembler_arm_inl_h
 #define jit_arm_MacroAssembler_arm_inl_h
 
 #include "jit/arm/MacroAssembler-arm.h"
 
 namespace js {
 namespace jit {
 
+// clang-format off
 //{{{ check_macroassembler_style
 
 void
 MacroAssembler::move64(Register64 src, Register64 dest)
 {
     move32(src.low, dest.low);
     move32(src.high, dest.high);
 }
@@ -2329,16 +2330,17 @@ MacroAssembler::clampIntToUint8(Register
     // <0, then we want to clamp to 0, otherwise, we wish to clamp to 255
     ScratchRegisterScope scratch(*this);
     as_mov(scratch, asr(reg, 8), SetCC);
     ma_mov(Imm32(0xff), reg, NotEqual);
     ma_mov(Imm32(0), reg, Signed);
 }
 
 //}}} check_macroassembler_style
+// clang-format on
 // ===============================================================
 
 void
 MacroAssemblerARMCompat::incrementInt32Value(const Address& addr)
 {
     asMasm().add32(Imm32(1), ToPayload(addr));
 }
 
--- a/js/src/jit/arm/MacroAssembler-arm.cpp
+++ b/js/src/jit/arm/MacroAssembler-arm.cpp
@@ -4357,16 +4357,17 @@ void
 MacroAssembler::subFromStackPtr(Imm32 imm32)
 {
     ScratchRegisterScope scratch(*this);
     if (imm32.value) {
         ma_sub(imm32, sp, scratch);
     }
 }
 
+// clang-format off
 //{{{ check_macroassembler_style
 // ===============================================================
 // MacroAssembler high-level usage.
 
 void
 MacroAssembler::flush()
 {
     Assembler::flush();
@@ -6170,16 +6171,17 @@ void
 MacroAssembler::speculationBarrier()
 {
     // Spectre mitigation recommended by ARM for cases where csel/cmov cannot be
     // used.
     as_csdb();
 }
 
 //}}} check_macroassembler_style
+// clang-format on
 
 void
 MacroAssemblerARM::wasmTruncateToInt32(FloatRegister input, Register output, MIRType fromType,
                                        bool isUnsigned, bool isSaturating, Label* oolEntry)
 {
     ScratchDoubleScope scratchScope(asMasm());
     ScratchRegisterScope scratchReg(asMasm());
     FloatRegister scratch = scratchScope.uintOverlay();
--- a/js/src/jit/arm64/MacroAssembler-arm64-inl.h
+++ b/js/src/jit/arm64/MacroAssembler-arm64-inl.h
@@ -7,16 +7,17 @@
 #ifndef jit_arm64_MacroAssembler_arm64_inl_h
 #define jit_arm64_MacroAssembler_arm64_inl_h
 
 #include "jit/arm64/MacroAssembler-arm64.h"
 
 namespace js {
 namespace jit {
 
+// clang-format off
 //{{{ check_macroassembler_style
 
 void
 MacroAssembler::move64(Register64 src, Register64 dest)
 {
     Mov(ARMRegister(dest.reg, 64), ARMRegister(src.reg, 64));
 }
 
@@ -1976,16 +1977,17 @@ MacroAssembler::clampIntToUint8(Register
 
     Cmp(reg32, Operand(reg32, vixl::UXTB));
     Csel(reg32, reg32, vixl::wzr, Assembler::GreaterThanOrEqual);
     Mov(scratch32, Operand(0xff));
     Csel(reg32, reg32, scratch32, Assembler::LessThanOrEqual);
 }
 
 //}}} check_macroassembler_style
+// clang-format on
 // ===============================================================
 
 void
 MacroAssemblerCompat::addToStackPtr(Register src)
 {
     Add(GetStackPointer64(), GetStackPointer64(), ARMRegister(src, 64));
 }
 
--- a/js/src/jit/arm64/MacroAssembler-arm64.cpp
+++ b/js/src/jit/arm64/MacroAssembler-arm64.cpp
@@ -408,16 +408,17 @@ MacroAssembler::Push(RegisterOrSP reg)
     if (IsHiddenSP(reg)) {
         push(sp);
     } else {
         push(AsRegister(reg));
     }
     adjustFrame(sizeof(intptr_t));
 }
 
+// clang-format off
 //{{{ check_macroassembler_style
 // ===============================================================
 // MacroAssembler high-level usage.
 
 void
 MacroAssembler::flush()
 {
     Assembler::flush();
@@ -2019,11 +2020,12 @@ MacroAssembler::flexibleDivMod32(Registe
 void
 MacroAssembler::speculationBarrier()
 {
     // Conditional speculation barrier.
     csdb();
 }
 
 //}}} check_macroassembler_style
+// clang-format off
 
 } // namespace jit
 } // namespace js
--- a/js/src/jit/mips-shared/MacroAssembler-mips-shared-inl.h
+++ b/js/src/jit/mips-shared/MacroAssembler-mips-shared-inl.h
@@ -7,16 +7,17 @@
 #ifndef jit_mips_shared_MacroAssembler_mips_shared_inl_h
 #define jit_mips_shared_MacroAssembler_mips_shared_inl_h
 
 #include "jit/mips-shared/MacroAssembler-mips-shared.h"
 
 namespace js {
 namespace jit {
 
+// clang-format off
 //{{{ check_macroassembler_style
 
 void
 MacroAssembler::moveFloat32ToGPR(FloatRegister src, Register dest)
 {
     moveFromFloat32(src, dest);
 }
 
@@ -1105,14 +1106,15 @@ MacroAssembler::clampIntToUint8(Register
 
     // If reg is >= 255, then we want to clamp to 255.
     ma_li(SecondScratchReg, Imm32(255));
     as_slti(ScratchRegister, reg, 255);
     as_movz(reg, SecondScratchReg, ScratchRegister);
 }
 
 //}}} check_macroassembler_style
+// clang-format on
 // ===============================================================
 
 } // namespace jit
 } // namespace js
 
 #endif /* jit_mips_shared_MacroAssembler_mips_shared_inl_h */
--- a/js/src/jit/mips-shared/MacroAssembler-mips-shared.cpp
+++ b/js/src/jit/mips-shared/MacroAssembler-mips-shared.cpp
@@ -1434,16 +1434,17 @@ MacroAssemblerMIPSShared::asMasm()
 }
 
 const MacroAssembler&
 MacroAssemblerMIPSShared::asMasm() const
 {
     return *static_cast<const MacroAssembler*>(this);
 }
 
+// clang-format off
 //{{{ check_macroassembler_style
 // ===============================================================
 // MacroAssembler high-level usage.
 
 void
 MacroAssembler::flush()
 {
 }
@@ -2923,8 +2924,9 @@ MacroAssembler::flexibleDivMod32(Registe
 // Spectre Mitigations.
 
 void
 MacroAssembler::speculationBarrier()
 {
     MOZ_CRASH();
 }
 //}}} check_macroassembler_style
+// clang-format on
--- a/js/src/jit/mips32/MacroAssembler-mips32-inl.h
+++ b/js/src/jit/mips32/MacroAssembler-mips32-inl.h
@@ -9,16 +9,17 @@
 
 #include "jit/mips32/MacroAssembler-mips32.h"
 
 #include "jit/mips-shared/MacroAssembler-mips-shared-inl.h"
 
 namespace js {
 namespace jit {
 
+// clang-format off
 //{{{ check_macroassembler_style
 
 void
 MacroAssembler::move64(Register64 src, Register64 dest)
 {
     move32(src.low, dest.low);
     move32(src.high, dest.high);
 }
@@ -1006,16 +1007,17 @@ MacroAssembler::branchTruncateFloat32May
     as_truncws(ScratchFloat32Reg, src);
     as_cfc1(ScratchRegister, Assembler::FCSR);
     moveFromFloat32(ScratchFloat32Reg, dest);
     ma_ext(ScratchRegister, ScratchRegister, Assembler::CauseV, 1);
     ma_b(ScratchRegister, Imm32(0), fail, Assembler::NotEqual);
 }
 
 //}}} check_macroassembler_style
+// clang-format on
 // ===============================================================
 
 void
 MacroAssemblerMIPSCompat::incrementInt32Value(const Address& addr)
 {
     asMasm().add32(Imm32(1), ToPayload(addr));
 }
 
--- a/js/src/jit/mips32/MacroAssembler-mips32.cpp
+++ b/js/src/jit/mips32/MacroAssembler-mips32.cpp
@@ -2104,16 +2104,17 @@ MacroAssemblerMIPSCompat::profilerExitFr
 void
 MacroAssembler::subFromStackPtr(Imm32 imm32)
 {
     if (imm32.value) {
         asMasm().subPtr(imm32, StackPointer);
     }
 }
 
+// clang-format on
 //{{{ check_macroassembler_style
 // ===============================================================
 // Stack manipulation functions.
 
 void
 MacroAssembler::PushRegsInMask(LiveRegisterSet set)
 {
     int32_t diffF = set.fpus().getPushSizeInBytes();
@@ -2962,8 +2963,9 @@ MacroAssembler::convertUInt64ToDouble(Re
     convertUInt32ToDouble(src.high, dest);
     loadConstantDouble(TO_DOUBLE_HIGH_SCALE, ScratchDoubleReg);
     mulDouble(ScratchDoubleReg, dest);
     convertUInt32ToDouble(src.low, ScratchDoubleReg);
     addDouble(ScratchDoubleReg, dest);
 }
 
 //}}} check_macroassembler_style
+// clang-format on
--- a/js/src/jit/mips64/MacroAssembler-mips64-inl.h
+++ b/js/src/jit/mips64/MacroAssembler-mips64-inl.h
@@ -9,16 +9,17 @@
 
 #include "jit/mips64/MacroAssembler-mips64.h"
 
 #include "jit/mips-shared/MacroAssembler-mips-shared-inl.h"
 
 namespace js {
 namespace jit {
 
+// clang-format off
 //{{{ check_macroassembler_style
 
 void
 MacroAssembler::move64(Register64 src, Register64 dest)
 {
     movePtr(src.reg, dest.reg);
 }
 
@@ -753,16 +754,17 @@ MacroAssembler::branchTruncateFloat32May
     moveFromDouble(ScratchDoubleReg, dest);
     ma_ext(ScratchRegister, ScratchRegister, Assembler::CauseV, 1);
     ma_b(ScratchRegister, Imm32(0), fail, Assembler::NotEqual);
 
     as_sll(dest, dest, 0);
 }
 
 //}}} check_macroassembler_style
+// clang-format on
 // ===============================================================
 
 // The specializations for cmpPtrSet are outside the braces because check_macroassembler_style can't yet
 // deal with specializations.
 
 template<>
 inline void
 MacroAssembler::cmpPtrSet(Assembler::Condition cond, Address lhs, ImmPtr rhs,
--- a/js/src/jit/mips64/MacroAssembler-mips64.cpp
+++ b/js/src/jit/mips64/MacroAssembler-mips64.cpp
@@ -1943,16 +1943,17 @@ MacroAssemblerMIPS64Compat::profilerExit
 void
 MacroAssembler::subFromStackPtr(Imm32 imm32)
 {
     if (imm32.value) {
         asMasm().subPtr(imm32, StackPointer);
     }
 }
 
+// clang-format off
 //{{{ check_macroassembler_style
 // ===============================================================
 // Stack manipulation functions.
 
 void
 MacroAssembler::PushRegsInMask(LiveRegisterSet set)
 {
     int32_t diff = set.gprs().size() * sizeof(intptr_t) +
@@ -2754,8 +2755,9 @@ MacroAssembler::convertUInt64ToFloat32(R
     bind(&positive);
     as_dmtc1(src, dest);
     as_cvtsl(dest, dest);
 
     bind(&done);
 }
 
 //}}} check_macroassembler_style
+// clang-format on
--- a/js/src/jit/x64/MacroAssembler-x64-inl.h
+++ b/js/src/jit/x64/MacroAssembler-x64-inl.h
@@ -9,16 +9,17 @@
 
 #include "jit/x64/MacroAssembler-x64.h"
 
 #include "jit/x86-shared/MacroAssembler-x86-shared-inl.h"
 
 namespace js {
 namespace jit {
 
+// clang-format off
 //{{{ check_macroassembler_style
 // ===============================================================
 
 void
 MacroAssembler::move64(Imm64 imm, Register64 dest)
 {
     movq(ImmWord(imm.value), dest.reg);
 }
@@ -959,16 +960,17 @@ MacroAssembler::truncateDoubleToUInt64(A
     loadPtr(dest, temp);
     or64(Imm64(0x8000000000000000), Register64(temp));
     storePtr(temp, dest);
 
     bind(&done);
 }
 
 //}}} check_macroassembler_style
+// clang-format on
 // ===============================================================
 
 void
 MacroAssemblerX64::incrementInt32Value(const Address& addr)
 {
     asMasm().addPtr(Imm32(1), addr);
 }
 
--- a/js/src/jit/x64/MacroAssembler-x64.cpp
+++ b/js/src/jit/x64/MacroAssembler-x64.cpp
@@ -298,16 +298,17 @@ MacroAssembler::subFromStackPtr(Imm32 im
             amountLeft -= fullPages * 4096;
             if (amountLeft) {
                 subq(Imm32(amountLeft), StackPointer);
             }
         }
     }
 }
 
+// clang-format off
 //{{{ check_macroassembler_style
 // ===============================================================
 // ABI function calls.
 
 void
 MacroAssembler::setupUnalignedABICall(Register scratch)
 {
     MOZ_ASSERT(!IsCompilingWasm(), "wasm should only use aligned ABI calls");
@@ -1033,8 +1034,9 @@ MacroAssembler::wasmAtomicEffectOp64(con
       case AtomicFetchAndOp: lock_andq(value.reg, Operand(mem)); break;
       case AtomicFetchOrOp:  lock_orq(value.reg, Operand(mem)); break;
       case AtomicFetchXorOp: lock_xorq(value.reg, Operand(mem)); break;
       default:               MOZ_CRASH();
     }
 }
 
 //}}} check_macroassembler_style
+// clang-format on
--- a/js/src/jit/x86-shared/MacroAssembler-x86-shared-inl.h
+++ b/js/src/jit/x86-shared/MacroAssembler-x86-shared-inl.h
@@ -7,16 +7,17 @@
 #ifndef jit_x86_shared_MacroAssembler_x86_shared_inl_h
 #define jit_x86_shared_MacroAssembler_x86_shared_inl_h
 
 #include "jit/x86-shared/MacroAssembler-x86-shared.h"
 
 namespace js {
 namespace jit {
 
+// clang-format off
 //{{{ check_macroassembler_style
 // ===============================================================
 // Move instructions
 
 void
 MacroAssembler::moveFloat32ToGPR(FloatRegister src, Register dest)
 {
     vmovd(src, dest);
@@ -1326,14 +1327,15 @@ MacroAssembler::clampIntToUint8(Register
         sarl(Imm32(31), reg);
         notl(reg);
         andl(Imm32(255), reg);
     }
     bind(&inRange);
 }
 
 //}}} check_macroassembler_style
+// clang-format on
 // ===============================================================
 
 } // namespace jit
 } // namespace js
 
 #endif /* jit_x86_shared_MacroAssembler_x86_shared_inl_h */
--- a/js/src/jit/x86-shared/MacroAssembler-x86-shared.cpp
+++ b/js/src/jit/x86-shared/MacroAssembler-x86-shared.cpp
@@ -265,16 +265,17 @@ MacroAssemblerX86Shared::minMaxFloat32(F
         vmaxss(second, first, first);
     } else {
         vminss(second, first, first);
     }
 
     bind(&done);
 }
 
+// clang-format off
 //{{{ check_macroassembler_style
 // ===============================================================
 // MacroAssembler high-level usage.
 
 void
 MacroAssembler::flush()
 {
 }
@@ -1668,8 +1669,9 @@ MacroAssembler::speculationBarrier()
 {
     // Spectre mitigation recommended by Intel and AMD suggest to use lfence as
     // a way to force all speculative execution of instructions to end.
     MOZ_ASSERT(HasSSE2());
     masm.lfence();
 }
 
 //}}} check_macroassembler_style
+// clang-format on
--- a/js/src/jit/x86/MacroAssembler-x86-inl.h
+++ b/js/src/jit/x86/MacroAssembler-x86-inl.h
@@ -9,16 +9,17 @@
 
 #include "jit/x86/MacroAssembler-x86.h"
 
 #include "jit/x86-shared/MacroAssembler-x86-shared-inl.h"
 
 namespace js {
 namespace jit {
 
+// clang-format off
 //{{{ check_macroassembler_style
 
 void
 MacroAssembler::move64(Imm64 imm, Register64 dest)
 {
     movl(Imm32(imm.value & 0xFFFFFFFFL), dest.low);
     movl(Imm32((imm.value >> 32) & 0xFFFFFFFFL), dest.high);
 }
@@ -1177,16 +1178,17 @@ MacroAssembler::truncateDoubleToUInt64(A
     load32(HighWord(dest), temp);
     orl(Imm32(0x80000000), temp);
     store32(temp, HighWord(dest));
 
     bind(&done);
 }
 
 //}}} check_macroassembler_style
+// clang-format on
 // ===============================================================
 
 // Note: this function clobbers the source register.
 void
 MacroAssemblerX86::convertUInt32ToDouble(Register src, FloatRegister dest)
 {
     // src is [0, 2^32-1]
     subl(Imm32(0x80000000), src);
--- a/js/src/jit/x86/MacroAssembler-x86.cpp
+++ b/js/src/jit/x86/MacroAssembler-x86.cpp
@@ -297,16 +297,17 @@ MacroAssembler::subFromStackPtr(Imm32 im
             }
 
             // Restore scratch register.
             movl(Operand(StackPointer, uint32_t(imm32.value) - 4), eax);
         }
     }
 }
 
+// clang-format off
 //{{{ check_macroassembler_style
 // ===============================================================
 // ABI function calls.
 
 void
 MacroAssembler::setupUnalignedABICall(Register scratch)
 {
     MOZ_ASSERT(!IsCompilingWasm(), "wasm should only use aligned ABI calls");
@@ -1276,9 +1277,10 @@ MacroAssembler::convertInt64ToFloat32(Re
     fild(Operand(esp, 0));
 
     fstp32(Operand(esp, 0));
     vmovss(Address(esp, 0), output);
     freeStack(2 * sizeof(intptr_t));
 }
 
 //}}} check_macroassembler_style
+// clang-format on