IFEQ and IFNE are identical for us. We just expect the same boolean on the stack and side exit if not.

This commit is contained in:
Andreas Gal 2008-07-10 20:35:19 -07:00
parent 5e77678d2a
commit 20f942f5f0
2 changed files with 5 additions and 14 deletions

View File

@ -1198,23 +1198,14 @@ LIns* TraceRecorder::f2i(LIns* f)
return lir->insCall(F_doubleToInt32, &f);
}
bool TraceRecorder::ifop(bool sense)
bool TraceRecorder::ifop()
{
jsval& v = stackval(-1);
LIns* cond_ins;
bool cond;
if (JSVAL_IS_BOOLEAN(v)) {
cond_ins = lir->ins_eq0(get(&v));
cond = JSVAL_TO_BOOLEAN(v);
guard(!JSVAL_TO_BOOLEAN(v), lir->ins_eq0(get(&v)));
} else {
return false;
}
if (!sense) {
cond = !cond;
cond_ins = lir->ins_eq0(cond_ins);
}
guard(cond, cond_ins);
return true;
}
@ -1573,11 +1564,11 @@ bool TraceRecorder::JSOP_GOTO()
}
bool TraceRecorder::JSOP_IFEQ()
{
return ifop(true);
return ifop();
}
bool TraceRecorder::JSOP_IFNE()
{
return ifop(false);
return ifop();
}
bool TraceRecorder::JSOP_ARGUMENTS()
{

View File

@ -159,7 +159,7 @@ class TraceRecorder {
nanojit::LIns* f2i(nanojit::LIns* f);
bool ifop(bool sense);
bool ifop();
bool inc(jsval& v, jsint incr, bool pre = true);
bool cmp(nanojit::LOpcode op, bool negate = false);