From c9e85cc13f646cac6912c1b9dc2e9e5d94fe4f73 Mon Sep 17 00:00:00 2001 From: Andreas Gal Date: Wed, 20 Aug 2008 23:39:57 -0700 Subject: [PATCH] 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. --- js/src/jstracer.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/js/src/jstracer.cpp b/js/src/jstracer.cpp index 08a0547b0f25..d67001bce152 100644 --- a/js/src/jstracer.cpp +++ b/js/src/jstracer.cpp @@ -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. */