Backed out changeset f95c21f4dd50 (bug 1245112)

This commit is contained in:
Tooru Fujisawa 2016-02-16 00:24:01 +09:00
parent 0571f8ea06
commit 8d50f2cc1d
15 changed files with 71 additions and 76 deletions

View File

@ -798,13 +798,6 @@ class MacroAssembler : public MacroAssemblerSpecific
inline void rshift64(Imm32 imm, Register64 dest) PER_ARCH;
// ===============================================================
// Branch functions
// This function compares a Value (lhs) which is having a private pointer
// boxed inside a js::Value, with a raw pointer (rhs).
inline void branchPrivatePtr(Condition cond, const Address& lhs, Register rhs, Label* label) PER_ARCH;
//}}} check_macroassembler_style
public:

View File

@ -390,15 +390,6 @@ MacroAssembler::rshift64(Imm32 imm, Register64 dest)
as_mov(dest.high, lsr(dest.high, imm.value));
}
// ===============================================================
// Branch functions
void
MacroAssembler::branchPrivatePtr(Condition cond, const Address& lhs, Register rhs, Label* label)
{
branchPtr(cond, lhs, rhs, label);
}
//}}} check_macroassembler_style
// ===============================================================

View File

@ -822,6 +822,18 @@ class MacroAssemblerARMCompat : public MacroAssemblerARM
branch32(cond, lhs, rhs, label);
}
void branchPrivatePtr(Condition cond, const Address& lhs, ImmPtr ptr, Label* label) {
branchPtr(cond, lhs, ptr, label);
}
void branchPrivatePtr(Condition cond, const Address& lhs, Register ptr, Label* label) {
branchPtr(cond, lhs, ptr, label);
}
void branchPrivatePtr(Condition cond, Register lhs, ImmWord ptr, Label* label) {
branchPtr(cond, lhs, ptr, label);
}
template<typename T>
void branchTestDouble(Condition cond, const T & t, Label* label) {
Condition c = testDouble(cond, t);

View File

@ -435,21 +435,6 @@ MacroAssembler::rshift64(Imm32 imm, Register64 dest)
rshiftPtr(imm, dest.reg);
}
// ===============================================================
// Branch functions
void
MacroAssembler::branchPrivatePtr(Condition cond, const Address& lhs, Register rhs, Label* label)
{
vixl::UseScratchRegisterScope temps(this);
const Register scratch = temps.AcquireX().asUnsized();
if (rhs != scratch)
movePtr(rhs, scratch);
// Instead of unboxing lhs, box rhs and do direct comparison with lhs.
rshiftPtr(Imm32(1), scratch);
branchPtr(cond, lhs, scratch, label);
}
//}}} check_macroassembler_style
// ===============================================================

View File

@ -1593,6 +1593,17 @@ class MacroAssemblerCompat : public vixl::MacroAssembler
loadPtr(lhs, scratch);
branchTestPtr(cond, scratch, imm, label);
}
void branchPrivatePtr(Condition cond, const Address& lhs, ImmPtr ptr, Label* label) {
branchPtr(cond, lhs, ptr, label);
}
void branchPrivatePtr(Condition cond, const Address& lhs, Register ptr, Label* label) {
branchPtr(cond, lhs, ptr, label);
}
void branchPrivatePtr(Condition cond, Register lhs, ImmWord ptr, Label* label) {
branchPtr(cond, lhs, ptr, label);
}
void decBranchPtr(Condition cond, Register lhs, Imm32 imm, Label* label) {
Subs(ARMRegister(lhs, 64), ARMRegister(lhs, 64), Operand(imm.value));

View File

@ -236,15 +236,6 @@ MacroAssembler::rshift64(Imm32 imm, Register64 dest)
as_srl(dest.high, dest.high, imm.value);
}
// ===============================================================
// Branch functions
void
MacroAssembler::branchPrivatePtr(Condition cond, const Address& lhs, Register rhs, Label* label)
{
branchPtr(cond, lhs, rhs, label);
}
//}}} check_macroassembler_style
// ===============================================================

View File

@ -420,6 +420,18 @@ class MacroAssemblerMIPSCompat : public MacroAssemblerMIPS
ma_b(SecondScratchReg, rhs, label, cond);
}
void branchPrivatePtr(Condition cond, const Address& lhs, ImmPtr ptr, Label* label) {
branchPtr(cond, lhs, ptr, label);
}
void branchPrivatePtr(Condition cond, const Address& lhs, Register ptr, Label* label) {
branchPtr(cond, lhs, ptr, label);
}
void branchPrivatePtr(Condition cond, Register lhs, ImmWord ptr, Label* label) {
branchPtr(cond, lhs, ptr, label);
}
void branchTestDouble(Condition cond, const ValueOperand& value, Label* label);
void branchTestDouble(Condition cond, Register tag, Label* label);
void branchTestDouble(Condition cond, const Address& address, Label* label);

View File

@ -177,19 +177,6 @@ MacroAssembler::rshift64(Imm32 imm, Register64 dest)
ma_dsrl(dest.reg, dest.reg, imm);
}
// ===============================================================
// Branch functions
void
MacroAssembler::branchPrivatePtr(Condition cond, const Address& lhs, Register rhs, Label* label)
{
if (rhs != ScratchRegister)
movePtr(rhs, ScratchRegister);
// Instead of unboxing lhs, box rhs and do direct comparison with lhs.
rshiftPtr(Imm32(1), ScratchRegister);
branchPtr(cond, lhs, ScratchRegister, label);
}
//}}} check_macroassembler_style
// ===============================================================

View File

@ -461,6 +461,18 @@ class MacroAssemblerMIPS64Compat : public MacroAssemblerMIPS64
ma_b(SecondScratchReg, rhs, label, cond);
}
void branchPrivatePtr(Condition cond, const Address& lhs, ImmPtr ptr, Label* label) {
branchPtr(cond, lhs, ptr, label);
}
void branchPrivatePtr(Condition cond, const Address& lhs, Register ptr, Label* label) {
branchPtr(cond, lhs, ptr, label);
}
void branchPrivatePtr(Condition cond, Register lhs, ImmWord ptr, Label* label) {
branchPtr(cond, lhs, ptr, label);
}
void branchTestDouble(Condition cond, const ValueOperand& value, Label* label);
void branchTestDouble(Condition cond, Register tag, Label* label);
void branchTestDouble(Condition cond, const Address& address, Label* label);

View File

@ -252,6 +252,7 @@ class MacroAssemblerNone : public Assembler
template <typename T, typename S> void branchTestPtr(Condition, T, S, Label*) { MOZ_CRASH(); }
template <typename T, typename S> void branchDouble(DoubleCondition, T, S, Label*) { MOZ_CRASH(); }
template <typename T, typename S> void branchFloat(DoubleCondition, T, S, Label*) { MOZ_CRASH(); }
template <typename T, typename S> void branchPrivatePtr(Condition, T, S, Label*) { MOZ_CRASH(); }
template <typename T, typename S> void decBranchPtr(Condition, T, S, Label*) { MOZ_CRASH(); }
template <typename T, typename S> void branchTest64(Condition, T, T, S, Label*) { MOZ_CRASH(); }
template <typename T, typename S> void mov(T, S) { MOZ_CRASH(); }

View File

@ -219,20 +219,6 @@ MacroAssembler::rshift64(Imm32 imm, Register64 dest)
shrq(imm, dest.reg);
}
// ===============================================================
// Branch functions
void
MacroAssembler::branchPrivatePtr(Condition cond, const Address& lhs, Register rhs, Label* label)
{
ScratchRegisterScope scratch(*this);
if (rhs != scratch)
movePtr(rhs, scratch);
// Instead of unboxing lhs, box rhs and do direct comparison with lhs.
rshiftPtr(Imm32(1), scratch);
branchPtr(cond, lhs, scratch, label);
}
//}}} check_macroassembler_style
// ===============================================================

View File

@ -120,6 +120,16 @@ MacroAssemblerX64::finish()
MacroAssemblerX86Shared::finish();
}
void
MacroAssemblerX64::branchPrivatePtr(Condition cond, Address lhs, Register ptr, Label* label)
{
ScratchRegisterScope scratch(asMasm());
if (ptr != scratch)
movePtr(ptr, scratch);
asMasm().rshiftPtr(Imm32(1), scratch);
branchPtr(cond, lhs, scratch, label);
}
void
MacroAssemblerX64::handleFailureWithHandlerTail(void* handler)
{

View File

@ -604,6 +604,11 @@ class MacroAssemblerX64 : public MacroAssemblerX86Shared
branchPtr(cond, Operand(scratch, 0x0), ptr, label);
}
void branchPrivatePtr(Condition cond, Address lhs, ImmPtr ptr, Label* label) {
branchPtr(cond, lhs, ImmWord(uintptr_t(ptr.value) >> 1), label);
}
void branchPrivatePtr(Condition cond, Address lhs, Register ptr, Label* label);
template <typename T, typename S>
void branchPtr(Condition cond, const T& lhs, const S& ptr, Label* label) {
cmpPtr(Operand(lhs), ptr);

View File

@ -255,15 +255,6 @@ MacroAssembler::rshift64(Imm32 imm, Register64 dest)
shrl(imm, dest.high);
}
// ===============================================================
// Branch functions
void
MacroAssembler::branchPrivatePtr(Condition cond, const Address& lhs, Register rhs, Label* label)
{
branchPtr(cond, lhs, rhs, label);
}
//}}} check_macroassembler_style
// ===============================================================

View File

@ -594,6 +594,14 @@ class MacroAssemblerX86 : public MacroAssemblerX86Shared
j(cond, label);
}
void branchPrivatePtr(Condition cond, const Address& lhs, ImmPtr ptr, Label* label) {
branchPtr(cond, lhs, ptr, label);
}
void branchPrivatePtr(Condition cond, const Address& lhs, Register ptr, Label* label) {
branchPtr(cond, lhs, ptr, label);
}
template <typename T, typename S>
void branchPtr(Condition cond, T lhs, S ptr, RepatchLabel* label) {
cmpPtr(Operand(lhs), ptr);