author | Luke Wagner <luke@mozilla.com> |
Mon, 10 Jun 2013 16:22:57 -0700 | |
changeset 134581 | 8e30d56cf29d43ed0a43d905767ed96987254df2 |
parent 134580 | 9ce9c145e07238c62803c509c6f7d0db1b366402 |
child 134582 | 841ffd181e14667ea9a272ba169429db688caa8e |
push id | 24805 |
push user | emorley@mozilla.com |
push date | Tue, 11 Jun 2013 08:32:39 +0000 |
treeherder | mozilla-central@81b227f1a522 [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | jandem |
bugs | 878429 |
milestone | 24.0a1 |
first release with | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
last release without | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
js/src/ion/MIR.cpp | file | annotate | diff | comparison | revisions | |
js/src/jit-test/tests/basic/testBug878429.js | file | annotate | diff | comparison | revisions |
--- a/js/src/ion/MIR.cpp +++ b/js/src/ion/MIR.cpp @@ -854,17 +854,24 @@ MBitNot::infer() specialization_ = MIRType_None; else specialization_ = MIRType_Int32; } static inline bool IsConstant(MDefinition *def, double v) { - return def->isConstant() && def->toConstant()->value().toNumber() == v; + if (!def->isConstant()) + return false; + + // Compare as bits to avoid conflating, e.g., -0 and 0. + mozilla::detail::DoublePun lhs, rhs; + lhs.d = def->toConstant()->value().toNumber(); + rhs.d = v; + return lhs.u == rhs.u; } MDefinition * MBinaryBitwiseInstruction::foldsTo(bool useValueNumbers) { if (specialization_ != MIRType_Int32) return this;