WasmParser.js doesn't support WebAssembly GC proposal
Categories
(DevTools :: Debugger, defect, P3)
Tracking
(firefox115 fixed)
| Tracking | Status | |
|---|---|---|
| firefox115 | --- | fixed |
People
(Reporter: bashorov, Assigned: yury)
References
(Blocks 2 open bugs)
Details
Attachments
(3 files)
Steps to reproduce:
Firefox devtools unable to decompile wasm file generated by Kotlin/Wasm
Actual results:
It shows "Error occured during wast conversion : Unknown type kind: -49"
Expected results:
Decompiled wasm binary
Updated•2 years ago
|
Updated•2 years ago
|
Comment 1•2 years ago
|
||
It looks like the issue is in WasmParser.js not supporting the new types being introduced in the WebAssembly GC proposal.
I'm not sure if WasmParser.js is maintained anymore. It may make sense to try to switch to a different library? The wasm team contributes to wasm-tools which has a Rust crate for converting bytecode to text. Maybe we could compile that crate to wasm and use that as a replacement in devtools?
| Assignee | ||
Comment 2•2 years ago
•
|
||
(In reply to Ryan Hunt [:rhunt] from comment #1)
It looks like the issue is in WasmParser.js not supporting the new types being introduced in the WebAssembly GC proposal.
I'm not sure if WasmParser.js is maintained anymore. It may make sense to try to switch to a different library? The wasm team contributes to wasm-tools which has a Rust crate for converting bytecode to text. Maybe we could compile that crate to wasm and use that as a replacement in devtools?
The Chrome DevTools were using wasmparser.js at some point, and it is still in their codebase.
The main requirements for the bytecode-to-text library is to support mapping of bytecode offset to text lines (for debugging). I did not check if wasm-tools have this feature.
The Chrome DevTools were using wasmparser.js at some point, and it is still in their codebase.
AFAIK (at least inside source viewer/editor) they are using decompiler based on V8 internals.
| Assignee | ||
Comment 4•2 years ago
|
||
Submitted https://github.com/wasdk/wasmparser/pull/133 with Wasm GC milestone 6 codes.
| Assignee | ||
Comment 5•2 years ago
|
||
Updated•2 years ago
|
| Assignee | ||
Comment 6•2 years ago
|
||
Simple test that run something like:
(module
(rec
(type $t0 (struct (field f32)))
(type $t1 (sub $t0 (struct (field f32) (field i32))))
)
(func $f0 (param (ref null $t0)) (result (ref null $t1))
(ref.cast $t1
(local.get 0)
)
)
(func (export "main")
(drop
(call $f0
(struct.new_default $t1)))
)
)
(enable javascript.options.wasm_function_references javascript.options.wasm_gc)
Comment 8•2 years ago
|
||
| bugherder | ||
Description
•