Changeset 199638 in webkit
- Timestamp:
- Apr 16, 2016, 8:44:52 PM (10 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 2 edited
-
ChangeLog (modified) (1 diff)
-
bytecode/SpeculatedType.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r199636 r199638 1 2016-04-16 Benjamin Poulain <bpoulain@apple.com> 2 3 [JSC] FRound/Negate can produce an impure NaN out of a pure NaN 4 https://bugs.webkit.org/show_bug.cgi?id=156528 5 6 Reviewed by Filip Pizlo. 7 8 If you fround a double with the bits 0xfff7000000000000 9 you get 0xfffe000000000000. The first is a pure NaN, the second isn't. 10 11 This is without test because I could not find a way to create a 0xfff7000000000000 12 while convincing DFG that its pure. 13 When we purify NaNs from typed array, we use a specific value of NaN if the input 14 is any NaN, making testing tricky. 15 16 * bytecode/SpeculatedType.cpp: 17 (JSC::typeOfDoubleNegation): 18 1 19 2016-04-16 Konstantin Tokarev <annulen@yandex.ru> 2 20 -
trunk/Source/JavaScriptCore/bytecode/SpeculatedType.cpp
r197408 r199638 523 523 SpeculatedType typeOfDoubleNegation(SpeculatedType value) 524 524 { 525 // Impure NaN could become pure NaN because bits might get cleared. 526 if (value & SpecDoubleImpureNaN) 527 value |= SpecDoublePureNaN; 525 // Changing bits can make pure NaN impure and vice versa: 526 // 0xefff000000000000 (pure) - 0xffff000000000000 (impure) 527 if (value & SpecDoubleNaN) 528 value |= SpecDoubleNaN; 528 529 // We could get negative zero, which mixes SpecInt52AsDouble and SpecNotIntAsDouble. 529 530 // We could also overflow a large negative int into something that is no longer … … 541 542 SpeculatedType typeOfDoubleRounding(SpeculatedType value) 542 543 { 543 // We might lose bits, which leads to a NaN being purified. 544 if (value & SpecDoubleImpureNaN) 545 value |= SpecDoublePureNaN; 544 // Double Pure NaN can becomes impure when converted back from Float. 545 // and vice versa. 546 if (value & SpecDoubleNaN) 547 value |= SpecDoubleNaN; 546 548 // We might lose bits, which leads to a value becoming integer-representable. 547 549 if (value & SpecNonIntAsDouble)
Note:
See TracChangeset
for help on using the changeset viewer.