Avoid scratch register collision when comparing an absolute address to an immediate, bug 703047.

This commit is contained in:
Brian Hackett 2011-11-29 18:41:38 -08:00
parent fd7a549aaf
commit 44ae4685c4
3 changed files with 8 additions and 6 deletions

View File

@ -334,7 +334,7 @@ public:
return branch32(cond, left, Imm32(right));
}
Jump branchPtr(Condition cond, AbsoluteAddress left, ImmPtr right)
Jump branchPtr(Condition cond, AbsoluteAddress left, ImmPtr right, RegisterID scratch)
{
return branch32(cond, left, Imm32(right));
}

View File

@ -431,10 +431,10 @@ public:
return branchPtr(cond, Address(scratchRegister), right);
}
Jump branchPtr(Condition cond, AbsoluteAddress left, ImmPtr right)
Jump branchPtr(Condition cond, AbsoluteAddress left, ImmPtr right, RegisterID scratch)
{
move(ImmPtr(left.m_ptr), scratchRegister);
return branchPtr(cond, Address(scratchRegister), right);
move(ImmPtr(left.m_ptr), scratch);
return branchPtr(cond, Address(scratch), right);
}
Jump branchPtr(Condition cond, Address left, RegisterID right)

View File

@ -180,11 +180,13 @@ GeneratePrototypeGuards(JSContext *cx, Vector<JSC::MacroAssembler::Jump,8> &mism
types::TypeObject *type = pobj->getType(cx);
j = masm.branchPtr(Assembler::NotEqual,
AbsoluteAddress(&type->proto),
ImmPtr(pobj->getProto()));
ImmPtr(pobj->getProto()),
scratchReg);
} else {
j = masm.branchPtr(Assembler::NotEqual,
AbsoluteAddress(pobj->addressOfType()),
ImmPtr(pobj->type()));
ImmPtr(pobj->type()),
scratchReg);
}
if (!mismatches.append(j))
return false;