commit 8acbe105e17e37d23712925261926f04363f7b22 Author: Douglas Crosher dtc-moz@scieneer.com Date: Tue Jun 17 11:47:45 2014 +1000
Bug 1012694 - IonMonkey (ARM): Use the second scratch register to avoid clobbering the scratch register. r=dougc, a=abillings --- js/src/jit/arm/MacroAssembler-arm.h | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/js/src/jit/arm/MacroAssembler-arm.h b/js/src/jit/arm/MacroAssembler-arm.h index 04d68af..7bc0da0 100644 --- a/js/src/jit/arm/MacroAssembler-arm.h +++ b/js/src/jit/arm/MacroAssembler-arm.h @@ -763,8 +763,9 @@ class MacroAssemblerARMCompat : public MacroAssemblerARM if (lhs.getTag() == Operand::OP2) { branch32(cond, lhs.toReg(), rhs, label); } else { - ma_ldr(lhs, ScratchRegister); - branch32(cond, ScratchRegister, rhs, label); + // branch32 will use ScratchRegister. + ma_ldr(lhs, secondScratchReg_); + branch32(cond, secondScratchReg_, rhs, label); } } void branch32(Condition cond, const Address &lhs, Register rhs, Label *label) { @@ -772,8 +773,9 @@ class MacroAssemblerARMCompat : public MacroAssemblerARM branch32(cond, ScratchRegister, rhs, label); } void branch32(Condition cond, const Address &lhs, Imm32 rhs, Label *label) { - load32(lhs, ScratchRegister); - branch32(cond, ScratchRegister, rhs, label); + // branch32 will use ScratchRegister. + load32(lhs, secondScratchReg_); + branch32(cond, secondScratchReg_, rhs, label); } void branchPtr(Condition cond, const Address &lhs, Register rhs, Label *label) { branch32(cond, lhs, rhs, label); @@ -856,8 +858,9 @@ class MacroAssemblerARMCompat : public MacroAssemblerARM ma_b(label, cond); } void branchTest32(Condition cond, const Address &address, Imm32 imm, Label *label) { - ma_ldr(Operand(address.base, address.offset), ScratchRegister); - branchTest32(cond, ScratchRegister, imm, label); + // branchTest32 will use ScratchRegister. + load32(address, secondScratchReg_); + branchTest32(cond, secondScratchReg_, imm, label); } void branchTestPtr(Condition cond, const Register &lhs, const Register &rhs, Label *label) { branchTest32(cond, lhs, rhs, label);