Strength reduce i2f(doubleToInt32(x)) and u2f(doubleToUint32(x)) to x. This eliminate most of the on-trace overhead, but we still need type peeling of loop variable into int to win back the performance loss casting introduced.

This commit is contained in:
Andreas Gal 2008-07-06 17:43:08 -07:00
parent bd6deef4fc
commit 312d176937

View File

@ -210,6 +210,23 @@ public:
LirWriter(out)
{
}
LInsp ins1(LOpcode v, LInsp s0)
{
switch (v) {
case LIR_i2f:
if (s0->oprnd1()->isCall() && s0->imm8() == F_doubleToInt32)
return callArgN(s0->oprnd1(), 1);
break;
case LIR_u2f:
if (s0->oprnd1()->isCall() && s0->imm8() == F_doubleToUint32)
return callArgN(s0->oprnd1(), 1);
break;
default:
JS_NOT_REACHED("ins1");
}
return out->ins1(v, s0);
}
LInsp ins2(LOpcode v, LInsp s1, LInsp s0)
{