Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: d434a41411a3712e8b90d0ccb5866195d28079c3
https://github.com/WebKit/WebKit/commit/d434a41411a3712e8b90d0ccb5866195d28079c3
Author: Sergey Rubanov <[email protected]>
Date: 2026-07-29 (Wed, 29 Jul 2026)
Changed paths:
A JSTests/microbenchmarks/wasm-bbq-br-table-runs.js
A JSTests/wasm/stress/br-table-consecutive-target-runs.js
M Source/JavaScriptCore/jit/BinarySwitch.cpp
M Source/JavaScriptCore/jit/BinarySwitch.h
M Source/JavaScriptCore/wasm/WasmBBQJIT.cpp
Log Message:
-----------
[JSC][Wasm] Optimize BBQ br.table for consecutive same-target runs
https://bugs.webkit.org/show_bug.cgi?id=277686
Reviewed by Yusuke Suzuki.
BBQ used to emit a full binary search over every br.table index even when
long stretches shared the same target. Collapse consecutive identical
targets into runs and dispatch with unsigned range checks. Prefer the
jump table only when the number of runs is large enough, so dense tables
with few runs stay on the shallow path.
BinarySwitch takes those runs via a dedicated constructor over
span of (caseValue, runLength), rather than overloading the flat
span<int64_t> case list.
Stress forces BBQ and skips wasm-no-jit / wasm-no-wasm-jit modes,
which would set IPInt or BBQ off against the required options.
* Source/JavaScriptCore/jit/BinarySwitch.h:
* Source/JavaScriptCore/jit/BinarySwitch.cpp:
(JSC::BinarySwitch::BinarySwitch):
(JSC::BinarySwitch::advance):
(JSC::BinarySwitch::buildCheckRuns):
* Source/JavaScriptCore/wasm/WasmBBQJIT.cpp:
(JSC::Wasm::BBQJIT::addSwitch):
* JSTests/wasm/stress/br-table-consecutive-target-runs.js: Added.
* JSTests/microbenchmarks/wasm-bbq-br-table-runs.js: Added.
Canonical link: https://commits.webkit.org/318168@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications