Bug 1013906 - Assert on condition in branchTest32. r=bhackett

This commit is contained in:
Branislav Rankov 2014-06-04 11:32:11 +02:00
parent 9bf227c086
commit 71fc5f478e
2 changed files with 5 additions and 0 deletions

View File

@ -978,6 +978,7 @@ class MacroAssemblerARMCompat : public MacroAssemblerARM
ma_b(label, c);
}
void branchTest32(Condition cond, Register lhs, Register rhs, Label *label) {
JS_ASSERT(cond == Zero || cond == NonZero || cond == Signed || cond == NotSigned);
// x86 likes test foo, foo rather than cmp foo, #0.
// Convert the former into the latter.
if (lhs == rhs && (cond == Zero || cond == NonZero))
@ -987,6 +988,7 @@ class MacroAssemblerARMCompat : public MacroAssemblerARM
ma_b(label, cond);
}
void branchTest32(Condition cond, Register lhs, Imm32 imm, Label *label) {
JS_ASSERT(cond == Zero || cond == NonZero || cond == Signed || cond == NotSigned);
ma_tst(lhs, imm);
ma_b(label, cond);
}

View File

@ -238,14 +238,17 @@ class MacroAssemblerX86Shared : public Assembler
j(cond, label);
}
void branchTest32(Condition cond, Register lhs, Register rhs, Label *label) {
JS_ASSERT(cond == Zero || cond == NonZero || cond == Signed || cond == NotSigned);
testl(lhs, rhs);
j(cond, label);
}
void branchTest32(Condition cond, Register lhs, Imm32 imm, Label *label) {
JS_ASSERT(cond == Zero || cond == NonZero || cond == Signed || cond == NotSigned);
testl(lhs, imm);
j(cond, label);
}
void branchTest32(Condition cond, const Address &address, Imm32 imm, Label *label) {
JS_ASSERT(cond == Zero || cond == NonZero || cond == Signed || cond == NotSigned);
testl(Operand(address), imm);
j(cond, label);
}