Repository navigation
Commit 33ce3bf
committed
[WTF] Replace dragonbox with zmij
https://bugs.webkit.org/show_bug.cgi?id=328124
rdar://190466337
Reviewed by Devin Rousso.
This patch replaces dragonbox with zmij, which is state-of-the-art
double-to-string conversion. We import zmij as-is, and wrap it for
following edge cases in dtoa.cpp.
1. zero
2. subnormals
3. non-finite values
4. the magnitudes [2^-30, 2^-13) and [2^53, 2^70), where
zmij picks a different notation or pads the exponent
Test: Tools/TestWebKitAPI/Tests/WTF/ZmijTest.cpp
* Source/JavaScriptCore/runtime/JSONObject.cpp:
(JSC::bufferMode>::append):
* Source/JavaScriptCore/runtime/NumberPrototype.cpp:
(JSC::JSC_DEFINE_HOST_FUNCTION):
* Source/WTF/LICENSE-dragonbox.txt: Removed.
* Source/WTF/LICENSE-zmij.txt: Added.
* Source/WTF/WTF.xcodeproj/project.pbxproj:
* Source/WTF/wtf/CMakeLists.txt:
* Source/WTF/wtf/Zmij.cpp: Added.
* Source/WTF/wtf/dragonbox/detail/bits.h: Removed.
* Source/WTF/wtf/dragonbox/detail/cache_holder.h: Removed.
* Source/WTF/wtf/dragonbox/detail/decimal_fp.h: Removed.
* Source/WTF/wtf/dragonbox/detail/div.h: Removed.
* Source/WTF/wtf/dragonbox/detail/log.h: Removed.
* Source/WTF/wtf/dragonbox/detail/policy.h: Removed.
* Source/WTF/wtf/dragonbox/detail/policy_holder.h: Removed.
* Source/WTF/wtf/dragonbox/detail/util.h: Removed.
* Source/WTF/wtf/dragonbox/detail/wuint.h: Removed.
* Source/WTF/wtf/dragonbox/dragonbox.h: Removed.
* Source/WTF/wtf/dragonbox/dragonbox_to_chars.cpp: Removed.
* Source/WTF/wtf/dragonbox/dragonbox_to_chars.h: Removed.
* Source/WTF/wtf/dragonbox/ieee754_format.h: Removed.
* Source/WTF/wtf/dtoa.cpp:
(WTF::eightDecimalDigits):
(WTF::numberToStringAndSize): Deleted.
(WTF::numberToStringWithTrailingPoint): Deleted.
(WTF::truncateTrailingZeros): Deleted.
(WTF::numberToFixedPrecisionString): Deleted.
(WTF::numberToFixedWidthString): Deleted.
(WTF::numberToCSSString): Deleted.
* Source/WTF/wtf/dtoa.h:
* Source/WTF/wtf/zmij/zmij.cc.h: Added.
* Source/WTF/wtf/zmij/zmij.h: Added.
* Tools/Scripts/webkitpy/style/checker.py:
* Tools/TestWebKitAPI/CMakeLists.txt:
* Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* Tools/TestWebKitAPI/Tests/WTF/DragonBoxTest.cpp: Removed.
* Tools/TestWebKitAPI/Tests/WTF/ZmijTest.cpp: Added.
(TestWebKitAPI::zmijToString):
(TestWebKitAPI::zmijToExponential):
(TestWebKitAPI::doubleConversionToString):
(TestWebKitAPI::doubleConversionToExponential):
(TestWebKitAPI::checkDouble):
(TestWebKitAPI::checkFloat):
(TestWebKitAPI::TEST(WTF, ZmijSpecialValues)):
(TestWebKitAPI::TEST(WTF, ZmijRandom)):
(TestWebKitAPI::TEST(WTF, Zmij_perf)):
Canonical link: https://commits.webkit.org/324317@main1 parent b6b871f commit 33ce3bf
29 files changed
Lines changed: 3639 additions & 4877 deletions
File tree
- Source
- JavaScriptCore/runtime
- WTF
- WTF.xcodeproj
- wtf
- dragonbox
- detail
- zmij
- Tools
- Scripts/webkitpy/style
- TestWebKitAPI
- TestWebKitAPI.xcodeproj
- Tests/WTF
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
45 | | - | |
| 45 | + | |
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
| |||
1382 | 1382 | | |
1383 | 1383 | | |
1384 | 1384 | | |
1385 | | - | |
| 1385 | + | |
1386 | 1386 | | |
1387 | 1387 | | |
1388 | 1388 | | |
1389 | | - | |
1390 | | - | |
1391 | | - | |
1392 | | - | |
1393 | | - | |
1394 | | - | |
1395 | | - | |
| 1389 | + | |
| 1390 | + | |
| 1391 | + | |
| 1392 | + | |
| 1393 | + | |
1396 | 1394 | | |
1397 | 1395 | | |
1398 | 1396 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
35 | 34 | | |
36 | 35 | | |
37 | 36 | | |
| |||
414 | 413 | | |
415 | 414 | | |
416 | 415 | | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
417 | 419 | | |
418 | 420 | | |
419 | | - | |
420 | | - | |
421 | | - | |
422 | | - | |
423 | | - | |
424 | | - | |
| 421 | + | |
| 422 | + | |
425 | 423 | | |
426 | 424 | | |
427 | 425 | | |
| |||
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
0 commit comments