-
Notifications
You must be signed in to change notification settings - Fork 5.2k
[wasm] Use lightweight marshal for enums #118991
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
Conversation
Tagging subscribers to 'arch-wasm': @lewing |
Co-authored-by: Larry Ewing <[email protected]>
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.
Pull Request Overview
This PR enables lightweight marshalling for enum types in WebAssembly builds. The fix addresses a runtime marshalling issue where enums were not being recognized as supported types by the lightweight marshaller, even though they were marked as marshallable during the build process.
Key changes:
- Updated runtime marshalling logic to recognize enums as lightweight-marshallable types
- Added test coverage for enum marshalling through ZipArchive interop functionality
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
src/mono/mono/component/marshal-ilgen-stub.c | Added enum type check to allow lightweight marshalling for enums |
src/mono/wasm/testassets/WasmBasicTestApp/App/ZipArchiveInteropTest.cs | Added test class that exercises enum marshalling through ZipArchive operations |
src/mono/wasm/testassets/WasmBasicTestApp/App/wwwroot/main.js | Added test case entry point for ZipArchiveInteropTest |
src/mono/wasm/Wasm.Build.Tests/NativeBuildTests.cs | Added test method to verify ZipArchive enum marshalling functionality |
src/mono/wasm/testassets/WasmBasicTestApp/App/ZipArchiveInteropTest.cs
Outdated
Show resolved
Hide resolved
…pTest.cs Co-authored-by: Copilot <[email protected]>
/backport to release/10.0 |
Started backporting to release/10.0: https://github.com/dotnet/runtime/actions/runs/17425549273 |
* Use lightweight marshal for enums * Wasm build test * Fix * Fix test app build * Fix test app build * Fix test asserts * Fix test case * Build tests are not JS bundler friendly * Update src/mono/mono/component/marshal-ilgen-stub.c Co-authored-by: Larry Ewing <[email protected]> * Update src/mono/wasm/testassets/WasmBasicTestApp/App/ZipArchiveInteropTest.cs Co-authored-by: Copilot <[email protected]> --------- Co-authored-by: Larry Ewing <[email protected]> Co-authored-by: Copilot <[email protected]>
Based on
MinimalMarshalingTypeCompatibilityProvider.cs
we mark enums as marshallable by lightweight marshaller on build.We were missing enums when checking for supported types in
marshal-ilgen-stub.c
on runtime.Fixes #115780
Contributes to #94187