Add --emit-module-names to wasm-opt#8860
Open
mkustermann wants to merge 1 commit into
Open
Conversation
The `wasm-split` command has this `--emit-module-names` flag already and this adds it to `wasm-opt` as well. Wasm runtimes may not know the URL where a wasm file came from, it may only be given the bytes. Currently e.g. V8 prints a V8 specific hash of the wasm file in stack traces. If we have the ability to keep module names, then it would print the module name (fallback if the url is not available) -- which would allow a stack trace decoding tool to tie the module name back to the right wasm module of an app.
Member
|
Member
|
It's not clear to me that the fix for that chromium issue constitutes a "simpler way of naming modules," so I'd be happy to have this flag added to |
Contributor
Author
Precisely. The V8 bug was closed by making V8 stack frames contain a hash of the module bytes via an V8-internal hash function -- outside tooling that gets a stack trace with those hash codes cannot do anything with them (it's not a wasm spec'ed hash code function) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
wasm-splitcommand has this--emit-module-namesflag already and this adds it towasm-optas well.Wasm runtimes may not know the URL where a wasm file came from, it may only be given the bytes.
If so, then e.g. V8 prints a wasm-runtime-specific hash of the wasm bytes in stack traces. If a stack trace has
frames of different wasm modules, these hashes do not allow mapping the frames back to the original wasm files.
If we have the ability to keep module names, then it would print the module name (**) (instead of the hash) --
which would allow a stack trace decoding tool to tie the module name back to the right wasm module of an app.
(**) It prefers the wasm file url. If that isn't available it falls back to module name. If that isn't available it falls back to hash of wasm bytes.