Skip to content

Add support for reference type instructions#349

Draft
abelstuker wants to merge 2 commits intoTOPLLab:mainfrom
abelstuker:feat/reference-types
Draft

Add support for reference type instructions#349
abelstuker wants to merge 2 commits intoTOPLLab:mainfrom
abelstuker:feat/reference-types

Conversation

@abelstuker
Copy link
Copy Markdown
Contributor

Closes #296.

Implementing https://github.com/WebAssembly/spec/blob/main/proposals/reference-types/Overview.md.
This PR extends the interpreter with reference types funcref/externref and their corresponding instructions. To this end, the parsing logic of the Element(9) section is also enhanced. Support for the following instructions was added:

  • select_t
  • table.get
  • table.set
  • ref.null (*)
  • ref.is_null
  • ref.func
  • table.init (TODO: element segment copying) (*)
  • table.copy (currently only single table allowed) (*)
  • table.grow
  • table.size (*)
  • table.fill (*)

Warning

Support for multiple tables has not yet been introduced, but is a crucial part of the reference types specification.

(*) For these instructions, the official Wasm tests were not added to the Latch spectest suite yet. Some of them have functions that take or return a reference, which is currently not supported by Latch.

Finally, some spectests will fail with the current version of Latch. This is due to the --disable-bulk-memory flag added by the framework when compiling a spectest.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

📑 Reference types

1 participant