Bug 1134013. Add a version of branchTestObject that takes an Address. r=jandem

This commit is contained in:
Boris Zbarsky 2015-02-18 20:56:21 -05:00
parent c966517190
commit 729b9f1179
4 changed files with 24 additions and 0 deletions

View File

@ -2384,6 +2384,14 @@ MacroAssemblerMIPSCompat::branchTestObject(Condition cond, const BaseIndex &src,
ma_b(SecondScratchReg, ImmTag(JSVAL_TAG_OBJECT), label, cond);
}
void
MacroAssemblerMIPSCompat::branchTestObject(Condition cond, const Address &address, Label *label)
{
MOZ_ASSERT(cond == Equal || cond == NotEqual);
extractTag(address, SecondScratchReg);
ma_b(SecondScratchReg, ImmTag(JSVAL_TAG_OBJECT), label, cond);
}
void
MacroAssemblerMIPSCompat::testObjectSet(Condition cond, const ValueOperand &value, Register dest)
{

View File

@ -687,6 +687,7 @@ class MacroAssemblerMIPSCompat : public MacroAssemblerMIPS
void branchTestObject(Condition cond, const ValueOperand &value, Label *label);
void branchTestObject(Condition cond, Register tag, Label *label);
void branchTestObject(Condition cond, const BaseIndex &src, Label *label);
void branchTestObject(Condition cond, const Address &src, Label *label);
void testObjectSet(Condition cond, const ValueOperand &value, Register dest);
void branchTestString(Condition cond, const ValueOperand &value, Label *label);

View File

@ -977,6 +977,12 @@ class MacroAssemblerX64 : public MacroAssemblerX86Shared
branchTestNull(cond, Operand(address), label);
}
// This one, though, clobbers the ScratchReg.
void branchTestObject(Condition cond, const Address &src, Label *label) {
cond = testObject(cond, src);
j(cond, label);
}
// Perform a type-test on a full Value loaded into a register.
// Clobbers the ScratchReg.
void branchTestUndefined(Condition cond, const ValueOperand &src, Label *label) {

View File

@ -360,6 +360,15 @@ class MacroAssemblerX86 : public MacroAssemblerX86Shared
MOZ_ASSERT(cond == Equal || cond == NotEqual);
return testInt32(cond, Operand(address));
}
Condition testObject(Condition cond, const Operand &operand) {
MOZ_ASSERT(cond == Equal || cond == NotEqual);
cmp32(ToType(operand), ImmTag(JSVAL_TAG_OBJECT));
return cond;
}
Condition testObject(Condition cond, const Address &address) {
MOZ_ASSERT(cond == Equal || cond == NotEqual);
return testObject(cond, Operand(address));
}
Condition testDouble(Condition cond, const Operand &operand) {
MOZ_ASSERT(cond == Equal || cond == NotEqual);
Condition actual = (cond == Equal) ? Below : AboveOrEqual;