wasm-tools icon indicating copy to clipboard operation
wasm-tools copied to clipboard

workspace: Remove `wasmparser::Operator` type usage

Open Robbepop opened this issue 3 years ago • 0 comments

With https://github.com/bytecodealliance/wasm-tools/pull/697 merged it is possible to remove the Operator type from the wasmparser crate.

The new VisitOperator trait allows to parse and validate Wasm without the need for matching on an Operator. Instead respective visit methods are invoked which avoid unnecessary unpredictable branches and is therefore the preferred and recommended API to use for high-performance Wasm parsing and validation.

This issue tracks progress and discussion for removing the Operator type.

cc @alexcrichton

ToDo

  • [ ] Remove Operator type in the wasmparser crate.
    • [x] ConstExpr validation: https://github.com/bytecodealliance/wasm-tools/pull/737
    • [ ] enum Operator
  • [x] Remove Operator type in the wasmparser-dump crate.
    • https://github.com/bytecodealliance/wasm-tools/pull/712
  • [ ] Remove Operator type in the wasm-mutate crate.
  • [x] Remove Operator type in the wasmprinter crate.
    • https://github.com/bytecodealliance/wasm-tools/pull/721
  • [ ] Rewrite existing examples in terms of the new VisitOperator API.
  • [ ] Adjust docs for usage information about the new VisitOperator API.

Robbepop avatar Aug 11 '22 19:08 Robbepop