Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 6eff2e74e0486893a0f88f83b56a7246700538e6
      
https://github.com/WebKit/WebKit/commit/6eff2e74e0486893a0f88f83b56a7246700538e6
  Author: Yusuke Suzuki <[email protected]>
  Date:   2026-05-29 (Fri, 29 May 2026)

  Changed paths:
    A JSTests/stress/yarr-jit-shared-lead-prefilter.js
    M Source/JavaScriptCore/yarr/YarrJIT.cpp
    M Source/JavaScriptCore/yarr/YarrPattern.cpp
    M Source/JavaScriptCore/yarr/YarrPattern.h

  Log Message:
  -----------
  [YARR] Optimize character-classes / patterns with shared lead-surrogate
https://bugs.webkit.org/show_bug.cgi?id=315803
rdar://178192192

Reviewed by Sosuke Suzuki.

This patch optimizes the case where we have shared lead-surrogate.
Similar non-BMP Unicode characters is clustered into particular range,
thus it is possible that they are having the same lead-surrogate. This
patch leverages this characteristics to optimize things.

We add hasSharedLeadSurrogate which extracts a shared lead-surrogate
from non-BMP characters. And then using this for quick-check filtering
and character-class matching.

Test: JSTests/stress/yarr-jit-shared-lead-prefilter.js

* JSTests/stress/yarr-jit-shared-lead-prefilter.js: Added.
(shouldBe):
(shouldBeArray):
(execBoth):
(shouldBeArray.re.exec):
(throw.new.Error):
* Source/JavaScriptCore/yarr/YarrJIT.cpp:
* Source/JavaScriptCore/yarr/YarrPattern.cpp:
(JSC::Yarr::CharacterClass::hasSharedLeadSurrogate const):
* Source/JavaScriptCore/yarr/YarrPattern.h:

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



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

Reply via email to