forked from bytecodealliance/wasm-tools
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update handling and parsing of element segments (bytecodealliance#1126)
* Update handling and parsing of element segments This commit started off by updating the spec testsuite submodule to the latest version and I ended up fixing various bits of parsing element segments. The changes here are a little subtle, but they are: * The text format for element segments was refactored and audited to attempt to match what's currently written in the spec. The spec testsuite doesn't look like it follows the spec perfectly so a few adjustments are made. The main change here functionally is that inline element segments on `table` definitions might now automatically switch a list-of-index text format into a list-of-expression binary format. This is what bytecodealliance#952 and its discussion was about. Other than this though some parsing has been tightened up as previously some invalid element segments were allowed and now require some more specifiers. For example `(elem)` was previously considered valid but that is no longer valid, instead it must be `(elem func)`. * The `wasmparser` and `wasm-encoder` crates have both removed the type field from their element segment representations, instead only having this type information on the list-of-expressions payload. This reflects how in the binary format the list-of-indexes form of element segments does not have type information. This was primarily done to adjust validation to pass a new test where a list-of-indexes element segment seems to be expected to fit in a table of `(ref func)`. This means that the type of the element segment previously inferred as `funcref` was no longer valid and instead it should be `(ref func)`. To better represent this these pieces were refactored internally. * Validation of the `table_init` instruction was updated to perform a subtyping check between the element segment and the destination table to allow initializing a nullable table with a non-nullable element segment, which is a valid operation where the types are not exactly equal. * One extra error message had to be allowed for some new spec tests about invalid modules. Overall this isn't expected to be a major update of any form. Just another in the long line of updates and adjustments to how element segments work and validate. * Fix benchmark
- Loading branch information
1 parent
a1b6b42
commit d88090e
Showing
225 changed files
with
1,769 additions
and
475 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.