[JSC][WASM][Debugger] Capture source bytes for streaming-compiled WebAssembly modules#62317
Conversation
|
EWS run on previous version of this PR (hash 5c63954) Details
|
5c63954 to
957a492
Compare
|
EWS run on previous version of this PR (hash 957a492) Details
|
| #if ENABLE(WEBASSEMBLY_DEBUGGER) | ||
| // Accumulate source bytes for the debugger — the streaming path has no single source vector. | ||
| if (Options::enableWasmDebugger()) [[unlikely]] | ||
| m_info->debugInfo->source.append(bytes); | ||
| #endif |
There was a problem hiding this comment.
Why not just transfer the bytes when the entry plan finishes?
There was a problem hiding this comment.
The bytes are transient m_buffer borrowed views into the caller's buffer that are gone once addBytes returns. StreamingParser processes them into ModuleInformation structures but does not retain the raw binary, so by the time the plan finishes and takeModuleInformation is called there are no bytes left to transfer. We must capture them here, as each chunk arrives.
957a492 to
7e8e635
Compare
|
EWS run on current version of this PR (hash 7e8e635) Details
|
…Assembly modules https://bugs.webkit.org/show_bug.cgi?id=311773 rdar://174362152 Reviewed by Keith Miller. WebAssembly.instantiateStreaming (and its compile variant) feed module bytes incrementally through StreamingCompiler::addBytes. Unlike the synchronous path, there is no single source vector that gets moved into ModuleInformation at the end — so debugInfo->source remained empty for every streaming-compiled module. Fix by accumulating bytes into debugInfo->source inside StreamingCompiler::addBytes (guarded by ENABLE(WEBASSEMBLY_DEBUGGER)). Guard the existing takeSource call in EntryPlan::takeModuleInformation so it no longer overwrites bytes that the streaming path already populated. Tests: * JSTests/wasm/debugger/tests/tests.py: (StreamingModuleLoadTestCase) Canonical link: https://commits.webkit.org/310852@main
7e8e635 to
e435f7f
Compare
|
Committed 310852@main (e435f7f): https://commits.webkit.org/310852@main Reviewed commits have been landed. Closing PR #62317 and removing active labels. |
e435f7f
7e8e635
🛠 ios🛠 mac🛠 wpe🛠 win🛠 ios-sim🛠 mac-AS-debug🧪 wpe-wk2🧪 win-tests🧪 ios-wk2🧪 api-mac🧪 api-wpe🧪 ios-wk2-wpt🧪 api-mac-debug🛠 gtk3-libwebrtc🛠 🧪 jsc🧪 api-ios🧪 mac-wk1🛠 🧪 jsc-debug-arm64🛠 ios-safer-cpp🧪 mac-wk2🛠 vision🧪 mac-AS-debug-wk2🛠 vision-sim🧪 mac-wk2-stress🛠 playstation🧪 vision-wk2🧪 mac-intel-wk2🛠 tv🛠 mac-safer-cpp🧪 jsc-armv7-tests🛠 tv-sim🛠 watch🛠 watch-sim