From a76f601fa177e7da2dba80d4eb5a5d8dd6147a1e Mon Sep 17 00:00:00 2001 From: Tooru Fujisawa Date: Tue, 16 Feb 2016 00:24:01 +0900 Subject: [PATCH] Backed out changeset f95c21f4dd50 (bug 1245112) --- js/src/jit/MacroAssembler.h | 7 ------- js/src/jit/arm/MacroAssembler-arm-inl.h | 9 --------- js/src/jit/arm/MacroAssembler-arm.h | 12 ++++++++++++ js/src/jit/arm64/MacroAssembler-arm64-inl.h | 15 --------------- js/src/jit/arm64/MacroAssembler-arm64.h | 11 +++++++++++ js/src/jit/mips32/MacroAssembler-mips32-inl.h | 9 --------- js/src/jit/mips32/MacroAssembler-mips32.h | 12 ++++++++++++ js/src/jit/mips64/MacroAssembler-mips64-inl.h | 13 ------------- js/src/jit/mips64/MacroAssembler-mips64.h | 12 ++++++++++++ js/src/jit/none/MacroAssembler-none.h | 1 + js/src/jit/x64/MacroAssembler-x64-inl.h | 14 -------------- js/src/jit/x64/MacroAssembler-x64.cpp | 10 ++++++++++ js/src/jit/x64/MacroAssembler-x64.h | 5 +++++ js/src/jit/x86/MacroAssembler-x86-inl.h | 9 --------- js/src/jit/x86/MacroAssembler-x86.h | 8 ++++++++ 15 files changed, 71 insertions(+), 76 deletions(-) diff --git a/js/src/jit/MacroAssembler.h b/js/src/jit/MacroAssembler.h index 1f321d636e56..784dc5c77bcf 100644 --- a/js/src/jit/MacroAssembler.h +++ b/js/src/jit/MacroAssembler.h @@ -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: diff --git a/js/src/jit/arm/MacroAssembler-arm-inl.h b/js/src/jit/arm/MacroAssembler-arm-inl.h index 97b10e987c65..e2c104c8eda7 100644 --- a/js/src/jit/arm/MacroAssembler-arm-inl.h +++ b/js/src/jit/arm/MacroAssembler-arm-inl.h @@ -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 // =============================================================== diff --git a/js/src/jit/arm/MacroAssembler-arm.h b/js/src/jit/arm/MacroAssembler-arm.h index d1b274d848ca..b80470a2488d 100644 --- a/js/src/jit/arm/MacroAssembler-arm.h +++ b/js/src/jit/arm/MacroAssembler-arm.h @@ -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 void branchTestDouble(Condition cond, const T & t, Label* label) { Condition c = testDouble(cond, t); diff --git a/js/src/jit/arm64/MacroAssembler-arm64-inl.h b/js/src/jit/arm64/MacroAssembler-arm64-inl.h index 42fefe6cbb74..d1046efd873c 100644 --- a/js/src/jit/arm64/MacroAssembler-arm64-inl.h +++ b/js/src/jit/arm64/MacroAssembler-arm64-inl.h @@ -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 // =============================================================== diff --git a/js/src/jit/arm64/MacroAssembler-arm64.h b/js/src/jit/arm64/MacroAssembler-arm64.h index fc0c076bf995..2c8365f49611 100644 --- a/js/src/jit/arm64/MacroAssembler-arm64.h +++ b/js/src/jit/arm64/MacroAssembler-arm64.h @@ -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)); diff --git a/js/src/jit/mips32/MacroAssembler-mips32-inl.h b/js/src/jit/mips32/MacroAssembler-mips32-inl.h index 528e5d7c0757..9dab27f7d5d4 100644 --- a/js/src/jit/mips32/MacroAssembler-mips32-inl.h +++ b/js/src/jit/mips32/MacroAssembler-mips32-inl.h @@ -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 // =============================================================== diff --git a/js/src/jit/mips32/MacroAssembler-mips32.h b/js/src/jit/mips32/MacroAssembler-mips32.h index dfa4421e545f..2992d9a75ebb 100644 --- a/js/src/jit/mips32/MacroAssembler-mips32.h +++ b/js/src/jit/mips32/MacroAssembler-mips32.h @@ -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); diff --git a/js/src/jit/mips64/MacroAssembler-mips64-inl.h b/js/src/jit/mips64/MacroAssembler-mips64-inl.h index 4885151edd73..10f4a785d4c3 100644 --- a/js/src/jit/mips64/MacroAssembler-mips64-inl.h +++ b/js/src/jit/mips64/MacroAssembler-mips64-inl.h @@ -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 // =============================================================== diff --git a/js/src/jit/mips64/MacroAssembler-mips64.h b/js/src/jit/mips64/MacroAssembler-mips64.h index e8146d2e40e7..19d1a053b471 100644 --- a/js/src/jit/mips64/MacroAssembler-mips64.h +++ b/js/src/jit/mips64/MacroAssembler-mips64.h @@ -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); diff --git a/js/src/jit/none/MacroAssembler-none.h b/js/src/jit/none/MacroAssembler-none.h index ee2e2958bcc1..2d267ac0385c 100644 --- a/js/src/jit/none/MacroAssembler-none.h +++ b/js/src/jit/none/MacroAssembler-none.h @@ -252,6 +252,7 @@ class MacroAssemblerNone : public Assembler template void branchTestPtr(Condition, T, S, Label*) { MOZ_CRASH(); } template void branchDouble(DoubleCondition, T, S, Label*) { MOZ_CRASH(); } template void branchFloat(DoubleCondition, T, S, Label*) { MOZ_CRASH(); } + template void branchPrivatePtr(Condition, 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(); } diff --git a/js/src/jit/x64/MacroAssembler-x64-inl.h b/js/src/jit/x64/MacroAssembler-x64-inl.h index 9c68e10b8a96..02b18b4b3bd2 100644 --- a/js/src/jit/x64/MacroAssembler-x64-inl.h +++ b/js/src/jit/x64/MacroAssembler-x64-inl.h @@ -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 // =============================================================== diff --git a/js/src/jit/x64/MacroAssembler-x64.cpp b/js/src/jit/x64/MacroAssembler-x64.cpp index 694c56247d79..c72b6b35dd51 100644 --- a/js/src/jit/x64/MacroAssembler-x64.cpp +++ b/js/src/jit/x64/MacroAssembler-x64.cpp @@ -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) { diff --git a/js/src/jit/x64/MacroAssembler-x64.h b/js/src/jit/x64/MacroAssembler-x64.h index 8a2a200317a2..cfa83da41cbb 100644 --- a/js/src/jit/x64/MacroAssembler-x64.h +++ b/js/src/jit/x64/MacroAssembler-x64.h @@ -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 void branchPtr(Condition cond, const T& lhs, const S& ptr, Label* label) { cmpPtr(Operand(lhs), ptr); diff --git a/js/src/jit/x86/MacroAssembler-x86-inl.h b/js/src/jit/x86/MacroAssembler-x86-inl.h index ebdc0e2f7857..3c6342ecc5fd 100644 --- a/js/src/jit/x86/MacroAssembler-x86-inl.h +++ b/js/src/jit/x86/MacroAssembler-x86-inl.h @@ -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 // =============================================================== diff --git a/js/src/jit/x86/MacroAssembler-x86.h b/js/src/jit/x86/MacroAssembler-x86.h index b6ef30c0bd31..98afbf550ca9 100644 --- a/js/src/jit/x86/MacroAssembler-x86.h +++ b/js/src/jit/x86/MacroAssembler-x86.h @@ -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 void branchPtr(Condition cond, T lhs, S ptr, RepatchLabel* label) { cmpPtr(Operand(lhs), ptr);