Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: cbb2ba2c0577f5eca058938242c4ab363130c56d
https://github.com/WebKit/WebKit/commit/cbb2ba2c0577f5eca058938242c4ab363130c56d
Author: Nipun Shukla <[email protected]>
Date: 2025-11-12 (Wed, 12 Nov 2025)
Changed paths:
A LayoutTests/fast/regex/script-tests/string-split-newline.js
A LayoutTests/fast/regex/string-split-newline-expected.txt
A LayoutTests/fast/regex/string-split-newline.html
M Source/JavaScriptCore/runtime/RegExpPrototype.cpp
M Source/JavaScriptCore/runtime/StringPrototypeInlines.h
M Source/JavaScriptCore/yarr/Yarr.h
M Source/JavaScriptCore/yarr/YarrPattern.cpp
M Source/WTF/wtf/text/StringCommon.h
Log Message:
-----------
Optimize common newline regex
https://bugs.webkit.org/show_bug.cgi?id=302014
rdar://163958152
Reviewed by Yusuke Suzuki.
The regular expression \r\n?|\n is a very common syntax for newline splitting.
This patch adds an entry for this to Yarr::SpecificPattern and uses SIMD to
further optimize
this case.
* LayoutTests/fast/regex/script-tests/string-split-newline.js: Added.
(newlinePatterns.forEach):
* LayoutTests/fast/regex/string-split-newline-expected.txt: Added.
* LayoutTests/fast/regex/string-split-newline.html: Added.
* Source/JavaScriptCore/runtime/RegExpPrototype.cpp:
(JSC::JSC_DEFINE_HOST_FUNCTION):
* Source/JavaScriptCore/runtime/StringPrototypeInlines.h:
(JSC::tryTrimSpaces):
(JSC::replaceUsingRegExpSearch):
* Source/JavaScriptCore/yarr/Yarr.h:
* Source/JavaScriptCore/yarr/YarrPattern.cpp:
(JSC::Yarr::YarrPatternConstructor::extractSpecificPattern):
* Source/WTF/wtf/text/StringCommon.h:
(WTF::findNextNewline):
Canonical link: https://commits.webkit.org/302933@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications