Skip to content

[wasm64] Add browser-wasm64 CoreCLR ReadyToRun support - #138171

Open
lewing wants to merge 6 commits into
feature/wasm64-interpreterfrom
feature/wasm64-r2r
Open

lewing wants to merge 6 commits into
feature/wasm64-interpreterfrom
feature/wasm64-r2r

Conversation

@lewing

@lewing lewing commented Nov 23, 2026 •

Copy link
Copy Markdown
Member

Adds browser-wasm64 CoreCLR ReadyToRun. This is layer 2 of the stack, on top of #138166 (interpreter). Library outerloop CI follows in layer 3.

  • JIT: wasm64 code generation in the Wasm JIT, built as the wasm64 cross-JIT.
  • crossgen2: memory64 Wasm/Webcil object writing, wasm64 thunks and WasmTargetPtr, plus the JIT interface, corinfo and helper updates.
  • VM: the matching corelib.h/jitinterface.cpp changes and the R2R async resume-info (DiagnosticIP) fixup in readytoruninfo.cpp.
  • Build: drops layer 1's interim R2R-off guards. The R2R CoreLib, framework and SDK InBuild targets are enabled like browser-wasm, and browser-wasm64 maps to the browser-wasm MIBC profile.
  • CI: turns on the R2R pass of the wasm64 runtime-test lane. R2R test wiring.
  • VM: the jump-stub allocator is excluded on all Wasm targets, like the other codeman Wasm guards. Docs: webcil.md describes the memory64 R2R wrapper (i64 bases, table64, patchWebcilHeader(i64, i32)).

Validated locally (macOS arm64, node 26):

  • ./build.sh -s provision.emsdk+clr+libs -os browser -arch wasm64 -c Release -rc checked passed, producing the cross-JIT and an R2R System.Private.CoreLib.wasm.
  • With crossgen2 R2R (RunCrossGen2=1) on wasm64:
    • readytorun/wasm/WasmInterpreterTransitions passed.
    • The async merged runner passed: 142 passed, 0 failed, 16 skipped. That includes async/regression/125805.
  • ./build.sh -s clr+libs -os browser -arch wasm -c Release -rc checked passed (wasm32 regression check). WasmInterpreterTransitions also passed under R2R on wasm32.

Note

This PR description was generated with GitHub Copilot.

@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging @dotnet/jit-contrib for JIT-EE GUID update

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 9 pipeline(s).
6 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @dotnet/crossgen-contrib
See info in area-owners.md if you want to be subscribed.

@lewing lewing added arch-wasm WebAssembly architecture os-browser Browser variant of arch-wasm labels Nov 23, 2026
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to 'arch-wasm': @lewing, @pavelsavara
See info in area-owners.md if you want to be subscribed.

lewing and others added 6 commits November 24, 2026 11:15
Add wasm64 code generation to the Wasm JIT, teach crossgen2 to emit
memory64 ReadyToRun Wasm/Webcil images, and wire up the runtime,
CoreLib, framework, SDK and runtime-test lane for ReadyToRun on
browser-wasm64. This removes the interim interpreter-only guards.

Co-authored-by: Copilot App <[email protected]>
…wrappers

Guard ExecutionManager::jumpStub/getNextJumpStub with HOST_64BIT && !TARGET_WASM,
matching the other Wasm exclusions in codeman; only native targets call them.
Describe the memory64 ReadyToRun wrapper imports and patchWebcilHeader in webcil.md.

Co-authored-by: Copilot App <[email protected]>
TargetsWasm and CLR_CMAKE_TARGET_ARCH_WASM now cover both widths, so use
them instead of comparing arch names, and CLR_CMAKE_TARGET_ARCH_WASM64 for
the wasm64-only gcinfo library.

Co-authored-by: Copilot App <[email protected]>
Follow the WASMARCH naming: bare TARGET_WASM, CLR_CMAKE_TARGET_ARCH_WASM and
TargetsWasm now mean 32-bit, so the ReadyToRun layer's any-width checks use
TARGET_WASMARCH, CLR_CMAKE_TARGET_ARCH_WASMARCH and TargetsWasmArch.

Co-authored-by: Copilot App <[email protected]>
TARGET_WASM now means 32-bit Wasm, so accept TARGET_WASMARCH in the JIT's
target-exclusivity checks, and teach SuperPMI about a wasm64 target.

Co-authored-by: Copilot App <[email protected]>
ReadyToRun now supports wasm64, so stop marking AlwaysUseCrossGen2 tests
unsupported there.

Co-authored-by: Copilot App <[email protected]>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

arch-wasm WebAssembly architecture area-ReadyToRun os-browser Browser variant of arch-wasm

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant