-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Object Writer V1 Demo Features #123511
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
Object Writer V1 Demo Features #123511
Conversation
WasmObjectWriter Fix section incorrect section ordering after addition of table section
…tack
Fix {i32, i64}.const encoding (const should only ever be encoded as SLEB128
|
Two quick TODOs:
|
|
Note: Full support for proper wasm-level signature generation (including by-value structs) will depend on #123515 |
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
Summary: This PR adds essential WebAssembly module features to the crossgen2 object writer to generate usable WASM modules for testing. The changes enable data section offsets for runtime stack allocation, add a table section for function references, and implement type signature generation for methods.
Changes:
- Introduces a data section offset (0x10000 / 64KB) to reserve space for runtime stack
- Adds table section support with configurable size based on method count
- Refactors export functionality to support multiple export types (function, table, memory, global)
- Implements WebAssembly type signature generation from .NET method signatures, mapping .NET types to WASM value types
src/coreclr/tools/Common/Compiler/ObjectWriter/WasmObjectWriter.cs
Outdated
Show resolved
Hide resolved
src/coreclr/tools/Common/Compiler/ObjectWriter/WasmObjectWriter.cs
Outdated
Show resolved
Hide resolved
src/coreclr/tools/Common/Compiler/ObjectWriter/WasmObjectWriter.cs
Outdated
Show resolved
Hide resolved
src/coreclr/tools/Common/Compiler/ObjectWriter/WasmObjectWriter.cs
Outdated
Show resolved
Hide resolved
|
Tagging subscribers to 'arch-wasm': @lewing, @pavelsavara |
…r.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…r.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
kg
left a comment
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.
I'd like to get this in as-is and do any necessary cleanup in followup PRs
That sounds good to me, I've mostly been working on follow up to this PR. This seems blocked on CI? |
|
/ba-g infra failures |
These are (hopefully) the last few features needed to get a usable wasm module from crossgen2 that we can use in our test harness. It adds: