Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 69162bbdb6020cf2ee4ea70a57472d66ba3e74d1
https://github.com/WebKit/WebKit/commit/69162bbdb6020cf2ee4ea70a57472d66ba3e74d1
Author: Yusuke Suzuki <[email protected]>
Date: 2026-01-26 (Mon, 26 Jan 2026)
Changed paths:
M Source/JavaScriptCore/dfg/DFGOperations.cpp
M Source/JavaScriptCore/runtime/JSString.h
M Source/JavaScriptCore/runtime/StringPrototypeInlines.h
Log Message:
-----------
[JSC] Construct ropes from String.prototype.replace with strings
https://bugs.webkit.org/show_bug.cgi?id=306304
rdar://168957025
Reviewed by Yijia Huang.
Let's try creating a rope for "string".replace("string", "replacement")
case. searched string is at most only one occurrence. Copying and
constructing entire result string would be too costly in many cases.
This is aligned to V8's behavior.
* Source/JavaScriptCore/dfg/DFGOperations.cpp:
(JSC::DFG::JSC_DEFINE_JIT_OPERATION):
* Source/JavaScriptCore/runtime/JSString.h:
(JSC::jsSubstring):
* Source/JavaScriptCore/runtime/StringPrototypeInlines.h:
(JSC::stringSlice):
(JSC::stringReplaceStringString):
(JSC::replaceUsingStringSearch):
(JSC::replaceUsingRegExpSearch):
Canonical link: https://commits.webkit.org/306262@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications