Remove bogus fadd +1 check at the end of the loop. We have long switched over to starting slots as int and hence n++ will be emitted as integer add with i2f, so checking for i2f only is sufficient.

This commit is contained in:
Andreas Gal 2008-08-20 23:39:57 -07:00
parent ddf445130e
commit 12fcdd141f

View File

@ -1354,9 +1354,7 @@ TraceRecorder::checkType(jsval& v, uint8 t, bool& unstable)
if (!isNumber(v))
return false; /* not a number? type mismatch */
LIns* i = get(&v);
if (!isInt32(v) || (!i->isop(LIR_i2f) &&
!(i->isop(LIR_fadd) && i->oprnd2()->isconstq() &&
fabs(i->oprnd2()->constvalf()) == 1.0))) {
if (!i->isop(LIR_i2f)) {
debug_only_v(printf("int slot is !isInt32, slot #%d, triggering re-compilation\n",
!isGlobal(&v)
? nativeStackOffset(&v)
@ -1366,7 +1364,7 @@ TraceRecorder::checkType(jsval& v, uint8 t, bool& unstable)
return true; /* keep checking types, but request re-compilation */
}
/* Looks good, slot is an int32, the last instruction should be i2f. */
JS_ASSERT(i->isop(LIR_i2f));
JS_ASSERT(isInt32(v) && i->isop(LIR_i2f));
/* We got the final LIR_i2f as we expected. Overwrite the value in that
slot with the argument of i2f since we want the integer store to flow along
the loop edge, not the casted value. */