Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: e40c476491e9ba8e612a0528889eb814e2c281c0
      
https://github.com/WebKit/WebKit/commit/e40c476491e9ba8e612a0528889eb814e2c281c0
  Author: Sosuke Suzuki <[email protected]>
  Date:   2026-02-14 (Sat, 14 Feb 2026)

  Changed paths:
    M Source/JavaScriptCore/dfg/DFGOperations.cpp

  Log Message:
  -----------
  [JSC] Use rope concatenation instead of tryMakeString in replace operations 
for empty strings
https://bugs.webkit.org/show_bug.cgi?id=307267

Reviewed by Yusuke Suzuki.

Replace tryMakeString (malloc + memcpy) with jsSubstring + jsString rope
concatenation in operationStringReplaceStringEmptyString and its WithTable8
variant. This avoids eagerly allocating a flat string when constructing the
result of str.replace(search, "").

The same rope-based pattern is already used in stringReplaceStringString's
noSubstitutions path (StringPrototypeInlines.h)

* Source/JavaScriptCore/dfg/DFGOperations.cpp:
(JSC::DFG::JSC_DEFINE_JIT_OPERATION):

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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to