Skip to content

[JSC] Date.parse should not copy 8-bit ASCII strings - #79804

Merged
webkit-commit-queue merged 1 commit into
WebKit:mainfrom
sosukesuzuki:eng/Date-parse-should-not-copy-8-bit-ASCII-strings
Nov 25, 2026
Merged

webkit-commit-queue merged 1 commit into
WebKit:mainfrom
sosukesuzuki:eng/Date-parse-should-not-copy-8-bit-ASCII-strings

Conversation

@sosukesuzuki

@sosukesuzuki sosukesuzuki commented Nov 5, 2026 •

Copy link
Copy Markdown
Member

b7e99bf

[JSC] `Date.parse` should not copy 8-bit ASCII strings
https://bugs.webkit.org/show_bug.cgi?id=330343

Reviewed by Yusuke Suzuki.

DateCache::parseDate replaces narrowNoBreakSpace and converts the string to
UTF-8 before parsing it. Neither changes an 8-bit ASCII string, so pass its
characters directly to the parser.

                                 Baseline                  Patched

local-date-constructor       99.9603+-2.6534     ^     67.0362+-2.1889        ^ definitely 1.4911x faster

Test: JSTests/stress/date-parse-8-bit-and-16-bit-strings.js

* JSTests/stress/date-parse-8-bit-and-16-bit-strings.js: Added.
(shouldBe):
(makeSubstring):
(test):
* Source/JavaScriptCore/runtime/JSDateMath.cpp:
(JSC::DateCache::parseDate):

Canonical link: https://commits.webkit.org/327736@main

0c2d4fb

Misc iOS, visionOS, tvOS & watchOS macOS Linux Windows
✅ 🧪 style ✅ 🛠 ios ✅ 🛠 mac ✅ 🛠 wpe ✅ 🛠 win
skipped 🧪 bindings ⏳ 🛠 ios-sim-cmake ✅ 🛠 mac-cmake-debug ✅ 🧪 wpe-wk2 ✅ 🧪 win-tests
✅ 🧪 webkitperl ⏳ 🧪 ios-cmake-wk2 ✅ 🧪 api-mac ✅ 🧪 api-wpe
skipped 🧪 webkitpy ⏳ 🧪 ios-cmake-wk2-wpt ❌ 🧪 api-mac-cmake-debug ✅ 🧪 jsc-wpe
✅ 🧪 jsc-x86-64 ⏳ 🧪 api-ios-cmake ✅ 🧪 mac-wk2 ✅ 🛠 gtk3-gcc
✅ 🛠 🧪 jsc-debug-arm64 ✅ 🛠 ios-safer-cpp ✅ 🧪 mac-cmake-debug-wk2 ✅ 🛠 gtk
skipped 🧪 services ✅ 🛠 vision skipped 🧪 mac-wk2-stress ✅ 🧪 gtk-wk2
✅ 🛠 🧪 merge ✅ 🛠 vision-sim ✅ 🧪 mac-intel-wk2 ✅ 🧪 api-gtk
✅ 🧪 vision-wk2 ✅ 🛠 mac-safer-cpp ✅ 🛠 playstation
✅ 🛠 tv ✅ 🧪 mac-site-isolation
✅ 🛠 tv-sim ⏳ 🧪 mac-webdriver
✅ 🛠 watch
✅ 🛠 watch-sim

@sosukesuzuki
sosukesuzuki requested a review from a team as a code owner November 5, 2026 17:52
@sosukesuzuki sosukesuzuki self-assigned this Nov 5, 2026
@sosukesuzuki sosukesuzuki added the JavaScriptCore For bugs in JavaScriptCore, the JS engine used by WebKit, other than kxmlcore issues. label Nov 5, 2026
@sosukesuzuki sosukesuzuki added the merge-queue Applied to send a pull request to merge-queue label Nov 25, 2026
https://bugs.webkit.org/show_bug.cgi?id=330343

Reviewed by Yusuke Suzuki.

DateCache::parseDate replaces narrowNoBreakSpace and converts the string to
UTF-8 before parsing it. Neither changes an 8-bit ASCII string, so pass its
characters directly to the parser.

                                 Baseline                  Patched

local-date-constructor       99.9603+-2.6534     ^     67.0362+-2.1889        ^ definitely 1.4911x faster

Test: JSTests/stress/date-parse-8-bit-and-16-bit-strings.js

* JSTests/stress/date-parse-8-bit-and-16-bit-strings.js: Added.
(shouldBe):
(makeSubstring):
(test):
* Source/JavaScriptCore/runtime/JSDateMath.cpp:
(JSC::DateCache::parseDate):

Canonical link: https://commits.webkit.org/327736@main
@webkit-commit-queue
webkit-commit-queue force-pushed the eng/Date-parse-should-not-copy-8-bit-ASCII-strings branch from 0c2d4fb to b7e99bf Compare November 25, 2026 06:02
@webkit-commit-queue

Copy link
Copy Markdown
Collaborator

Committed 327736@main (b7e99bf): https://commits.webkit.org/327736@main

Reviewed commits have been landed. Closing PR #79804 and removing active labels.

@webkit-commit-queue
webkit-commit-queue merged commit b7e99bf into WebKit:main Nov 25, 2026
@webkit-commit-queue webkit-commit-queue removed the merge-queue Applied to send a pull request to merge-queue label Nov 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

JavaScriptCore For bugs in JavaScriptCore, the JS engine used by WebKit, other than kxmlcore issues.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants