mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-04 11:26:09 +00:00
Bug 1134013. Add a version of branchTestObject that takes an Address. r=jandem
This commit is contained in:
parent
c966517190
commit
729b9f1179
@ -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)
|
||||
{
|
||||
|
@ -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);
|
||||
|
@ -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) {
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user