зеркало из https://github.com/mozilla/gecko-dev.git
If the result of a demoted multiplication is 0, must undemote or we lose -0 (498549, r=dvander).
This commit is contained in:
Родитель
d7f40bae65
Коммит
af1e4816cd
|
@ -5867,6 +5867,8 @@ TraceRecorder::alu(LOpcode v, jsdouble v0, jsdouble v1, LIns* s0, LIns* s1)
|
||||||
break;
|
break;
|
||||||
case LIR_fmul:
|
case LIR_fmul:
|
||||||
r = v0 * v1;
|
r = v0 * v1;
|
||||||
|
if (r == 0.0)
|
||||||
|
goto out;
|
||||||
break;
|
break;
|
||||||
#ifdef NANOJIT_IA32
|
#ifdef NANOJIT_IA32
|
||||||
case LIR_fdiv:
|
case LIR_fdiv:
|
||||||
|
@ -5958,8 +5960,12 @@ TraceRecorder::alu(LOpcode v, jsdouble v0, jsdouble v1, LIns* s0, LIns* s1)
|
||||||
* that will inform the oracle and cause a non-demoted trace to be
|
* that will inform the oracle and cause a non-demoted trace to be
|
||||||
* attached that uses floating-point math for this operation.
|
* attached that uses floating-point math for this operation.
|
||||||
*/
|
*/
|
||||||
if (!result->isconst() && (!overflowSafe(v, d0) || !overflowSafe(v, d1)))
|
if (!result->isconst() && (!overflowSafe(v, d0) || !overflowSafe(v, d1))) {
|
||||||
guard(false, lir->ins1(LIR_ov, result), OVERFLOW_EXIT);
|
exit = snapshot(OVERFLOW_EXIT);
|
||||||
|
guard(false, lir->ins1(LIR_ov, result), exit);
|
||||||
|
if (v == LIR_mul) // make sure we don't lose a -0
|
||||||
|
guard(false, lir->ins_eq0(result), exit);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
JS_ASSERT_IF(d0->isconst() && d1->isconst(),
|
JS_ASSERT_IF(d0->isconst() && d1->isconst(),
|
||||||
|
|
Загрузка…
Ссылка в новой задаче