Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 23ff891340fad952180a214699d45d9cebf06829
      
https://github.com/WebKit/WebKit/commit/23ff891340fad952180a214699d45d9cebf06829
  Author: Sosuke Suzuki <[email protected]>
  Date:   2026-10-06 (Tue, 06 Oct 2026)

  Changed paths:
    A JSTests/stress/for-of-fast-string-latin1.js
    M Source/JavaScriptCore/jit/JITCall.cpp
    M Source/JavaScriptCore/llint/LowLevelInterpreter64.asm
    M Source/JavaScriptCore/runtime/SmallStrings.h

  Log Message:
  -----------
  [JSC] Inline the `FastString` path of `op_iterator_next` in Baseline JIT and 
LLInt
https://bugs.webkit.org/show_bug.cgi?id=326444

Reviewed by Yusuke Suzuki.

Since 322172@main, op_iterator_next in FastString mode keeps the string and the
index in registers, but Baseline JIT and LLInt still call into C++ for every
character just to compare the index with the length, load the character, and
increment the index.

This patch does that inline when the string is a resolved 8-bit string, as
322033@main and 322371@main did for FastArray. Everything else (ropes, 16-bit
strings, the end of the iteration) still takes the existing path.

Test: JSTests/stress/for-of-fast-string-latin1.js

* JSTests/stress/for-of-fast-string-latin1.js: Added.
(shouldBe):
(codes):
(firstThree):
(check):
* Source/JavaScriptCore/jit/JITCall.cpp:
(JSC::JIT::emit_op_iterator_next):
* Source/JavaScriptCore/llint/LowLevelInterpreter64.asm:
* Source/JavaScriptCore/runtime/SmallStrings.h:

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



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

Reply via email to