[webkit-changes] [WebKit/WebKit] 7202c5: [JSC] Use JumpTable in WasmBBQJIT
Yusuke Suzuki
noreply at github.com
Tue Mar 7 14:42:56 PST 2023
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 7202c59d1d29bec2ad6994e6c59aa4e27bf60f85
https://github.com/WebKit/WebKit/commit/7202c59d1d29bec2ad6994e6c59aa4e27bf60f85
Author: Yusuke Suzuki <ysuzuki at apple.com>
Date: 2023-03-07 (Tue, 07 Mar 2023)
Changed paths:
M Source/JavaScriptCore/wasm/WasmBBQJIT.cpp
M Source/JavaScriptCore/wasm/WasmBBQJIT.h
M Source/JavaScriptCore/wasm/WasmBBQPlan.cpp
M Source/JavaScriptCore/wasm/WasmBBQPlan.h
M Source/JavaScriptCore/wasm/WasmCallee.h
Log Message:
-----------
[JSC] Use JumpTable in WasmBBQJIT
https://bugs.webkit.org/show_bug.cgi?id=253472
rdar://106330476
Reviewed by Justin Michaud.
This patch implements JumpTable in WasmBBQJIT to implement wasm BrTable efficiently.
Currently, we are always doing binary-switch, which significantly bloats the code size.
Fortunately, wasm BrTable is super simple: targets are 0-N, and taking default if it exceeds N.
This is pretty easy to generate JumpTable for that.
We generate JumpTable in the link task, and put it in BBQCallee. It improves JetStream2/tsf-wasm's Runtime by 7~10%.
Before:
Running tsf-wasm:
Startup: 833.333
Run time: 3.415
Score: 53.349
After:
Running tsf-wasm:
Startup: 833.333
Run time: 3.652
Score: 55.169
* Source/JavaScriptCore/wasm/WasmBBQJIT.cpp:
(JSC::Wasm::BBQJIT::BBQJIT):
(JSC::Wasm::BBQJIT::addSwitch):
(JSC::Wasm::parseAndCompileBBQ):
* Source/JavaScriptCore/wasm/WasmBBQJIT.h:
* Source/JavaScriptCore/wasm/WasmBBQPlan.cpp:
(JSC::Wasm::BBQPlan::compileFunction):
* Source/JavaScriptCore/wasm/WasmBBQPlan.h:
* Source/JavaScriptCore/wasm/WasmCallee.h:
Canonical link: https://commits.webkit.org/261345@main
More information about the webkit-changes
mailing list