Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 2217b2a8f16c571430432c58a99b894849a58230
https://github.com/WebKit/WebKit/commit/2217b2a8f16c571430432c58a99b894849a58230
Author: Claudio Saavedra <[email protected]>
Date: 2026-05-27 (Wed, 27 May 2026)
Changed paths:
M Source/WTF/wtf/Variant.h
Log Message:
-----------
REGRESSION(313528@main): [GCC] MotionMark regression in Skia-GPU
https://bugs.webkit.org/show_bug.cgi?id=315641
Reviewed by Geoffrey Garen.
313528@main simplified WTF::Variant and replaced the switch-based dispatcher in
the single-variant visit path with a C++17 fold expression of the form
((index == Is ? step_at<Is>(...) : void()), ...). GCC does not turn this fold
into a jump table and emits a linear cmp/branch cascade instead.
DisplayList::Item is a Variant with more than 60 alternatives, and it is visited
once per item while a display list is replayed, so each dispatch went from a
single indirect branch to as many as 60 comparisons. This regressed the
MotionMark Design and Multiply subtests on the WPE Skia GPU bot (Raspberry Pi 4,
GCC 13.3).
Upgrading the compiler does not fix it: GCC still emits the cascade on aarch64
through at least GCC 16. Clang lowers the same fold to a jump table, so the
regression only appeared on the GCC-built ports.
Restore an explicit switch in visit_alt_at for GCC, and leave the fold in place
for Clang, which already compiles it to a jump table and keeps the compile-time
improvement from 313528@main. The gate is on the compiler rather than a version,
since no GCC we tested recovers the fold reliably. The switch instantiates the
same step_at<I> bodies as the fold, so it is compile-time neutral on GCC; it is
also the dispatch shape that was in place before 313528@main.
* Source/WTF/wtf/Variant.h:
(mpark::detail::visitation::alt::visit_alt_at):
(mpark::detail::visitation::alt::switch_at):
Canonical link: https://commits.webkit.org/313961@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications