diff --git a/js/src/jit/MacroAssembler.h b/js/src/jit/MacroAssembler.h index 6fb86f2d3d2..62095ec64cd 100644 --- a/js/src/jit/MacroAssembler.h +++ b/js/src/jit/MacroAssembler.h @@ -841,6 +841,9 @@ class MacroAssembler : public MacroAssemblerSpecific // boxed inside a js::Value, with a raw pointer (rhs). inline void branchPrivatePtr(Condition cond, const Address& lhs, Register rhs, Label* label) PER_ARCH; + inline void branchTest64(Condition cond, Register64 lhs, Register64 rhs, Register temp, + Label* label) PER_ARCH; + //}}} check_macroassembler_style public: diff --git a/js/src/jit/arm/MacroAssembler-arm-inl.h b/js/src/jit/arm/MacroAssembler-arm-inl.h index 73cf58138b8..be86ee31ffa 100644 --- a/js/src/jit/arm/MacroAssembler-arm-inl.h +++ b/js/src/jit/arm/MacroAssembler-arm-inl.h @@ -575,6 +575,20 @@ MacroAssembler::branchPrivatePtr(Condition cond, const Address& lhs, Register rh branchPtr(cond, lhs, rhs, label); } +void +MacroAssembler::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); + ma_orr(lhs.low, lhs.high, ScratchRegister); + branchTestPtr(cond, ScratchRegister, ScratchRegister, label); + } else { + MOZ_CRASH("Unsupported condition"); + } +} + //}}} check_macroassembler_style // =============================================================== diff --git a/js/src/jit/arm/MacroAssembler-arm.cpp b/js/src/jit/arm/MacroAssembler-arm.cpp index d2da41a3cda..39e078949d9 100644 --- a/js/src/jit/arm/MacroAssembler-arm.cpp +++ b/js/src/jit/arm/MacroAssembler-arm.cpp @@ -3235,22 +3235,6 @@ template void MacroAssemblerARMCompat::storeUnboxedValue(ConstantOrRegister value, MIRType valueType, const BaseIndex& dest, MIRType slotType); - -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::moveValue(const Value& val, Register type, Register data) { diff --git a/js/src/jit/arm/MacroAssembler-arm.h b/js/src/jit/arm/MacroAssembler-arm.h index 88623c43c30..130b75c2053 100644 --- a/js/src/jit/arm/MacroAssembler-arm.h +++ b/js/src/jit/arm/MacroAssembler-arm.h @@ -878,7 +878,6 @@ class MacroAssemblerARMCompat : public MacroAssemblerARM ma_sub(imm, lhs, SetCC); as_b(label, cond); } - 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, diff --git a/js/src/jit/arm64/MacroAssembler-arm64-inl.h b/js/src/jit/arm64/MacroAssembler-arm64-inl.h index 373aebbb447..180d28390b9 100644 --- a/js/src/jit/arm64/MacroAssembler-arm64-inl.h +++ b/js/src/jit/arm64/MacroAssembler-arm64-inl.h @@ -652,6 +652,13 @@ MacroAssembler::branchPrivatePtr(Condition cond, const Address& lhs, Register rh branchPtr(cond, lhs, scratch, label); } +void +MacroAssembler::branchTest64(Condition cond, Register64 lhs, Register64 rhs, Register temp, + Label* label) +{ + branchTestPtr(cond, lhs.reg, rhs.reg, label); +} + //}}} check_macroassembler_style // =============================================================== diff --git a/js/src/jit/arm64/MacroAssembler-arm64.h b/js/src/jit/arm64/MacroAssembler-arm64.h index 7055c52f0a8..5636f4713e4 100644 --- a/js/src/jit/arm64/MacroAssembler-arm64.h +++ b/js/src/jit/arm64/MacroAssembler-arm64.h @@ -1641,9 +1641,6 @@ class MacroAssemblerCompat : public vixl::MacroAssembler Cmp(ARMRegister(value.valueReg(), 64), Operand(scratch64)); B(label, cond); } - void branchTest64(Condition cond, Register64 lhs, Register64 rhs, Register temp, Label* label) { - branchTestPtr(cond, lhs.reg, rhs.reg, label); - } void compareDouble(DoubleCondition cond, FloatRegister lhs, FloatRegister rhs) { Fcmp(ARMFPRegister(lhs, 64), ARMFPRegister(rhs, 64)); diff --git a/js/src/jit/mips32/MacroAssembler-mips32-inl.h b/js/src/jit/mips32/MacroAssembler-mips32-inl.h index 06ebf7a0601..327d26a0c2d 100644 --- a/js/src/jit/mips32/MacroAssembler-mips32-inl.h +++ b/js/src/jit/mips32/MacroAssembler-mips32-inl.h @@ -245,6 +245,20 @@ MacroAssembler::branchPrivatePtr(Condition cond, const Address& lhs, Register rh branchPtr(cond, lhs, rhs, label); } +void +MacroAssembler::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); + as_or(ScratchRegister, lhs.low, lhs.high); + branchTestPtr(cond, ScratchRegister, ScratchRegister, label); + } else { + MOZ_CRASH("Unsupported condition"); + } +} + //}}} check_macroassembler_style // =============================================================== diff --git a/js/src/jit/mips32/MacroAssembler-mips32.cpp b/js/src/jit/mips32/MacroAssembler-mips32.cpp index 56a9755e715..bbcc2045a4a 100644 --- a/js/src/jit/mips32/MacroAssembler-mips32.cpp +++ b/js/src/jit/mips32/MacroAssembler-mips32.cpp @@ -1731,20 +1731,6 @@ MacroAssemblerMIPSCompat::branchTestBooleanTruthy(bool b, const ValueOperand& op ma_b(operand.payloadReg(), operand.payloadReg(), label, b ? NonZero : Zero); } -void -MacroAssemblerMIPSCompat::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); - as_or(ScratchRegister, lhs.low, lhs.high); - branchTestPtr(cond, ScratchRegister, ScratchRegister, label); - } else { - MOZ_CRASH("Unsupported condition"); - } -} - Register MacroAssemblerMIPSCompat::extractObject(const Address& address, Register scratch) { diff --git a/js/src/jit/mips32/MacroAssembler-mips32.h b/js/src/jit/mips32/MacroAssembler-mips32.h index 6703a017cf2..7a609e33dd6 100644 --- a/js/src/jit/mips32/MacroAssembler-mips32.h +++ b/js/src/jit/mips32/MacroAssembler-mips32.h @@ -475,8 +475,6 @@ class MacroAssemblerMIPSCompat : public MacroAssemblerMIPS loadPtr(lhs, SecondScratchReg); branchTestPtr(cond, SecondScratchReg, imm, label); } - void branchTest64(Condition cond, Register64 lhs, Register64 rhs, Register temp, - Label* label); inline void decBranchPtr(Condition cond, Register lhs, Imm32 imm, Label* label); // higher level tag testing code diff --git a/js/src/jit/mips64/MacroAssembler-mips64-inl.h b/js/src/jit/mips64/MacroAssembler-mips64-inl.h index 8c1f6d18dc7..ae923aba8e9 100644 --- a/js/src/jit/mips64/MacroAssembler-mips64-inl.h +++ b/js/src/jit/mips64/MacroAssembler-mips64-inl.h @@ -190,6 +190,13 @@ MacroAssembler::branchPrivatePtr(Condition cond, const Address& lhs, Register rh branchPtr(cond, lhs, ScratchRegister, label); } +void +MacroAssembler::branchTest64(Condition cond, Register64 lhs, Register64 rhs, Register temp, + Label* label) +{ + branchTestPtr(cond, lhs.reg, rhs.reg, label); +} + //}}} check_macroassembler_style // =============================================================== diff --git a/js/src/jit/mips64/MacroAssembler-mips64.h b/js/src/jit/mips64/MacroAssembler-mips64.h index 2d10d1c8080..20e7008cf44 100644 --- a/js/src/jit/mips64/MacroAssembler-mips64.h +++ b/js/src/jit/mips64/MacroAssembler-mips64.h @@ -516,10 +516,6 @@ class MacroAssemblerMIPS64Compat : public MacroAssemblerMIPS64 loadPtr(lhs, SecondScratchReg); branchTestPtr(cond, SecondScratchReg, imm, label); } - void branchTest64(Condition cond, Register64 lhs, Register64 rhs, Register temp, - Label* label) { - branchTestPtr(cond, lhs.reg, rhs.reg, label); - } inline void decBranchPtr(Condition cond, Register lhs, Imm32 imm, Label* label); // higher level tag testing code diff --git a/js/src/jit/none/MacroAssembler-none.h b/js/src/jit/none/MacroAssembler-none.h index fff6cc112ae..461e9a49b4c 100644 --- a/js/src/jit/none/MacroAssembler-none.h +++ b/js/src/jit/none/MacroAssembler-none.h @@ -251,7 +251,6 @@ class MacroAssemblerNone : public Assembler template void branchDouble(DoubleCondition, T, S, Label*) { MOZ_CRASH(); } template void branchFloat(DoubleCondition, T, S, Label*) { MOZ_CRASH(); } template void decBranchPtr(Condition, T, S, Label*) { MOZ_CRASH(); } - template void branchTest64(Condition, T, T, S, Label*) { MOZ_CRASH(); } template void mov(T, S) { MOZ_CRASH(); } template void movq(T, S) { MOZ_CRASH(); } template void movePtr(T, S) { MOZ_CRASH(); } diff --git a/js/src/jit/x64/MacroAssembler-x64-inl.h b/js/src/jit/x64/MacroAssembler-x64-inl.h index aacce120117..c76a6fdff16 100644 --- a/js/src/jit/x64/MacroAssembler-x64-inl.h +++ b/js/src/jit/x64/MacroAssembler-x64-inl.h @@ -298,6 +298,13 @@ MacroAssembler::branchPrivatePtr(Condition cond, const Address& lhs, Register rh branchPtr(cond, lhs, scratch, label); } +void +MacroAssembler::branchTest64(Condition cond, Register64 lhs, Register64 rhs, Register temp, + Label* label) +{ + branchTestPtr(cond, lhs.reg, rhs.reg, label); +} + //}}} check_macroassembler_style // =============================================================== diff --git a/js/src/jit/x64/MacroAssembler-x64.h b/js/src/jit/x64/MacroAssembler-x64.h index 7007b4aed6b..a5b85621950 100644 --- a/js/src/jit/x64/MacroAssembler-x64.h +++ b/js/src/jit/x64/MacroAssembler-x64.h @@ -579,10 +579,6 @@ class MacroAssemblerX64 : public MacroAssemblerX86Shared j(cond, label); } - void branchTest64(Condition cond, Register64 lhs, Register64 rhs, Register temp, Label* label) { - branchTestPtr(cond, lhs.reg, rhs.reg, label); - } - void movePtr(Register src, Register dest) { movq(src, dest); } diff --git a/js/src/jit/x86/MacroAssembler-x86-inl.h b/js/src/jit/x86/MacroAssembler-x86-inl.h index 291df74b220..46f7e9d86e1 100644 --- a/js/src/jit/x86/MacroAssembler-x86-inl.h +++ b/js/src/jit/x86/MacroAssembler-x86-inl.h @@ -304,6 +304,21 @@ MacroAssembler::branchPrivatePtr(Condition cond, const Address& lhs, Register rh branchPtr(cond, lhs, rhs, label); } +void +MacroAssembler::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); + movl(lhs.low, temp); + orl(lhs.high, temp); + branchTestPtr(cond, temp, temp, label); + } else { + MOZ_CRASH("Unsupported condition"); + } +} + //}}} check_macroassembler_style // =============================================================== diff --git a/js/src/jit/x86/MacroAssembler-x86.h b/js/src/jit/x86/MacroAssembler-x86.h index 19f36abcd78..1e026a4b09d 100644 --- a/js/src/jit/x86/MacroAssembler-x86.h +++ b/js/src/jit/x86/MacroAssembler-x86.h @@ -607,18 +607,6 @@ class MacroAssemblerX86 : public MacroAssemblerX86Shared j(cond, 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); - movl(lhs.low, temp); - orl(lhs.high, temp); - branchTestPtr(cond, temp, temp, label); - } else { - MOZ_CRASH("Unsupported condition"); - } - } - void movePtr(ImmWord imm, Register dest) { movl(Imm32(imm.value), dest); }