Add support for reference type instructions#349
Draft
abelstuker wants to merge 2 commits intoTOPLLab:mainfrom
Draft
Add support for reference type instructions#349abelstuker wants to merge 2 commits intoTOPLLab:mainfrom
abelstuker wants to merge 2 commits intoTOPLLab:mainfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_ttable.gettable.setref.null(*)ref.is_nullref.functable.init(TODO: element segment copying) (*)table.copy(currently only single table allowed) (*)table.growtable.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-memoryflag added by the framework when compiling a spectest.