Bug 1199719 part 4 - Move MacroAssembler::or32 into the generic macro assembler. r=hev
☠☠ backed out by f11cf71a5cca ☠ ☠
authorNicolas B. Pierron <nicolas.b.pierron@mozilla.com>
Thu, 10 Sep 2015 22:36:13 +0200
changeset 296174 e5ec584b2b69b67441323978746403c45bb53423
parent 296173 399f2af808f36cc0c163edd099ca2cb1268028cd
child 296175 da69d8d082af861eb8280c41dab94df9b4b039e4
push id962
push userjlund@mozilla.com
push dateFri, 04 Dec 2015 23:28:54 +0000
treeherdermozilla-release@23a2d286e80f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewershev
bugs1199719
milestone43.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 1199719 part 4 - Move MacroAssembler::or32 into the generic macro assembler. r=hev
js/src/jit/MacroAssembler.h
js/src/jit/arm/MacroAssembler-arm-inl.h
js/src/jit/arm/MacroAssembler-arm.cpp
js/src/jit/arm/MacroAssembler-arm.h
js/src/jit/arm64/MacroAssembler-arm64-inl.h
js/src/jit/arm64/MacroAssembler-arm64.h
js/src/jit/mips32/MacroAssembler-mips32-inl.h
js/src/jit/mips32/MacroAssembler-mips32.cpp
js/src/jit/mips32/MacroAssembler-mips32.h
js/src/jit/none/MacroAssembler-none.h
js/src/jit/x86-shared/MacroAssembler-x86-shared-inl.h
js/src/jit/x86-shared/MacroAssembler-x86-shared.h
--- a/js/src/jit/MacroAssembler.h
+++ b/js/src/jit/MacroAssembler.h
@@ -673,16 +673,20 @@ class MacroAssembler : public MacroAssem
     inline void and32(Imm32 imm, Register dest) PER_SHARED_ARCH;
     inline void and32(Imm32 imm, Register src, Register dest) DEFINED_ON(arm64);
     inline void and32(Imm32 imm, const Address& dest) PER_SHARED_ARCH;
     inline void and32(const Address& src, Register dest) PER_SHARED_ARCH;
 
     inline void andPtr(Register src, Register dest) PER_ARCH;
     inline void andPtr(Imm32 imm, Register dest) PER_ARCH;
 
+    inline void or32(Register src, Register dest) PER_SHARED_ARCH;
+    inline void or32(Imm32 imm, Register dest) PER_SHARED_ARCH;
+    inline void or32(Imm32 imm, const Address& dest) PER_SHARED_ARCH;
+
     //}}} check_macroassembler_style
   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 scratch, Label* miss);
 
--- a/js/src/jit/arm/MacroAssembler-arm-inl.h
+++ b/js/src/jit/arm/MacroAssembler-arm-inl.h
@@ -52,22 +52,64 @@ MacroAssembler::andPtr(Register src, Reg
 }
 
 void
 MacroAssembler::andPtr(Imm32 imm, Register dest)
 {
     ma_and(imm, dest);
 }
 
+void
+MacroAssembler::or32(Register src, Register dest)
+{
+    ma_orr(src, dest);
+}
+
+void
+MacroAssembler::or32(Imm32 imm, Register dest)
+{
+    ma_orr(imm, dest);
+}
+
+void
+MacroAssembler::or32(Imm32 imm, const Address& dest)
+{
+    ScratchRegisterScope scratch(*this);
+    load32(dest, scratch);
+    ma_orr(imm, scratch);
+    store32(scratch, dest);
+}
+
 //}}} check_macroassembler_style
 // ===============================================================
 
 void
+MacroAssemblerARMCompat::branchTest64(Condition cond, Register64 lhs, Register64 rhs, Register temp, Label* label)
+{
+    if (cond == Assembler::Zero) {
+        MOZ_ASSERT(lhs.low == rhs.low);
+        MOZ_ASSERT(lhs.high == rhs.high);
+        mov(lhs.low, ScratchRegister);
+        asMasm().or32(lhs.high, ScratchRegister);
+        branchTestPtr(cond, ScratchRegister, ScratchRegister, label);
+    } else {
+        MOZ_CRASH("Unsupported condition");
+    }
+}
+
+void
 MacroAssemblerARMCompat::and64(Imm64 imm, Register64 dest)
 {
     asMasm().and32(Imm32(imm.value & 0xFFFFFFFFL), dest.low);
     asMasm().and32(Imm32((imm.value >> 32) & 0xFFFFFFFFL), dest.high);
 }
 
+void
+MacroAssemblerARMCompat::or64(Register64 src, Register64 dest)
+{
+    asMasm().or32(src.low, dest.low);
+    asMasm().or32(src.high, dest.high);
+}
+
 } // namespace jit
 } // namespace js
 
 #endif /* jit_arm_MacroAssembler_arm_inl_h */
--- a/js/src/jit/arm/MacroAssembler-arm.cpp
+++ b/js/src/jit/arm/MacroAssembler-arm.cpp
@@ -1968,37 +1968,16 @@ MacroAssemblerARMCompat::addPtr(const Ad
 
 void
 MacroAssemblerARMCompat::not32(Register reg)
 {
     ma_mvn(reg, reg);
 }
 
 void
-MacroAssemblerARMCompat::or32(Imm32 imm, const Address& dest)
-{
-    ScratchRegisterScope scratch(asMasm());
-    load32(dest, scratch);
-    ma_orr(imm, scratch);
-    store32(scratch, dest);
-}
-
-void
-MacroAssemblerARMCompat::or32(Imm32 imm, Register dest)
-{
-    ma_orr(imm, dest);
-}
-
-void
-MacroAssemblerARMCompat::or32(Register src, Register dest)
-{
-    ma_orr(src, dest);
-}
-
-void
 MacroAssemblerARMCompat::xorPtr(Imm32 imm, Register dest)
 {
     ma_eor(imm, dest);
 }
 
 void
 MacroAssemblerARMCompat::xorPtr(Register src, Register dest)
 {
--- a/js/src/jit/arm/MacroAssembler-arm.h
+++ b/js/src/jit/arm/MacroAssembler-arm.h
@@ -982,27 +982,17 @@ class MacroAssemblerARMCompat : public M
     }
     void branchPtr(Condition cond, Register lhs, Imm32 imm, Label* label) {
         branch32(cond, lhs, imm, label);
     }
     void decBranchPtr(Condition cond, Register lhs, Imm32 imm, Label* label) {
         subPtr(imm, lhs);
         branch32(cond, lhs, Imm32(0), label);
     }
-    void branchTest64(Condition cond, Register64 lhs, Register64 rhs, Register temp, Label* label) {
-        if (cond == Assembler::Zero) {
-            MOZ_ASSERT(lhs.low == rhs.low);
-            MOZ_ASSERT(lhs.high == rhs.high);
-            mov(lhs.low, ScratchRegister);
-            or32(lhs.high, ScratchRegister);
-            branchTestPtr(cond, ScratchRegister, ScratchRegister, label);
-        } else {
-            MOZ_CRASH("Unsupported condition");
-        }
-    }
+    inline void branchTest64(Condition cond, Register64 lhs, Register64 rhs, Register temp, Label* label);
     void moveValue(const Value& val, Register type, Register data);
 
     CodeOffsetJump jumpWithPatch(RepatchLabel* label, Condition cond = Always,
                                  Label* documentation = nullptr);
     CodeOffsetJump backedgeJump(RepatchLabel* label, Label* documentation) {
         return jumpWithPatch(label, Always, documentation);
     }
     template <typename T>
@@ -1209,27 +1199,21 @@ class MacroAssemblerARMCompat : public M
     template <typename T>
     void branchSub32(Condition cond, T src, Register dest, Label* label) {
         sub32(src, dest);
         j(cond, label);
     }
     void xor32(Imm32 imm, Register dest);
 
     inline void and64(Imm64 imm, Register64 dest);
-    void or32(Register src, Register dest);
-    void or32(Imm32 imm, Register dest);
-    void or32(Imm32 imm, const Address& dest);
+    inline void or64(Register64 src, Register64 dest);
     void xorPtr(Imm32 imm, Register dest);
     void xorPtr(Register src, Register dest);
     void orPtr(Imm32 imm, Register dest);
     void orPtr(Register src, Register dest);
-    void or64(Register64 src, Register64 dest) {
-        or32(src.low, dest.low);
-        or32(src.high, dest.high);
-    }
     void addPtr(Register src, Register dest);
     void addPtr(const Address& src, Register dest);
     void add64(Imm32 imm, Register64 dest) {
         ma_add(imm, dest.low, SetCC);
         ma_adc(Imm32(0), dest.high, LeaveCC);
     }
     void not32(Register reg);
 
--- a/js/src/jit/arm64/MacroAssembler-arm64-inl.h
+++ b/js/src/jit/arm64/MacroAssembler-arm64-inl.h
@@ -62,16 +62,39 @@ MacroAssembler::andPtr(Register src, Reg
 }
 
 void
 MacroAssembler::andPtr(Imm32 imm, Register dest)
 {
     And(ARMRegister(dest, 64), ARMRegister(dest, 64), Operand(imm.value));
 }
 
+void
+MacroAssembler::or32(Imm32 imm, Register dest)
+{
+    Orr(ARMRegister(dest, 32), ARMRegister(dest, 32), Operand(imm.value));
+}
+
+void
+MacroAssembler::or32(Register src, Register dest)
+{
+    Orr(ARMRegister(dest, 32), ARMRegister(dest, 32), Operand(ARMRegister(src, 32)));
+}
+
+void
+MacroAssembler::or32(Imm32 imm, const Address& dest)
+{
+    vixl::UseScratchRegisterScope temps(this);
+    const ARMRegister scratch32 = temps.AcquireW();
+    MOZ_ASSERT(scratch32.asUnsized() != dest.base);
+    load32(dest, scratch32.asUnsized());
+    Orr(scratch32, scratch32, Operand(imm.value));
+    store32(scratch32.asUnsized(), dest);
+}
+
 //}}} check_macroassembler_style
 // ===============================================================
 
 void
 MacroAssemblerCompat::and64(Imm64 imm, Register64 dest)
 {
     vixl::UseScratchRegisterScope temps(this);
     const Register scratch = temps.AcquireX().asUnsized();
--- a/js/src/jit/arm64/MacroAssembler-arm64.h
+++ b/js/src/jit/arm64/MacroAssembler-arm64.h
@@ -1105,30 +1105,16 @@ class MacroAssemblerCompat : public vixl
         Orr(ARMRegister(dest, 64), ARMRegister(dest, 64), Operand(imm.value));
     }
     void orPtr(Imm32 imm, Register dest) {
         Orr(ARMRegister(dest, 64), ARMRegister(dest, 64), Operand(imm.value));
     }
     void orPtr(Register src, Register dest) {
         Orr(ARMRegister(dest, 64), ARMRegister(dest, 64), Operand(ARMRegister(src, 64)));
     }
-    void or32(Imm32 imm, Register dest) {
-        Orr(ARMRegister(dest, 32), ARMRegister(dest, 32), Operand(imm.value));
-    }
-    void or32(Register src, Register dest) {
-        Orr(ARMRegister(dest, 32), ARMRegister(dest, 32), Operand(ARMRegister(src, 32)));
-    }
-    void or32(Imm32 imm, const Address& dest) {
-        vixl::UseScratchRegisterScope temps(this);
-        const ARMRegister scratch32 = temps.AcquireW();
-        MOZ_ASSERT(scratch32.asUnsized() != dest.base);
-        load32(dest, scratch32.asUnsized());
-        Orr(scratch32, scratch32, Operand(imm.value));
-        store32(scratch32.asUnsized(), dest);
-    }
     void or64(Register64 src, Register64 dest) {
         orPtr(src.reg, dest.reg);
     }
     inline void and64(Imm64 imm, Register64 dest);
 
     void testPtr(Register lhs, Register rhs) {
         Tst(ARMRegister(lhs, 64), Operand(ARMRegister(rhs, 64)));
     }
--- a/js/src/jit/mips32/MacroAssembler-mips32-inl.h
+++ b/js/src/jit/mips32/MacroAssembler-mips32-inl.h
@@ -50,22 +50,49 @@ MacroAssembler::andPtr(Register src, Reg
 }
 
 void
 MacroAssembler::andPtr(Imm32 imm, Register dest)
 {
     ma_and(dest, imm);
 }
 
+void
+MacroAssembler::or32(Register src, Register dest)
+{
+    ma_or(dest, src);
+}
+
+void
+MacroAssembler::or32(Imm32 imm, Register dest)
+{
+    ma_or(dest, imm);
+}
+
+void
+MacroAssembler::or32(Imm32 imm, const Address& dest)
+{
+    load32(dest, SecondScratchReg);
+    ma_or(SecondScratchReg, imm);
+    store32(SecondScratchReg, dest);
+}
+
 //}}} check_macroassembler_style
 // ===============================================================
 
 void
 MacroAssemblerMIPSCompat::and64(Imm64 imm, Register64 dest)
 {
     asMasm().and32(Imm32(imm.value & LOW_32_MASK), dest.low);
     asMasm().and32(Imm32((imm.value >> 32) & LOW_32_MASK), dest.high);
 }
 
+void
+MacroAssemblerMIPSCompat::or64(Register64 src, Register64 dest)
+{
+    asMasm().or32(src.low, dest.low);
+    asMasm().or32(src.high, dest.high);
+}
+
 } // namespace jit
 } // namespace js
 
 #endif /* jit_mips32_MacroAssembler_mips32_inl_h */
--- a/js/src/jit/mips32/MacroAssembler-mips32.cpp
+++ b/js/src/jit/mips32/MacroAssembler-mips32.cpp
@@ -1626,37 +1626,16 @@ MacroAssemblerMIPSCompat::subPtr(Registe
 void
 MacroAssemblerMIPSCompat::not32(Register reg)
 {
     ma_not(reg, reg);
 }
 
 // Logical operations
 void
-MacroAssemblerMIPSCompat::or32(Imm32 imm, Register dest)
-{
-    ma_or(dest, imm);
-}
-
-
-void
-MacroAssemblerMIPSCompat::or32(Imm32 imm, const Address& dest)
-{
-    load32(dest, SecondScratchReg);
-    ma_or(SecondScratchReg, imm);
-    store32(SecondScratchReg, dest);
-}
-
-void
-MacroAssemblerMIPSCompat::or32(Register src, Register dest)
-{
-    ma_or(dest, src);
-}
-
-void
 MacroAssemblerMIPSCompat::xor32(Imm32 imm, Register dest)
 {
     ma_xor(dest, imm);
 }
 
 void
 MacroAssemblerMIPSCompat::xorPtr(Imm32 imm, Register dest)
 {
--- a/js/src/jit/mips32/MacroAssembler-mips32.h
+++ b/js/src/jit/mips32/MacroAssembler-mips32.h
@@ -1147,23 +1147,17 @@ public:
             ma_b(dest, dest, overflow, cond);
             break;
           default:
             MOZ_CRASH("NYI");
         }
     }
 
     inline void and64(Imm64 imm, Register64 dest);
-    void or32(Imm32 imm, Register dest);
-    void or32(Imm32 imm, const Address& dest);
-    void or32(Register src, Register dest);
-    void or64(Register64 src, Register64 dest) {
-        or32(src.low, dest.low);
-        or32(src.high, dest.high);
-    }
+    inline void or64(Register64 src, Register64 dest);
     void xor32(Imm32 imm, Register dest);
     void xorPtr(Imm32 imm, Register dest);
     void xorPtr(Register src, Register dest);
     void orPtr(Imm32 imm, Register dest);
     void orPtr(Register src, Register dest);
     void addPtr(Register src, Register dest);
     void subPtr(Register src, Register dest);
     void addPtr(const Address& src, Register dest);
--- a/js/src/jit/none/MacroAssembler-none.h
+++ b/js/src/jit/none/MacroAssembler-none.h
@@ -423,17 +423,16 @@ class MacroAssemblerNone : public Assemb
     template <typename T> void storeUnboxedPayload(ValueOperand value, T, size_t) { MOZ_CRASH(); }
 
     void rshiftPtr(Imm32, Register) { MOZ_CRASH(); }
     void rshiftPtrArithmetic(Imm32, Register) { MOZ_CRASH(); }
     void lshiftPtr(Imm32, Register) { MOZ_CRASH(); }
     template <typename T, typename S> void xorPtr(T, S) { MOZ_CRASH(); }
     template <typename T, typename S> void xor32(T, S) { MOZ_CRASH(); }
     template <typename T, typename S> void orPtr(T, S) { MOZ_CRASH(); }
