[webkit-changes] [WebKit/WebKit] 93f3d4: [JSC] Fix recursive call's wasm repatch
Yusuke Suzuki
noreply at github.com
Mon Jan 30 10:32:31 PST 2023
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 93f3d4272ced975f1613aebe6e6d80978530fc81
https://github.com/WebKit/WebKit/commit/93f3d4272ced975f1613aebe6e6d80978530fc81
Author: Yusuke Suzuki <ysuzuki at apple.com>
Date: 2023-01-30 (Mon, 30 Jan 2023)
Changed paths:
M Source/JavaScriptCore/wasm/WasmBBQPlan.cpp
M Source/JavaScriptCore/wasm/WasmOMGPlan.cpp
Log Message:
-----------
[JSC] Fix recursive call's wasm repatch
https://bugs.webkit.org/show_bug.cgi?id=251333
rdar://104795248
Reviewed by Tadeu Zagallo.
We had a long-standing bug that we failed to repatch the recursive self-calls.
This is because,
1. We first repatch our calls of BBQ / OMG callee. This will get entrypoint from CalleeGroup. But for the self call, this will get old one.
So, we repatch with that.
2. Old Plan::.updateCallsitesToCallUs iterated all callees. But at that time, this newly created callee is not registered yet, so this does
not update the (1)'s callsites.
3. Now, registers this new callee. So (1)'s callsites still point to the old callee's code for recursive calls.
But fortunately, we now factor out these iteration code etc. to CallsiteCollection. And we can easily register (1)'s callee to the repatch
target by just calling addCallsites before calling updateCallsitesToCallUs. This patch just does it.
* Source/JavaScriptCore/wasm/WasmBBQPlan.cpp:
(JSC::Wasm::BBQPlan::work):
* Source/JavaScriptCore/wasm/WasmOMGPlan.cpp:
(JSC::Wasm::OMGPlan::work):
Canonical link: https://commits.webkit.org/259568@main
More information about the webkit-changes
mailing list