Function references implementation for Wasmtime#6441
Function references implementation for Wasmtime#6441alexcrichton wants to merge 108 commits intobytecodealliance:mainfrom
Conversation
- Always support Index in blocktypes - Support Index as table type by pretending to be Func - Etc
This will ultimately be reverted when we refer to wasm-tools#function-references, which doesn't have peek, but does have type annotations on CallRef
There certainly need to be many more, but this at least catches the bugs fixed in the next commit
This isn't only used for null references
Don't initialize non-nullable locals to null, instead skip initialization entirely and wasm validation will ensure it's always initialized in the scope where it's used.
Use a `SignatureIndex` instead of a `u32` which while not 100% correct should be more correct. This additionally renames the `Index` variant to `TypedFunc` to leave space for future types which aren't functions to not all go into an `Index` variant. This required updates to Winch because `wasmtime_environ` types can no longer be converted back to their `wasmparser` equivalents. Additionally this means that all type translation needs to go through some form of context to resolve indices which is now encapsulated in a `TypeConvert` trait implemented in various locations.
Reduce some duplication and simplify some data structures to have a more direct form of table initialization and a bit more graceful handling of element-initialized tables. Additionally element-initialize tables are now treated the same as if there's a large element segment initializing them.
Subscribe to Label Actioncc @peterhuene DetailsThis issue or pull request has been labeled: "cranelift", "cranelift:wasm", "wasmtime:api", "wasmtime:config"Thus the following users have been cc'd because of the following labels:
To subscribe or unsubscribe from this label, edit the |
Label Messager: wasmtime:configIt looks like you are changing Wasmtime's configuration options. Make sure to
DetailsTo modify this label's message, edit the To add new label messages or remove existing label messages, edit the |
|
Actually, on second though, I'm going to do my PR-the-PR strategy instead of this. |
This is #5288 but with some more commits I've added onto the end to handle some comments I've noted during a "final" review pass. I think that everything should be in order now and there should be
FIXMEcomments on major ticket items still remaining to do after this PR.I've opened this as a second PR to provide my assistance in pushing this over the finish line. Many of my comments were relatively minor or stuff I would want to do quickly in a follow-up to help future-proof things as well so I figured I'd go ahead and make the changes here. The vast majority of this work is still Luna's and Daniel's!