Bug 1203964 - Part 2: Move MacroAssembler::rshiftPtrArithmetic into generic macro assembler. r=jandem
authorTooru Fujisawa <arai_a@mac.com>
Sat, 12 Sep 2015 11:11:39 +0900
changeset 296097 87d424cf36cab9daabb68552f54cd2782eb2167a
parent 296096 354d9854c2792868732db1509cef3477891b8fad
child 296098 ce2d4944e071e2a05c572d97e86c7542b8952aec
push id5245
push userraliiev@mozilla.com
push dateThu, 29 Oct 2015 11:30:51 +0000
treeherdermozilla-beta@dac831dc1bd0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjandem
bugs1203964
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 1203964 - Part 2: Move MacroAssembler::rshiftPtrArithmetic into generic macro assembler. r=jandem
js/src/jit/MacroAssembler.h
js/src/jit/arm/MacroAssembler-arm-inl.h
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.h
js/src/jit/none/MacroAssembler-none.h
js/src/jit/x64/MacroAssembler-x64-inl.h
js/src/jit/x64/MacroAssembler-x64.h
js/src/jit/x86/MacroAssembler-x86-inl.h
js/src/jit/x86/MacroAssembler-x86.h
--- a/js/src/jit/MacroAssembler.h
+++ b/js/src/jit/MacroAssembler.h
@@ -698,16 +698,18 @@ class MacroAssembler : public MacroAssem
     inline void xorPtr(Imm32 imm, Register dest) PER_ARCH;
 
     // ===============================================================
     // Shift functions
 
     inline void rshiftPtr(Imm32 imm, Register dest) PER_ARCH;
     inline void rshiftPtr(Imm32 imm, Register src, Register dest) DEFINED_ON(arm64);
 
+    inline void rshiftPtrArithmetic(Imm32 imm, Register dest) PER_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
@@ -132,15 +132,21 @@ MacroAssembler::xorPtr(Imm32 imm, Regist
 // Shift functions
 
 void
 MacroAssembler::rshiftPtr(Imm32 imm, Register dest)
 {
     ma_lsr(imm, dest, dest);
 }
 
+void
+MacroAssembler::rshiftPtrArithmetic(Imm32 imm, Register dest)
+{
+    ma_asr(imm, dest, dest);
+}
+
 //}}} check_macroassembler_style
 // ===============================================================
 
 } // namespace jit
 } // namespace js
 
 #endif /* jit_arm_MacroAssembler_arm_inl_h */
--- a/js/src/jit/arm/MacroAssembler-arm.h
+++ b/js/src/jit/arm/MacroAssembler-arm.h
@@ -1711,19 +1711,16 @@ class MacroAssemblerARMCompat : public M
                       Label* label);
 
     void compareFloat(FloatRegister lhs, FloatRegister rhs);
     void branchFloat(DoubleCondition cond, FloatRegister lhs, FloatRegister rhs,
                      Label* label);
 
     void checkStackAlignment();
 
-    void rshiftPtrArithmetic(Imm32 imm, Register dest) {
-        ma_asr(imm, dest, dest);
-    }
     void rshift64(Imm32 imm, Register64 dest) {
         as_mov(dest.low, lsr(dest.low, imm.value));
         as_orr(dest.low, dest.low, lsl(dest.high, 32 - imm.value));
         as_mov(dest.high, lsr(dest.high, imm.value));
     }
     void lshiftPtr(Imm32 imm, Register dest) {
         ma_lsl(imm, dest, dest);
     }
--- a/js/src/jit/arm64/MacroAssembler-arm64-inl.h
+++ b/js/src/jit/arm64/MacroAssembler-arm64-inl.h
@@ -151,16 +151,22 @@ MacroAssembler::rshiftPtr(Imm32 imm, Reg
 }
 
 void
 MacroAssembler::rshiftPtr(Imm32 imm, Register src, Register dest)
 {
     Lsr(ARMRegister(dest, 64), ARMRegister(src, 64), imm.value);
 }
 
+void
+MacroAssembler::rshiftPtrArithmetic(Imm32 imm, Register dest)
+{
+    Asr(ARMRegister(dest, 64), ARMRegister(dest, 64), imm.value);
+}
+
 //}}} check_macroassembler_style
 // ===============================================================
 
 void
 MacroAssemblerCompat::rshift64(Imm32 imm, Register64 dest)
 {
     asMasm().rshiftPtr(imm, dest.reg);
 }
--- a/js/src/jit/arm64/MacroAssembler-arm64.h
+++ b/js/src/jit/arm64/MacroAssembler-arm64.h
@@ -1066,19 +1066,16 @@ class MacroAssemblerCompat : public vixl
     }
     template <typename T>
     void branchStackPtrRhs(Condition cond, T lhs, Label* label) {
         branchPtr(cond, lhs, getStackPointer(), label);
     }
 
     inline void rshift64(Imm32 imm, Register64 dest);
 
-    void rshiftPtrArithmetic(Imm32 imm, Register dest) {
-        Asr(ARMRegister(dest, 64), ARMRegister(dest, 64), imm.value);
-    }
     void lshiftPtr(Imm32 imm, Register dest) {
         Lsl(ARMRegister(dest, 64), ARMRegister(dest, 64), imm.value);
     }
     void lshift64(Imm32 imm, Register64 dest) {
         lshiftPtr(imm, dest.reg);
     }
 
     void testPtr(Register lhs, Register rhs) {
--- a/js/src/jit/mips32/MacroAssembler-mips32-inl.h
+++ b/js/src/jit/mips32/MacroAssembler-mips32-inl.h
@@ -129,15 +129,21 @@ MacroAssembler::xorPtr(Imm32 imm, Regist
 // Shift functions
 
 void
 MacroAssembler::rshiftPtr(Imm32 imm, Register dest)
 {
     ma_srl(dest, dest, imm);
 }
 
+void
+MacroAssembler::rshiftPtrArithmetic(Imm32 imm, Register dest)
+{
+    ma_sra(dest, dest, imm);
+}
+
 //}}} check_macroassembler_style
 // ===============================================================
 
 } // namespace jit
 } // namespace js
 
 #endif /* jit_mips32_MacroAssembler_mips32_inl_h */
--- a/js/src/jit/mips32/MacroAssembler-mips32.h
+++ b/js/src/jit/mips32/MacroAssembler-mips32.h
@@ -1344,19 +1344,16 @@ class MacroAssemblerMIPSCompat : public 
                      Label* label);
 
     void checkStackAlignment();
 
     void alignStackPointer();
     void restoreStackPointer();
     static void calculateAlignedStackPointer(void** stackPointer);
 
-    void rshiftPtrArithmetic(Imm32 imm, Register dest) {
-        ma_sra(dest, dest, imm);
-    }
     void rshift64(Imm32 imm, Register64 dest) {
         as_srl(dest.low, dest.low, imm.value);
         as_sll(ScratchRegister, dest.high, 32 - imm.value);
         as_or(dest.low, dest.low, ScratchRegister);
         as_srl(dest.high, dest.high, imm.value);
     }
     void lshiftPtr(Imm32 imm, Register dest) {
         ma_sll(dest, dest, imm);
--- a/js/src/jit/none/MacroAssembler-none.h
+++ b/js/src/jit/none/MacroAssembler-none.h
@@ -417,17 +417,16 @@ class MacroAssemblerNone : public Assemb
     void branchTestBooleanTruthy(bool, ValueOperand, Label*) { MOZ_CRASH(); }
     void branchTestStringTruthy(bool, ValueOperand, Label*) { MOZ_CRASH(); }
     void branchTestDoubleTruthy(bool, FloatRegister, Label*) { MOZ_CRASH(); }
 
     template <typename T> void loadUnboxedValue(T, MIRType, AnyRegister) { MOZ_CRASH(); }
     template <typename T> void storeUnboxedValue(ConstantOrRegister, MIRType, T, MIRType) { MOZ_CRASH(); }
     template <typename T> void storeUnboxedPayload(ValueOperand value, T, size_t) { MOZ_CRASH(); }
 
-    void rshiftPtrArithmetic(Imm32, Register) { MOZ_CRASH(); }
     void lshiftPtr(Imm32, Register) { 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/x64/MacroAssembler-x64-inl.h
+++ b/js/src/jit/x64/MacroAssembler-x64-inl.h
@@ -70,15 +70,21 @@ MacroAssembler::xorPtr(Imm32 imm, Regist
 // Shift functions
 
 void
 MacroAssembler::rshiftPtr(Imm32 imm, Register dest)
 {
     shrq(imm, dest);
 }
 
+void
+MacroAssembler::rshiftPtrArithmetic(Imm32 imm, Register dest)
+{
+    sarq(imm, dest);
+}
+
 //}}} check_macroassembler_style
 // ===============================================================
 
 } // namespace jit
 } // namespace js
 
 #endif /* jit_x64_MacroAssembler_x64_inl_h */
--- a/js/src/jit/x64/MacroAssembler-x64.h
+++ b/js/src/jit/x64/MacroAssembler-x64.h
@@ -845,19 +845,16 @@ class MacroAssemblerX64 : public MacroAs
             ScratchRegisterScope scratch(asMasm());
             mov(ImmPtr(address.addr), scratch);
             store32(src, Address(scratch, 0x0));
         }
     }
     void store64(Register64 src, Address address) {
         movq(src.reg, Operand(address));
     }
-    void rshiftPtrArithmetic(Imm32 imm, Register dest) {
-        sarq(imm, dest);
-    }
     void rshift64(Imm32 imm, Register64 dest) {
         shrq(imm, dest.reg);
     }
     void lshiftPtr(Imm32 imm, Register dest) {
         shlq(imm, dest);
     }
     void lshift64(Imm32 imm, Register64 dest) {
         shlq(imm, dest.reg);
--- a/js/src/jit/x86/MacroAssembler-x86-inl.h
+++ b/js/src/jit/x86/MacroAssembler-x86-inl.h
@@ -71,15 +71,21 @@ MacroAssembler::xorPtr(Imm32 imm, Regist
 // Shift functions
 
 void
 MacroAssembler::rshiftPtr(Imm32 imm, Register dest)
 {
     shrl(imm, dest);
 }
 
+void
+MacroAssembler::rshiftPtrArithmetic(Imm32 imm, Register dest)
+{
+    sarl(imm, dest);
+}
+
 //}}} check_macroassembler_style
 // ===============================================================
 
 } // namespace jit
 } // namespace js
 
 #endif /* jit_x86_MacroAssembler_x86_inl_h */
--- a/js/src/jit/x86/MacroAssembler-x86.h
+++ b/js/src/jit/x86/MacroAssembler-x86.h
@@ -1117,19 +1117,16 @@ class MacroAssemblerX86 : public MacroAs
             return;
           case 1:
             store8(value.payloadReg(), address);
             return;
           default: MOZ_CRASH("Bad payload width");
         }
     }
 
-    void rshiftPtrArithmetic(Imm32 imm, Register dest) {
-        sarl(imm, dest);
-    }
     void rshift64(Imm32 imm, Register64 dest) {
         shrdl(imm, dest.high, dest.low);
         shrl(imm, dest.high);
     }
     void lshiftPtr(Imm32 imm, Register dest) {
         shll(imm, dest);
     }
     void lshift64(Imm32 imm, Register64 dest) {