Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 3e286ac0a33414e20bd7e41926a3bb7d6b9ee73b
      
https://github.com/WebKit/WebKit/commit/3e286ac0a33414e20bd7e41926a3bb7d6b9ee73b
  Author: Yusuke Suzuki <[email protected]>
  Date:   2026-10-09 (Fri, 09 Oct 2026)

  Changed paths:
    A JSTests/stress/ftl-string-code-point-at-surrogates.js
    A JSTests/stress/ftl-string-substr-and-iteration.js
    A JSTests/stress/ftl-strings-equal-ropes.js
    M Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp

  Log Message:
  -----------
  [JSC] Remove redundant work from FTL string lowering
https://bugs.webkit.org/show_bug.cgi?id=326766
rdar://189477675

Reviewed by Yijia Huang.

This patch cleans up some FTL code generation.

1. compileStringCharAtImpl and compileStringCodePointAt loaded 
StringImpl::m_data
   separately in the 8-bit and 16-bit arms. Load it once before the branch.
2. compileStringCodePointAt tests for a lead surrogate before the bounds check
   for the trail character, so ordinary 16-bit characters skip that check.
3. stringsEqual checks both operands for ropes with one test on the OR of their
   JSString::m_value fields, and compares the 8-bit flags with a single XOR.
4. compileStringSubstr no longer clamps a negative span to 0, since a
   non-positive span takes the empty-string path anyway.
5. compileStringIteratorNext marks the end of iteration as rare.

Tests: JSTests/stress/ftl-string-code-point-at-surrogates.js
       JSTests/stress/ftl-string-substr-and-iteration.js
       JSTests/stress/ftl-strings-equal-ropes.js

* JSTests/stress/ftl-string-code-point-at-surrogates.js: Added.
(shouldBe):
(reference):
(i.reference):
* JSTests/stress/ftl-string-substr-and-iteration.js: Added.
(shouldBe):
(concatenateCharacters):
* JSTests/stress/ftl-strings-equal-ropes.js: Added.
(shouldBe):
* Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileStringCharAtImpl):
(JSC::FTL::DFG::LowerDFGToB3::compileStringCodePointAt):
(JSC::FTL::DFG::LowerDFGToB3::compileCompareStrictEq):

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



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

Reply via email to