Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 0ca8f08b8936335761c02c8f24129340e257a502
https://github.com/WebKit/WebKit/commit/0ca8f08b8936335761c02c8f24129340e257a502
Author: Vassili Bykov <[email protected]>
Date: 2026-08-20 (Thu, 20 Aug 2026)
Changed paths:
M Source/JavaScriptCore/parser/Lexer.cpp
Log Message:
-----------
[JSC] Remove the obsolete optimization in Lexer::shift
https://bugs.webkit.org/show_bug.cgi?id=322038
rdar://185230995
Reviewed by Yijia Huang, Mark Lam, and Yusuke Suzuki.
Lexer::shift is implemented so that m_current is first unconditionally zeroed,
and then
set to contain the current character if the current position is within the
source bounds.
A comment explains that "At one point timing showed that setting m_current to 0
unconditionally was faster than an if-else sequence." That comment is 14 years
old and
the finding no longer holds on current hardware. The simple if-else now
performs better.
Covered by existing tests.
Canonical link: https://commits.webkit.org/319530@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications