HomePhabricator

[WebAssembly] Initial Disassembler.

Description

[WebAssembly] Initial Disassembler.

This implements a new table-gen emitter to create tables for
a wasm disassembler, and a dissassembler to use them.

Comes with 2 tests, that tests a few instructions manually. Is also able to
disassemble large .wasm files with objdump reasonably.

Not working so well, to be addressed in followups:

  • objdump appears to be passing an incorrect starting point.
  • since the disassembler works an instruction at a time, and it is disassembling stack instruction, it has no idea of pseudo register assignments. These registers are required for the instruction printing code that follows. For now, all such registers appear in the output as $0.

Patch by Wouter van Oortmerssen

Differential Revision: https://reviews.llvm.org/D45848

Details

Committed
sbcMay 10 2018, 3:16 PM
Differential Revision
D45848: [WebAssembly] Initial Disassembler.
Parents
rL332051: Enable SANITIZER_INTERCEPTOR_HOOKS for NetBSD
Branches
Unknown
Tags
Unknown