Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 549955d9979c99de1d9fa22a9d281629cedca59d
https://github.com/WebKit/WebKit/commit/549955d9979c99de1d9fa22a9d281629cedca59d
Author: Sosuke Suzuki <[email protected]>
Date: 2026-09-05 (Sat, 05 Sep 2026)
Changed paths:
M Source/JavaScriptCore/yarr/YarrInterpreter.cpp
M Source/JavaScriptCore/yarr/YarrJIT.cpp
M Source/JavaScriptCore/yarr/YarrPattern.cpp
M Source/JavaScriptCore/yarr/YarrPattern.h
Log Message:
-----------
[YARR] Keep the terms of lookbehinds in match order in YarrPattern
https://bugs.webkit.org/show_bug.cgi?id=323421
Reviewed by Daniel Liu.
This is the last step of the plan in 319067@main.
Since 319067@main and 320492@main, the JIT and the interpreter match a
lookbehind from a copy of its disjunction in which the terms of each backward
alternative are reversed and inputPosition is counted in that order. The copy
was needed because YarrPatternConstructor kept the terms in pattern order.
YarrPatternConstructor now reverses the terms of the backward alternatives
when a lookbehind is closed, right after its forward references are resolved,
and setupAlternativeOffsets() counts the disjunction of a lookahead inside a
lookbehind from 0, as the copy did. Both tiers use the pattern as it is, and
copyDisjunctionInMatchOrder() is removed. The bytecode and the JIT ops are the
same as before, except that frame slots are now also numbered in match order.
* Source/JavaScriptCore/yarr/YarrInterpreter.cpp:
(JSC::Yarr::ByteCompiler::emitDisjunction):
* Source/JavaScriptCore/yarr/YarrJIT.cpp:
* Source/JavaScriptCore/yarr/YarrPattern.cpp:
(JSC::Yarr::YarrPatternConstructor::atomParenthesesEnd):
(JSC::Yarr::YarrPatternConstructor::putTermsInMatchOrder):
(JSC::Yarr::YarrPatternConstructor::setupAlternativeOffsets):
(JSC::Yarr::YarrPattern::copyDisjunctionInMatchOrder): Deleted.
* Source/JavaScriptCore/yarr/YarrPattern.h:
Canonical link: https://commits.webkit.org/320558@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications