Uh oh!
There was an error while loading. Please reload this page.
[Wasm] Write barriers - #128225
Conversation
Tagging subscribers to this area: @agocke |
There was a problem hiding this comment.
Pull request overview
Initial scaffolding to make the WASM portable write barriers (RhpAssignRef, RhpCheckedAssignRef, RhpByRefAssignRef) use a "raw" calling convention that matches what RyuJIT expects for write barriers, rather than the trampolined WASM FCALL convention that threads callersStackPointer / portableEntryPointContext through. The actual barrier implementations still assert and will be filled in later.
Changes:
- Add new
FCDECL2_RAW/FCIMPL2_RAWmacros that bypass the WASM stack-pointer/entrypoint-context plumbing and define the function with the plain(a1, a2)signature; provide non-WASM fallbacks that alias toFCDECL2/FCIMPL2. - Switch the three
Rhp*AssignRefdeclarations injitinterface.hand definitions inWriteBarriers.cppto the new_RAWvariants. - Trivial whitespace cleanup in
jitinterface.h.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
src/coreclr/vm/fcall.h | Adds WASM-specific FCDECL2_RAW / FCIMPL2_RAW macros and non-WASM fallbacks aliasing to the standard FCDECL2 / FCIMPL2. |
src/coreclr/vm/jitinterface.h | Switches Rhp{Checked,ByRef,}AssignRef declarations to FCDECL2_RAW; trims trailing whitespace. |
src/coreclr/runtime/portable/WriteBarriers.cpp | Updates the three portable write-barrier stubs to use FCDECL2_RAW / FCIMPL2_RAW. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
a35761f to
6604569CompareUh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
f340b84 to
003a92cCompareUh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
kg
commented
May 22, 2026
@dotnet/jit-contrib PTAL |
Uh oh!
There was an error while loading. Please reload this page.
Sufficient for the R2R'd version of this to run without crashing:
Currently the write barrier in
ConcatTwoStringsfails due to the calling convention being wrong and then once the calling convention is fixed, it fails because we didn't implement the write barriers yet.This PR:
FCDECL2_RAW/FCIMPL2_RAWmacrosRhpByRefAssignRef's signature being incorrect (missing*)RhpByRefAssignRefon WasmgenCodeForStoreBlkto not useRhpByRefAssignRefanymorewasm/writebarriers.cppfile