-    template <typename T, typename S> void or32(T, S) { MOZ_CRASH(); }
     template <typename T> void not32(T) { MOZ_CRASH(); }
     void convertUInt32ToDouble(Register, FloatRegister) { MOZ_CRASH(); }
     void convertUInt32ToFloat32(Register, FloatRegister) { MOZ_CRASH(); }
     void inc64(AbsoluteAddress) { MOZ_CRASH(); }
     void incrementInt32Value(Address) { MOZ_CRASH(); }
     void ensureDouble(ValueOperand, FloatRegister, Label*) { MOZ_CRASH(); }
     void handleFailureWithHandlerTail(void*) { MOZ_CRASH(); }
 
--- a/js/src/jit/x86-shared/MacroAssembler-x86-shared-inl.h
+++ b/js/src/jit/x86-shared/MacroAssembler-x86-shared-inl.h
@@ -35,15 +35,33 @@ MacroAssembler::and32(Imm32 imm, const A
 }
 
 void
 MacroAssembler::and32(const Address& src, Register dest)
 {
     andl(Operand(src), dest);
 }
 
+void
+MacroAssembler::or32(Register src, Register dest)
+{
+    orl(src, dest);
+}
+
+void
+MacroAssembler::or32(Imm32 imm, Register dest)
+{
+    orl(imm, dest);
+}
+
+void
+MacroAssembler::or32(Imm32 imm, const Address& dest)
+{
+    orl(imm, Operand(dest));
+}
+
 //}}} check_macroassembler_style
 // ===============================================================
 
 } // namespace jit
 } // namespace js
 
 #endif /* jit_x86_shared_MacroAssembler_x86_shared_inl_h */
--- a/js/src/jit/x86-shared/MacroAssembler-x86-shared.h
+++ b/js/src/jit/x86-shared/MacroAssembler-x86-shared.h
@@ -118,25 +118,16 @@ class MacroAssemblerX86Shared : public A
         movl(imm, dest);
     }
     void move32(Register src, Register dest) {
         movl(src, dest);
     }
     void move32(Register src, const Operand& dest) {
         movl(src, dest);
     }
-    void or32(Register src, Register dest) {
-        orl(src, dest);
-    }
-    void or32(Imm32 imm, Register dest) {
-        orl(imm, dest);
-    }
-    void or32(Imm32 imm, const Address& dest) {
-        orl(imm, Operand(dest));
-    }
     void neg32(Register reg) {
         negl(reg);
     }
     void test32(Register lhs, Register rhs) {
         testl(rhs, lhs);
     }
     void test32(const Address& addr, Imm32 imm) {
         testl(imm, Operand(addr));