-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for multi-value wasm #399
Conversation
Also r? @alexcrichton on the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Technically I think all the code for wasm-interface-types could stay as-is to work with older modules, but I like the idea better about being aggresive for removing older functionality
All the PRs in
|
Ok, all the blockers have been taken care of! Just rebased and this should be ready to go (assuming CI is green and review is positive). +cc @abrown |
0d3ac96
to
3ea3438
Compare
This is getting failures on windows that I don't understand and unfortunately I don't have a windows machine with me right now:
|
Hm, I'm not sure but there may be a way to tell |
Ah ok, I was finally able to reproduce the issues with windows. (I was previously passing The problem is that, unlike sys v, windows fast call doesn't give us a few registers that we can fit extra return values in without implementing full blown return pointers. I think the best course of action is to disable the multi-value spec tests on windows for now, land this, and then continue pursuing the cranelift PR for "real" multi-value. Will update the PR in a second. |
This has a bug fix for multi-value Wasm validation that is required for getting the spec tests passing. https://github.com/yurydelendik/wasmparser.rs/pull/135
The `cranelift_wasm` APIs had to change a little bit to maintain state necessary when translating multi-value Wasm blocks. The `translate_module` function now returns a `ModuleTranslationState` that is borrowed during each function's translation.
This enables all the Wasm multi-value proposal's spec tests other than the ones that rely on functions having more return values than registers available on the target. That is not supported by cranelift yet.
And remove the return pointer hacks that work around the lack of multi-value.
Alright CI is green! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great!
// multi-value, and we really should just implement multi-value in | ||
// wasm-bindgen. In the meantime though this synthesizes a return | ||
// pointer going as the first argument and translating outgoing | ||
// arguments reads from the return pointer. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Woohoo!
This relies on some PRs to other repos landing and/or being published to crates.io, nonetheless I think it is otherwise ready to land and ready for review.
r? @sunfishcode
TODO:
cut a new
wasmparser
release that includes https://github.com/yurydelendik/wasmparser.rs/pull/135 (cc @yurydelendik)cut a new
cranelift-wasm
release that includes:cranelift-wasm: Create
ModuleTranslationState
and polish API a little cranelift#1111deps: bump wasmparser dependency to 0.39.2 cranelift#1112
remove the TEMP commit and use those new releases in this PR instead