Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Eager FTL failure for strict comparison of NaN with number check
https://bugs.webkit.org/show_bug.cgi?id=158368 Patch by Benjamin Poulain <[email protected]> on 2016-06-03 Reviewed by Darin Adler. DoupleRep with a RealNumberUse starts by handling double then falls back to Int32 if the unboxed double is NaN. Before handling integers, the code is checking if the input is indeed an int32. The problem was that this check failed to account for NaN as an original input of the DoubleRep. The call to isNotInt32() filter the doubles checks because that was handled by the previous block. The problem is the previous block handles any double except NaN. If the original input was NaN, the masking by "~SpecFullDouble" filter that possibility and isNotInt32() fails to test that case. This patch fixes the issue by changing the filter to SpecDoubleReal. The type SpecDoubleReal does not include the NaN types. * ftl/FTLLowerDFGToB3.cpp: (JSC::FTL::DFG::LowerDFGToB3::compileDoubleRep): * tests/stress/double-rep-real-number-use-on-nan.js: Added. To ensure the isNotInt32() does not test anything, we want proven numbers as input. The (+value) are there to enforce a ToNumber() which in turn give us a proven Number type. Canonical link: https://commits.webkit.org/176464@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@201678 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information