-
Notifications
You must be signed in to change notification settings - Fork 227
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement exports-introduce-indice semantics (#871)
* Implement exports-introduce-indice semantics This commit implements part of WebAssembly/component-model#129, specifically the portion where an `export` item now introduces a fresh item into the relevant index space. This is going to be used by #867 to implement encoding/decoding of wit documents, specifically for `use` statements. This commit mostly implements the infrastructure necessary for this change rather than any other major changes internally. Functionally `export` statements now basically behave the same as `alias` statements within the validator. Eventually more validation will be required to ensure that functions use transitively-named types in all locations. Additionally the name that a type index is exported at will be relevant and will need exposing, but that'll come at a later date as well. It's hoped that exposing this information, as required for WIT encoding/decoding, will be a relatively small layer on the validator from this commit. * Update more tests and tools for types-define-aliases * Update the version number header of components This commit performs the first update of the binary header version number of the component binary encoding. The 4-byte header value, for core WebAssembly, is 0x00000001. This 4-byte header value is proposed to be reinterpreted as two 16-bit integers. The upper 16-bit integer of the 32-bit header version is reinterpreted as: * 0x0000 - this is a core module * 0x0001 - this is a component The lower 16-bits are then the version within the format. For core wasm the only supported version is 0x0001 and for components the previous supported version was 0x000a (with the intention to move to 0x0001 on stabilization). This 0xa header value has never changed throughout the lifetime of components but I would personally like to start using it for breaking changes to the binary format during development. In the spirit of that I've bumped it here to 0xb due to the change of how `export` introduces an alias. This should break almost all preexisting component binaries, indicating that a recompilation with newer tooling is required. It's hoped that the error message produced here will be more actionable than obscure indexing error messages. * Update with review comments * Update expected error message * Fix another test expectation
- Loading branch information
1 parent
b6233ed
commit edaf07e
Showing
113 changed files
with
1,643 additions
and
1,502 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
Oops, something went wrong.