Changeset 201678 in webkit
- Timestamp:
- Jun 3, 2016 8:28:57 PM (8 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r201674 r201678 1 2016-06-03 Benjamin Poulain <bpoulain@apple.com> 2 3 Eager FTL failure for strict comparison of NaN with number check 4 https://bugs.webkit.org/show_bug.cgi?id=158368 5 6 Reviewed by Darin Adler. 7 8 DoupleRep with a RealNumberUse starts by handling double 9 then falls back to Int32 if the unboxed double is NaN. 10 11 Before handling integers, the code is checking if the input 12 is indeed an int32. The problem was that this check failed 13 to account for NaN as an original input of the DoubleRep. 14 15 The call to isNotInt32() filter the doubles checks because 16 that was handled by the previous block. 17 The problem is the previous block handles any double except NaN. 18 If the original input was NaN, the masking by "~SpecFullDouble" 19 filter that possibility and isNotInt32() fails to test that case. 20 21 This patch fixes the issue by changing the filter to SpecDoubleReal. 22 The type SpecDoubleReal does not include the NaN types. 23 24 * ftl/FTLLowerDFGToB3.cpp: 25 (JSC::FTL::DFG::LowerDFGToB3::compileDoubleRep): 26 * tests/stress/double-rep-real-number-use-on-nan.js: Added. 27 To ensure the isNotInt32() does not test anything, we want 28 proven numbers as input. The (+value) are there to enforce 29 a ToNumber() which in turn give us a proven Number type. 30 1 31 2016-06-03 Benjamin Poulain <bpoulain@apple.com> 2 32 -
trunk/Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp
r201668 r201678 1139 1139 1140 1140 LBasicBlock lastNext = m_out.appendTo(intCase, continuation); 1141 1141 1142 1142 FTL_TYPE_CHECK( 1143 1143 jsValueValue(value), m_node->child1(), SpecBytecodeRealNumber, 1144 isNotInt32(value, provenType(m_node->child1()) & ~Spec FullDouble));1144 isNotInt32(value, provenType(m_node->child1()) & ~SpecDoubleReal)); 1145 1145 ValueFromBlock slowResult = m_out.anchor(m_out.intToDouble(unboxInt32(value))); 1146 1146 m_out.jump(continuation);
Note: See TracChangeset
for help on using the changeset viewer.