Closed Bug 1692462 Opened 4 years ago Closed 4 years ago

Expand wasmDis to work on wasm modules

Categories

(Core :: JavaScript: WebAssembly, enhancement, P3)

enhancement

Tracking

()

RESOLVED FIXED
88 Branch
Tracking Status
firefox88 --- fixed

People

(Reporter: lth, Assigned: lth)

References

Details

Attachments

(1 file)

wasmDis run on a wasm module object should disassemble all functions in the module, with at least function boundaries marked. This doesn't look hard at all.

Extend the wasmDis testing function so that it can disassemble
entire wasm modules in addition to exported functions from wasm
instances, this makes it much more useful.

The current patch works and is useful and we could stop here, but there are a few things it would be useful to consider:

  • if the function has a name, print the name with the disassembly, not just the function index
  • if there is other information for the function, perhaps print that (TBD) (stretch goal to figure this out)
  • it would be nice to be able to select a specific function index in the module to disassemble, this ties into a comment i left in the code about more interesting options for configuring disassembly
  • it would be nice to be able to select to disassemble not just normal functions, but stubs and other types of code too, see ditto comment
  • this is getting complicated enough that a couple of test cases would be useful
Attachment #9205646 - Attachment description: Bug 1692462 - Disassemble functions in a wasm module (WIP) → Bug 1692462 - Disassemble functions in a wasm module. r?yury
Attachment #9205646 - Attachment description: Bug 1692462 - Disassemble functions in a wasm module. r?yury → Bug 1692462 - Disassemble wasm modules and instances. r?yury
Pushed by lhansen@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/d737bf8f1ca2 Disassemble wasm modules and instances. r=yury

The problem is that the use of std::function to capture the type of a lambda causes a (surprising, to me) introduction of a heap allocation. But using a pattern of a template to capture the unutterable type of the function + a move to ensure in-place construction, we avoid this.

Flags: needinfo?(lhansen)
Pushed by lhansen@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/8a2607cc1663 Disassemble wasm modules and instances. r=yury
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 88 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: