JIT: fill two gaps in wasm codegen - #132259
Open
AndyAyersMS wants to merge 1 commit into
Open
Conversation
genReturnSuspend pushed a zero of the native return type to keep the epilog's return well typed. A method returning through a buffer lowers to a wasm function with no result, so there is nothing to push, and its compRetNativeType (TYP_STRUCT) fell into the default arm. Vector128 returns by value as a v128 and was missing too. genEmitHelperCall only had signatures for four of the no-arg managed throw helpers. Add the rest; they are reachable from the unsupported intrinsic and out-of-range immediate paths. Neither reaches the product build, which crossgens only CoreLib and always passes -O. Found crossgenning System.Private.Xml, whose XmlTextReaderImpl.ParseTextAsync returns a ValueTuple`4 by buffer. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Member
Author
|
@adamperlin PTAL |
|
Azure Pipelines: Successfully started running 6 pipeline(s). 10 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR addresses two missing cases in the WebAssembly JIT backend to prevent invalid wasm codegen in async-suspend paths and to ensure managed throw helpers can always be emitted with a correct wasm signature.
Changes:
- Update
genReturnSuspendto avoid pushing a dummy return value for retbuf returns (wasm functions with no result) and to handleVector128<T>(v128) returns. - Extend
genEmitHelperCall’s hard-coded signature table to include additional no-arg managed throw helpers that are reachable from existing JIT paths.
Contributor
|
Tagging subscribers to 'arch-wasm': @lewing, @pavelsavara |
This was referenced Aug 13, 2026
Open
adamperlin
approved these changes
Aug 13, 2026
adamperlin
left a comment
Contributor
There was a problem hiding this comment.
Changes look good to me. The NativeAOT failure looks like it could be related to #132030, and the Wasm test failure is the existing GC issue it looks like.
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.
genReturnSuspend pushed a zero of the native return type to keep the epilog's return well typed. A method returning through a buffer lowers to a wasm function with no result, so there is nothing to push, and its compRetNativeType (TYP_STRUCT) fell into the default arm. Vector128 returns by value as a v128 and was missing too.
genEmitHelperCall only had signatures for four of the no-arg managed throw helpers. Add the rest; they are reachable from the unsupported intrinsic and out-of-range immediate paths.
Found crossgenning System.Private.Xml, whose XmlTextReaderImpl.ParseTextAsync returns a ValueTuple`4 by buffer.