Skip to content

Fix wasm R2R JIT validation issues - #129555

Merged
AndyAyersMS merged 9 commits into
dotnet:mainfrom
AndyAyersMS:fix-wasm-r2r-jit-validation
Jun 22, 2026
Merged

Fix wasm R2R JIT validation issues#129555
AndyAyersMS merged 9 commits into
dotnet:mainfrom
AndyAyersMS:fix-wasm-r2r-jit-validation

Conversation

@AndyAyersMS

@AndyAyersMSAndyAyersMS commented Jun 18, 2026

Copy link
Copy Markdown
Member
  • Use call node type when forming wasm call signatures.
  • Treat GT_FRAME_SIZE as a wasm leaf during use-edge iteration.
  • Classify single-register struct call stores by wasm ABI type.
  • Preserve ABI segment widths for wasm parameter register remaps.
  • Use the return type for wasm fast tail calls (gtType is overwritten to TYP_VOID).
  • JIT/wasm: skip Try/ExnRefWrapper in findTargetDepth for plain br targets.
  • JIT/wasm: emit an explicit br for try-leave even when the target is the contiguous next block.
  • JIT/wasm: extend the exnref wrapper to the catch-resumption dispatcher.
  • JIT/wasm: sort intervals by Start before conflict resolution (cross-try-exit Block intervals are backdated to start at the try header, breaking the non-decreasing-start-order invariant).
  • VM/wasm: use the slow IsFilterFunclet path for wasm R2R (wasm doesn't use personality routines in unwind data). (fixesWasm / R2R: IsFilterFunclet assertion fires when re-throwing from a finally after a cctor failure (throwinclassconstructor) #129341)
  • JIT/wasm: skip the emitter-driven LCL_ADDR GC-tracking assert (wasm uses stack-slot GC info, not fixed-register tracking).

Issue: #129497

- Use call node type when forming wasm call signatures.
- Treat GT_FRAME_SIZE as a wasm leaf during use-edge iteration.
- Classify single-register struct call stores by wasm ABI type.
- Preserve ABI segment widths for wasm parameter register remaps.
- Bail out on wasm method/call signatures over the engine limit.
Issue: dotnet#129497
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
CopilotAI review requested due to automatic review settings June 18, 2026 01:42
@AndyAyersMS

Copy link
Copy Markdown
MemberAuthor

@adamperlin PTAL
fyi @dotnet/wasm-contrib

@github-actionsgithub-actionsBot added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Jun 18, 2026

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

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 adjusts WebAssembly (Wasm) JIT/R2R codegen plumbing to produce wasm-valid call/method signatures and to avoid validation/assert failures in several JIT phases when compiling for Wasm.

Changes:

  • Update Wasm call signature construction and add explicit bailouts when a call/function would exceed the Wasm engine parameter limit (1000).
  • Treat GT_FRAME_SIZE as a leaf for Wasm during use-edge iteration to avoid consumers assuming it has operands.
  • Refine Wasm ABI typing in lowering for single-register struct call stores and preserve ABI segment widths when inducing parameter-register locals.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
FileDescription
src/coreclr/jit/lower.cppAdjusts Wasm ABI-based typing for single-reg struct call stores; preserves register-segment type widths for induced parameter locals.
src/coreclr/jit/lclvars.cppAdds a Wasm-specific compilation bailout when the function argument count exceeds the Wasm engine limit.
src/coreclr/jit/gentree.cppTreats GT_FRAME_SIZE as a leaf for Wasm in GenTreeUseEdgeIterator.
src/coreclr/jit/error.hIntroduces WASM_IMPL_LIMITATION macro (Wasm-only impl-limitation helper).
src/coreclr/jit/compiler.hDefines MaxWasmFunctionParameters constant for Wasm.
src/coreclr/jit/codegenwasm.cppAdjusts wasm call signature construction and adds a call-argument-count bailout prior to requesting a type symbol.

Comment threadsrc/coreclr/jit/codegenwasm.cpp Outdated
Comment threadsrc/coreclr/jit/error.h Outdated
Comment threadsrc/coreclr/jit/error.h Outdated
Comment threadsrc/coreclr/jit/compiler.h Outdated
AndyAyersMSand others added 5 commits June 18, 2026 07:45
For fast tail calls gtType is overwritten to TYP_VOID, so use gtReturnType when forming the wasm call signature.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Cross-try-exit Block intervals are backdated to start at the try
header, breaking the non-decreasing-start-order invariant assumed by
the resolve loop.
@AndyAyersMS

Copy link
Copy Markdown
MemberAuthor

Not entirely happy with the "backdate" fix for branches out of try interval. Seems like constraint solving ought to be able to handle it, if a block overlaps a try (and since trys are single entry this means the block begins inside the try and ends outside) it should just stretch to encompass the try and (now) the two wrapper intervals.

Some of the other fixes are consequences of codegen inserting code (namely the post-try unreached and exception-capturing store) without having IR; this may also be something to revisit.

Wasm R2R doesn't use personality routines in unwind data, so fall back
to the slow EH-clause walk like X86 does.
CopilotAI review requested due to automatic review settings June 19, 2026 13:43
@pavelsavarapavelsavara added the arch-wasm WebAssembly architecture label Jun 19, 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.

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.

Comment threadsrc/coreclr/jit/lower.cpp
@AndyAyersMS

Copy link
Copy Markdown
MemberAuthor

Pri-0 R2R sweep impact

BaselineAfter these commits
Tests (merged-runner XML)6991299
Pass5611161 (+600)
Fail51
Wrapper failures2820

A separate Pri-1 sweep on top of these commits shows 1738 / 1909 tests pass (91.0%). No new R2R-specific failure modes surfaced in the broader Pri-1 set; remaining wrapper failures are tracked separately in #129622 and #129337.

Wasm uses stack-slot GC info encoding rather than fixed-register tracking,
so the emitter concern this assert guards (live updates for LCL_ADDR DEFs
of tracked GC vars) does not apply.
CopilotAI review requested due to automatic review settings June 19, 2026 18:40

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated no new comments.

@davidwrightondavidwrighton left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

VM changes look good. JIT looks good too, but I'm not a good reviewer of JIT changes. :)

@adamperlinadamperlin left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

JIT changes lgtm from what I understand!

@AndyAyersMS
AndyAyersMS merged commit 72788f0 into dotnet:mainJun 22, 2026
136 of 138 checks passed
@dotnet-milestone-botdotnet-milestone-botBot added this to the 11.0-preview6 milestone Jun 23, 2026
eiriktsarpalis pushed a commit that referenced this pull request Jul 15, 2026
- Use call node type when forming wasm call signatures.
- Treat `GT_FRAME_SIZE` as a wasm leaf during use-edge iteration.
- Classify single-register struct call stores by wasm ABI type.
- Preserve ABI segment widths for wasm parameter register remaps.
- Use the return type for wasm fast tail calls (gtType is overwritten to
TYP_VOID).
- JIT/wasm: skip Try/ExnRefWrapper in `findTargetDepth` for plain br
targets.
- JIT/wasm: emit an explicit br for try-leave even when the target is
the contiguous next block.
- JIT/wasm: extend the exnref wrapper to the catch-resumption
dispatcher.
- JIT/wasm: sort intervals by Start before conflict resolution
(cross-try-exit Block intervals are backdated to start at the try
header, breaking the non-decreasing-start-order invariant).
- VM/wasm: use the slow `IsFilterFunclet` path for wasm R2R (wasm
doesn't use personality routines in unwind data). (fixes#129341)
- JIT/wasm: skip the emitter-driven LCL_ADDR GC-tracking assert (wasm
uses stack-slot GC info, not fixed-register tracking).
Issue: #129497
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actionsgithub-actionsBot locked and limited conversation to collaborators Jul 24, 2026
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

arch-wasmWebAssembly architecturearea-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Wasm / R2R: IsFilterFunclet assertion fires when re-throwing from a finally after a cctor failure (throwinclassconstructor)

6 participants

@AndyAyersMS@adamperlin@davidwrighton@SingleAccretion@pavelsavara
, 'i'); if (__m === '*' || __re.test(location.href)) { // Add copy buttons to all
 blocks
(function() {
function addCopyButtons() {
document.querySelectorAll('pre code').forEach(function(codeBlock) {
if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;
codeBlock.parentElement.setAttribute('data-copy-added', 'true');
var btn = document.createElement('button');
btn.textContent = 'Copy';
btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';
btn.onmouseover = function() { this.style.opacity = '1'; };
btn.onmouseout = function() { this.style.opacity = '0.7'; };
btn.onclick = function() {
navigator.clipboard.writeText(codeBlock.textContent).then(function() {
btn.textContent = 'Copied!';
setTimeout(function() { btn.textContent = 'Copy'; }, 1500);
});
};
codeBlock.parentElement.style.position = 'relative';
codeBlock.parentElement.appendChild(btn);
});
}
addCopyButtons();
// Re-run on dynamic content
var observer = new MutationObserver(addCopyButtons);
observer.observe(document.body, { childList: true, subtree: true });
})();
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
Fix wasm R2R JIT validation issues by AndyAyersMS · Pull Request #129555 · dotnet/runtime · GitHub
Skip to content

Fix wasm R2R JIT validation issues - #129555

Merged
AndyAyersMS merged 9 commits into
dotnet:mainfrom
AndyAyersMS:fix-wasm-r2r-jit-validation
Jun 22, 2026
Merged

Fix wasm R2R JIT validation issues#129555
AndyAyersMS merged 9 commits into
dotnet:mainfrom
AndyAyersMS:fix-wasm-r2r-jit-validation

Conversation

@AndyAyersMS

@AndyAyersMSAndyAyersMS commented Jun 18, 2026

Copy link
Copy Markdown
Member
  • Use call node type when forming wasm call signatures.
  • Treat GT_FRAME_SIZE as a wasm leaf during use-edge iteration.
  • Classify single-register struct call stores by wasm ABI type.
  • Preserve ABI segment widths for wasm parameter register remaps.
  • Use the return type for wasm fast tail calls (gtType is overwritten to TYP_VOID).
  • JIT/wasm: skip Try/ExnRefWrapper in findTargetDepth for plain br targets.
  • JIT/wasm: emit an explicit br for try-leave even when the target is the contiguous next block.
  • JIT/wasm: extend the exnref wrapper to the catch-resumption dispatcher.
  • JIT/wasm: sort intervals by Start before conflict resolution (cross-try-exit Block intervals are backdated to start at the try header, breaking the non-decreasing-start-order invariant).
  • VM/wasm: use the slow IsFilterFunclet path for wasm R2R (wasm doesn't use personality routines in unwind data). (fixesWasm / R2R: IsFilterFunclet assertion fires when re-throwing from a finally after a cctor failure (throwinclassconstructor) #129341)
  • JIT/wasm: skip the emitter-driven LCL_ADDR GC-tracking assert (wasm uses stack-slot GC info, not fixed-register tracking).

Issue: #129497

- Use call node type when forming wasm call signatures.
- Treat GT_FRAME_SIZE as a wasm leaf during use-edge iteration.
- Classify single-register struct call stores by wasm ABI type.
- Preserve ABI segment widths for wasm parameter register remaps.
- Bail out on wasm method/call signatures over the engine limit.
Issue: dotnet#129497
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
CopilotAI review requested due to automatic review settings June 18, 2026 01:42
@AndyAyersMS

Copy link
Copy Markdown
MemberAuthor

@adamperlin PTAL
fyi @dotnet/wasm-contrib

@github-actionsgithub-actionsBot added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Jun 18, 2026

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

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 adjusts WebAssembly (Wasm) JIT/R2R codegen plumbing to produce wasm-valid call/method signatures and to avoid validation/assert failures in several JIT phases when compiling for Wasm.

Changes:

  • Update Wasm call signature construction and add explicit bailouts when a call/function would exceed the Wasm engine parameter limit (1000).
  • Treat GT_FRAME_SIZE as a leaf for Wasm during use-edge iteration to avoid consumers assuming it has operands.
  • Refine Wasm ABI typing in lowering for single-register struct call stores and preserve ABI segment widths when inducing parameter-register locals.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
FileDescription
src/coreclr/jit/lower.cppAdjusts Wasm ABI-based typing for single-reg struct call stores; preserves register-segment type widths for induced parameter locals.
src/coreclr/jit/lclvars.cppAdds a Wasm-specific compilation bailout when the function argument count exceeds the Wasm engine limit.
src/coreclr/jit/gentree.cppTreats GT_FRAME_SIZE as a leaf for Wasm in GenTreeUseEdgeIterator.
src/coreclr/jit/error.hIntroduces WASM_IMPL_LIMITATION macro (Wasm-only impl-limitation helper).
src/coreclr/jit/compiler.hDefines MaxWasmFunctionParameters constant for Wasm.
src/coreclr/jit/codegenwasm.cppAdjusts wasm call signature construction and adds a call-argument-count bailout prior to requesting a type symbol.

Comment threadsrc/coreclr/jit/codegenwasm.cpp Outdated
Comment threadsrc/coreclr/jit/error.h Outdated
Comment threadsrc/coreclr/jit/error.h Outdated
Comment threadsrc/coreclr/jit/compiler.h Outdated
AndyAyersMSand others added 5 commits June 18, 2026 07:45
For fast tail calls gtType is overwritten to TYP_VOID, so use gtReturnType when forming the wasm call signature.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Cross-try-exit Block intervals are backdated to start at the try
header, breaking the non-decreasing-start-order invariant assumed by
the resolve loop.
@AndyAyersMS

Copy link
Copy Markdown
MemberAuthor

Not entirely happy with the "backdate" fix for branches out of try interval. Seems like constraint solving ought to be able to handle it, if a block overlaps a try (and since trys are single entry this means the block begins inside the try and ends outside) it should just stretch to encompass the try and (now) the two wrapper intervals.

Some of the other fixes are consequences of codegen inserting code (namely the post-try unreached and exception-capturing store) without having IR; this may also be something to revisit.

Wasm R2R doesn't use personality routines in unwind data, so fall back
to the slow EH-clause walk like X86 does.
CopilotAI review requested due to automatic review settings June 19, 2026 13:43
@pavelsavarapavelsavara added the arch-wasm WebAssembly architecture label Jun 19, 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.

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.

Comment threadsrc/coreclr/jit/lower.cpp
@AndyAyersMS

Copy link
Copy Markdown
MemberAuthor

Pri-0 R2R sweep impact

BaselineAfter these commits
Tests (merged-runner XML)6991299
Pass5611161 (+600)
Fail51
Wrapper failures2820

A separate Pri-1 sweep on top of these commits shows 1738 / 1909 tests pass (91.0%). No new R2R-specific failure modes surfaced in the broader Pri-1 set; remaining wrapper failures are tracked separately in #129622 and #129337.

Wasm uses stack-slot GC info encoding rather than fixed-register tracking,
so the emitter concern this assert guards (live updates for LCL_ADDR DEFs
of tracked GC vars) does not apply.
CopilotAI review requested due to automatic review settings June 19, 2026 18:40

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated no new comments.

@davidwrightondavidwrighton left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

VM changes look good. JIT looks good too, but I'm not a good reviewer of JIT changes. :)

@adamperlinadamperlin left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

JIT changes lgtm from what I understand!

@AndyAyersMS
AndyAyersMS merged commit 72788f0 into dotnet:mainJun 22, 2026
136 of 138 checks passed
@dotnet-milestone-botdotnet-milestone-botBot added this to the 11.0-preview6 milestone Jun 23, 2026
eiriktsarpalis pushed a commit that referenced this pull request Jul 15, 2026
- Use call node type when forming wasm call signatures.
- Treat `GT_FRAME_SIZE` as a wasm leaf during use-edge iteration.
- Classify single-register struct call stores by wasm ABI type.
- Preserve ABI segment widths for wasm parameter register remaps.
- Use the return type for wasm fast tail calls (gtType is overwritten to
TYP_VOID).
- JIT/wasm: skip Try/ExnRefWrapper in `findTargetDepth` for plain br
targets.
- JIT/wasm: emit an explicit br for try-leave even when the target is
the contiguous next block.
- JIT/wasm: extend the exnref wrapper to the catch-resumption
dispatcher.
- JIT/wasm: sort intervals by Start before conflict resolution
(cross-try-exit Block intervals are backdated to start at the try
header, breaking the non-decreasing-start-order invariant).
- VM/wasm: use the slow `IsFilterFunclet` path for wasm R2R (wasm
doesn't use personality routines in unwind data). (fixes#129341)
- JIT/wasm: skip the emitter-driven LCL_ADDR GC-tracking assert (wasm
uses stack-slot GC info, not fixed-register tracking).
Issue: #129497
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actionsgithub-actionsBot locked and limited conversation to collaborators Jul 24, 2026
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

arch-wasmWebAssembly architecturearea-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Wasm / R2R: IsFilterFunclet assertion fires when re-throwing from a finally after a cctor failure (throwinclassconstructor)

6 participants

@AndyAyersMS@adamperlin@davidwrighton@SingleAccretion@pavelsavara
, 'i'); if (__m === '*' || __re.test(location.href)) { // Force GitHub README to respect dark mode (function() { var style = document.createElement('style'); style.textContent = ' .markdown-body { color-scheme: dark light; } .markdown-body pre { background: #161b22 !important; } .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; } .markdown-body table th, .markdown-body table td { border-color: #30363d !important; } .markdown-body img { background: #0d1117; } .markdown-body blockquote { border-left-color: #8b949e; } .markdown-body hr { border-color: #30363d; } '; document.head.appendChild(style); })(); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' Fix wasm R2R JIT validation issues by AndyAyersMS · Pull Request #129555 · dotnet/runtime · GitHub
Skip to content

Fix wasm R2R JIT validation issues - #129555

Merged
AndyAyersMS merged 9 commits into
dotnet:mainfrom
AndyAyersMS:fix-wasm-r2r-jit-validation
Jun 22, 2026
Merged

Fix wasm R2R JIT validation issues#129555
AndyAyersMS merged 9 commits into
dotnet:mainfrom
AndyAyersMS:fix-wasm-r2r-jit-validation

Conversation

@AndyAyersMS

@AndyAyersMSAndyAyersMS commented Jun 18, 2026

Copy link
Copy Markdown
Member
  • Use call node type when forming wasm call signatures.
  • Treat GT_FRAME_SIZE as a wasm leaf during use-edge iteration.
  • Classify single-register struct call stores by wasm ABI type.
  • Preserve ABI segment widths for wasm parameter register remaps.
  • Use the return type for wasm fast tail calls (gtType is overwritten to TYP_VOID).
  • JIT/wasm: skip Try/ExnRefWrapper in findTargetDepth for plain br targets.
  • JIT/wasm: emit an explicit br for try-leave even when the target is the contiguous next block.
  • JIT/wasm: extend the exnref wrapper to the catch-resumption dispatcher.
  • JIT/wasm: sort intervals by Start before conflict resolution (cross-try-exit Block intervals are backdated to start at the try header, breaking the non-decreasing-start-order invariant).
  • VM/wasm: use the slow IsFilterFunclet path for wasm R2R (wasm doesn't use personality routines in unwind data). (fixesWasm / R2R: IsFilterFunclet assertion fires when re-throwing from a finally after a cctor failure (throwinclassconstructor) #129341)
  • JIT/wasm: skip the emitter-driven LCL_ADDR GC-tracking assert (wasm uses stack-slot GC info, not fixed-register tracking).

Issue: #129497

- Use call node type when forming wasm call signatures.
- Treat GT_FRAME_SIZE as a wasm leaf during use-edge iteration.
- Classify single-register struct call stores by wasm ABI type.
- Preserve ABI segment widths for wasm parameter register remaps.
- Bail out on wasm method/call signatures over the engine limit.
Issue: dotnet#129497
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
CopilotAI review requested due to automatic review settings June 18, 2026 01:42
@AndyAyersMS

Copy link
Copy Markdown
MemberAuthor

@adamperlin PTAL
fyi @dotnet/wasm-contrib

@github-actionsgithub-actionsBot added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Jun 18, 2026

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

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 adjusts WebAssembly (Wasm) JIT/R2R codegen plumbing to produce wasm-valid call/method signatures and to avoid validation/assert failures in several JIT phases when compiling for Wasm.

Changes:

  • Update Wasm call signature construction and add explicit bailouts when a call/function would exceed the Wasm engine parameter limit (1000).
  • Treat GT_FRAME_SIZE as a leaf for Wasm during use-edge iteration to avoid consumers assuming it has operands.
  • Refine Wasm ABI typing in lowering for single-register struct call stores and preserve ABI segment widths when inducing parameter-register locals.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
FileDescription
src/coreclr/jit/lower.cppAdjusts Wasm ABI-based typing for single-reg struct call stores; preserves register-segment type widths for induced parameter locals.
src/coreclr/jit/lclvars.cppAdds a Wasm-specific compilation bailout when the function argument count exceeds the Wasm engine limit.
src/coreclr/jit/gentree.cppTreats GT_FRAME_SIZE as a leaf for Wasm in GenTreeUseEdgeIterator.
src/coreclr/jit/error.hIntroduces WASM_IMPL_LIMITATION macro (Wasm-only impl-limitation helper).
src/coreclr/jit/compiler.hDefines MaxWasmFunctionParameters constant for Wasm.
src/coreclr/jit/codegenwasm.cppAdjusts wasm call signature construction and adds a call-argument-count bailout prior to requesting a type symbol.

Comment threadsrc/coreclr/jit/codegenwasm.cpp Outdated
Comment threadsrc/coreclr/jit/error.h Outdated
Comment threadsrc/coreclr/jit/error.h Outdated
Comment threadsrc/coreclr/jit/compiler.h Outdated
AndyAyersMSand others added 5 commits June 18, 2026 07:45
For fast tail calls gtType is overwritten to TYP_VOID, so use gtReturnType when forming the wasm call signature.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Cross-try-exit Block intervals are backdated to start at the try
header, breaking the non-decreasing-start-order invariant assumed by
the resolve loop.
@AndyAyersMS

Copy link
Copy Markdown
MemberAuthor

Not entirely happy with the "backdate" fix for branches out of try interval. Seems like constraint solving ought to be able to handle it, if a block overlaps a try (and since trys are single entry this means the block begins inside the try and ends outside) it should just stretch to encompass the try and (now) the two wrapper intervals.

Some of the other fixes are consequences of codegen inserting code (namely the post-try unreached and exception-capturing store) without having IR; this may also be something to revisit.

Wasm R2R doesn't use personality routines in unwind data, so fall back
to the slow EH-clause walk like X86 does.
CopilotAI review requested due to automatic review settings June 19, 2026 13:43
@pavelsavarapavelsavara added the arch-wasm WebAssembly architecture label Jun 19, 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.

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.

Comment threadsrc/coreclr/jit/lower.cpp
@AndyAyersMS

Copy link
Copy Markdown
MemberAuthor

Pri-0 R2R sweep impact

BaselineAfter these commits
Tests (merged-runner XML)6991299
Pass5611161 (+600)
Fail51
Wrapper failures2820

A separate Pri-1 sweep on top of these commits shows 1738 / 1909 tests pass (91.0%). No new R2R-specific failure modes surfaced in the broader Pri-1 set; remaining wrapper failures are tracked separately in #129622 and #129337.

Wasm uses stack-slot GC info encoding rather than fixed-register tracking,
so the emitter concern this assert guards (live updates for LCL_ADDR DEFs
of tracked GC vars) does not apply.
CopilotAI review requested due to automatic review settings June 19, 2026 18:40

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated no new comments.

@davidwrightondavidwrighton left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

VM changes look good. JIT looks good too, but I'm not a good reviewer of JIT changes. :)

@adamperlinadamperlin left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

JIT changes lgtm from what I understand!

@AndyAyersMS
AndyAyersMS merged commit 72788f0 into dotnet:mainJun 22, 2026
136 of 138 checks passed
@dotnet-milestone-botdotnet-milestone-botBot added this to the 11.0-preview6 milestone Jun 23, 2026
eiriktsarpalis pushed a commit that referenced this pull request Jul 15, 2026
- Use call node type when forming wasm call signatures.
- Treat `GT_FRAME_SIZE` as a wasm leaf during use-edge iteration.
- Classify single-register struct call stores by wasm ABI type.
- Preserve ABI segment widths for wasm parameter register remaps.
- Use the return type for wasm fast tail calls (gtType is overwritten to
TYP_VOID).
- JIT/wasm: skip Try/ExnRefWrapper in `findTargetDepth` for plain br
targets.
- JIT/wasm: emit an explicit br for try-leave even when the target is
the contiguous next block.
- JIT/wasm: extend the exnref wrapper to the catch-resumption
dispatcher.
- JIT/wasm: sort intervals by Start before conflict resolution
(cross-try-exit Block intervals are backdated to start at the try
header, breaking the non-decreasing-start-order invariant).
- VM/wasm: use the slow `IsFilterFunclet` path for wasm R2R (wasm
doesn't use personality routines in unwind data). (fixes#129341)
- JIT/wasm: skip the emitter-driven LCL_ADDR GC-tracking assert (wasm
uses stack-slot GC info, not fixed-register tracking).
Issue: #129497
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actionsgithub-actionsBot locked and limited conversation to collaborators Jul 24, 2026
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

arch-wasmWebAssembly architecturearea-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Wasm / R2R: IsFilterFunclet assertion fires when re-throwing from a finally after a cctor failure (throwinclassconstructor)

6 participants

@AndyAyersMS@adamperlin@davidwrighton@SingleAccretion@pavelsavara
, 'i'); if (__m === '*' || __re.test(location.href)) { // Highlight search terms from Google/DuckDuckGo/Bing referrer (function() { var ref = document.referrer; var terms = []; if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) { var url = new URL(ref); var q = url.searchParams.get('q') || url.searchParams.get('p'); if (q) { terms = q.split(/\s+/).filter(function(t) { return t.length > 2; }); } } if (terms.length === 0) return; var style = document.createElement('style'); style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }'; document.head.appendChild(style); function highlight(node) { if (node.nodeType === 3) { // text node var text = node.textContent; var found = false; terms.forEach(function(term) { var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\]\\]/g, '\\') + ')', 'gi'); if (regex.test(text)) { found = true; var frag = document.createDocumentFragment(); var parts = text.split(regex); parts.forEach(function(part, i) { if (i % 2 === 0) { frag.appendChild(document.createTextNode(part)); } else { var span = document.createElement('span'); span.className = 'userscript-highlight'; span.textContent = part; frag.appendChild(span); } }); node.parentNode.replaceChild(frag, node); } }); } else if (node.nodeType === 1 && node.childNodes) { // element var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT']; if (!skipTags.includes(node.tagName)) { Array.from(node.childNodes).forEach(highlight); } } } highlight(document.body); // Re-highlight on dynamic content var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1 || node.nodeType === 3) highlight(node); }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' Fix wasm R2R JIT validation issues by AndyAyersMS · Pull Request #129555 · dotnet/runtime · GitHub
Skip to content

Fix wasm R2R JIT validation issues - #129555

Merged
AndyAyersMS merged 9 commits into
dotnet:mainfrom
AndyAyersMS:fix-wasm-r2r-jit-validation
Jun 22, 2026
Merged

Fix wasm R2R JIT validation issues#129555
AndyAyersMS merged 9 commits into
dotnet:mainfrom
AndyAyersMS:fix-wasm-r2r-jit-validation

Conversation

@AndyAyersMS

@AndyAyersMSAndyAyersMS commented Jun 18, 2026

Copy link
Copy Markdown
Member
  • Use call node type when forming wasm call signatures.
  • Treat GT_FRAME_SIZE as a wasm leaf during use-edge iteration.
  • Classify single-register struct call stores by wasm ABI type.
  • Preserve ABI segment widths for wasm parameter register remaps.
  • Use the return type for wasm fast tail calls (gtType is overwritten to TYP_VOID).
  • JIT/wasm: skip Try/ExnRefWrapper in findTargetDepth for plain br targets.
  • JIT/wasm: emit an explicit br for try-leave even when the target is the contiguous next block.
  • JIT/wasm: extend the exnref wrapper to the catch-resumption dispatcher.
  • JIT/wasm: sort intervals by Start before conflict resolution (cross-try-exit Block intervals are backdated to start at the try header, breaking the non-decreasing-start-order invariant).
  • VM/wasm: use the slow IsFilterFunclet path for wasm R2R (wasm doesn't use personality routines in unwind data). (fixesWasm / R2R: IsFilterFunclet assertion fires when re-throwing from a finally after a cctor failure (throwinclassconstructor) #129341)
  • JIT/wasm: skip the emitter-driven LCL_ADDR GC-tracking assert (wasm uses stack-slot GC info, not fixed-register tracking).

Issue: #129497

- Use call node type when forming wasm call signatures.
- Treat GT_FRAME_SIZE as a wasm leaf during use-edge iteration.
- Classify single-register struct call stores by wasm ABI type.
- Preserve ABI segment widths for wasm parameter register remaps.
- Bail out on wasm method/call signatures over the engine limit.
Issue: dotnet#129497
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
CopilotAI review requested due to automatic review settings June 18, 2026 01:42
@AndyAyersMS

Copy link
Copy Markdown
MemberAuthor

@adamperlin PTAL
fyi @dotnet/wasm-contrib

@github-actionsgithub-actionsBot added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Jun 18, 2026

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

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 adjusts WebAssembly (Wasm) JIT/R2R codegen plumbing to produce wasm-valid call/method signatures and to avoid validation/assert failures in several JIT phases when compiling for Wasm.

Changes:

  • Update Wasm call signature construction and add explicit bailouts when a call/function would exceed the Wasm engine parameter limit (1000).
  • Treat GT_FRAME_SIZE as a leaf for Wasm during use-edge iteration to avoid consumers assuming it has operands.
  • Refine Wasm ABI typing in lowering for single-register struct call stores and preserve ABI segment widths when inducing parameter-register locals.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
FileDescription
src/coreclr/jit/lower.cppAdjusts Wasm ABI-based typing for single-reg struct call stores; preserves register-segment type widths for induced parameter locals.
src/coreclr/jit/lclvars.cppAdds a Wasm-specific compilation bailout when the function argument count exceeds the Wasm engine limit.
src/coreclr/jit/gentree.cppTreats GT_FRAME_SIZE as a leaf for Wasm in GenTreeUseEdgeIterator.
src/coreclr/jit/error.hIntroduces WASM_IMPL_LIMITATION macro (Wasm-only impl-limitation helper).
src/coreclr/jit/compiler.hDefines MaxWasmFunctionParameters constant for Wasm.
src/coreclr/jit/codegenwasm.cppAdjusts wasm call signature construction and adds a call-argument-count bailout prior to requesting a type symbol.

Comment threadsrc/coreclr/jit/codegenwasm.cpp Outdated
Comment threadsrc/coreclr/jit/error.h Outdated
Comment threadsrc/coreclr/jit/error.h Outdated
Comment threadsrc/coreclr/jit/compiler.h Outdated
AndyAyersMSand others added 5 commits June 18, 2026 07:45
For fast tail calls gtType is overwritten to TYP_VOID, so use gtReturnType when forming the wasm call signature.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Cross-try-exit Block intervals are backdated to start at the try
header, breaking the non-decreasing-start-order invariant assumed by
the resolve loop.
@AndyAyersMS

Copy link
Copy Markdown
MemberAuthor

Not entirely happy with the "backdate" fix for branches out of try interval. Seems like constraint solving ought to be able to handle it, if a block overlaps a try (and since trys are single entry this means the block begins inside the try and ends outside) it should just stretch to encompass the try and (now) the two wrapper intervals.

Some of the other fixes are consequences of codegen inserting code (namely the post-try unreached and exception-capturing store) without having IR; this may also be something to revisit.

Wasm R2R doesn't use personality routines in unwind data, so fall back
to the slow EH-clause walk like X86 does.
CopilotAI review requested due to automatic review settings June 19, 2026 13:43
@pavelsavarapavelsavara added the arch-wasm WebAssembly architecture label Jun 19, 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.

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.

Comment threadsrc/coreclr/jit/lower.cpp
@AndyAyersMS

Copy link
Copy Markdown
MemberAuthor

Pri-0 R2R sweep impact

BaselineAfter these commits
Tests (merged-runner XML)6991299
Pass5611161 (+600)
Fail51
Wrapper failures2820

A separate Pri-1 sweep on top of these commits shows 1738 / 1909 tests pass (91.0%). No new R2R-specific failure modes surfaced in the broader Pri-1 set; remaining wrapper failures are tracked separately in #129622 and #129337.

Wasm uses stack-slot GC info encoding rather than fixed-register tracking,
so the emitter concern this assert guards (live updates for LCL_ADDR DEFs
of tracked GC vars) does not apply.
CopilotAI review requested due to automatic review settings June 19, 2026 18:40

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated no new comments.

@davidwrightondavidwrighton left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

VM changes look good. JIT looks good too, but I'm not a good reviewer of JIT changes. :)

@adamperlinadamperlin left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

JIT changes lgtm from what I understand!

@AndyAyersMS
AndyAyersMS merged commit 72788f0 into dotnet:mainJun 22, 2026
136 of 138 checks passed
@dotnet-milestone-botdotnet-milestone-botBot added this to the 11.0-preview6 milestone Jun 23, 2026
eiriktsarpalis pushed a commit that referenced this pull request Jul 15, 2026
- Use call node type when forming wasm call signatures.
- Treat `GT_FRAME_SIZE` as a wasm leaf during use-edge iteration.
- Classify single-register struct call stores by wasm ABI type.
- Preserve ABI segment widths for wasm parameter register remaps.
- Use the return type for wasm fast tail calls (gtType is overwritten to
TYP_VOID).
- JIT/wasm: skip Try/ExnRefWrapper in `findTargetDepth` for plain br
targets.
- JIT/wasm: emit an explicit br for try-leave even when the target is
the contiguous next block.
- JIT/wasm: extend the exnref wrapper to the catch-resumption
dispatcher.
- JIT/wasm: sort intervals by Start before conflict resolution
(cross-try-exit Block intervals are backdated to start at the try
header, breaking the non-decreasing-start-order invariant).
- VM/wasm: use the slow `IsFilterFunclet` path for wasm R2R (wasm
doesn't use personality routines in unwind data). (fixes#129341)
- JIT/wasm: skip the emitter-driven LCL_ADDR GC-tracking assert (wasm
uses stack-slot GC info, not fixed-register tracking).
Issue: #129497
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actionsgithub-actionsBot locked and limited conversation to collaborators Jul 24, 2026
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

arch-wasmWebAssembly architecturearea-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Wasm / R2R: IsFilterFunclet assertion fires when re-throwing from a finally after a cctor failure (throwinclassconstructor)

6 participants

@AndyAyersMS@adamperlin@davidwrighton@SingleAccretion@pavelsavara
, 'i'); if (__m === '*' || __re.test(location.href)) { // Strip utm_, fbclid, gclid, etc. from all links on page (function() { var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content', 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid', 'ref', 'ref_src', 'source', 'medium', 'campaign']; function cleanUrl(url) { try { var u = new URL(url, window.location.origin); var changed = false; trackingParams.forEach(function(p) { if (u.searchParams.has(p)) { u.searchParams.delete(p); changed = true; } }); return changed ? u.toString() : url; } catch (e) { return url; } } function cleanLinks() { document.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } cleanLinks(); var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1) { if (node.tagName === 'A') cleanLinks(); node.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + ' Fix wasm R2R JIT validation issues by AndyAyersMS · Pull Request #129555 · dotnet/runtime · GitHub
Skip to content

Fix wasm R2R JIT validation issues - #129555

Merged
AndyAyersMS merged 9 commits into
dotnet:mainfrom
AndyAyersMS:fix-wasm-r2r-jit-validation
Jun 22, 2026
Merged

Fix wasm R2R JIT validation issues#129555
AndyAyersMS merged 9 commits into
dotnet:mainfrom
AndyAyersMS:fix-wasm-r2r-jit-validation

Conversation

@AndyAyersMS

@AndyAyersMSAndyAyersMS commented Jun 18, 2026

Copy link
Copy Markdown
Member
  • Use call node type when forming wasm call signatures.
  • Treat GT_FRAME_SIZE as a wasm leaf during use-edge iteration.
  • Classify single-register struct call stores by wasm ABI type.
  • Preserve ABI segment widths for wasm parameter register remaps.
  • Use the return type for wasm fast tail calls (gtType is overwritten to TYP_VOID).
  • JIT/wasm: skip Try/ExnRefWrapper in findTargetDepth for plain br targets.
  • JIT/wasm: emit an explicit br for try-leave even when the target is the contiguous next block.
  • JIT/wasm: extend the exnref wrapper to the catch-resumption dispatcher.
  • JIT/wasm: sort intervals by Start before conflict resolution (cross-try-exit Block intervals are backdated to start at the try header, breaking the non-decreasing-start-order invariant).
  • VM/wasm: use the slow IsFilterFunclet path for wasm R2R (wasm doesn't use personality routines in unwind data). (fixesWasm / R2R: IsFilterFunclet assertion fires when re-throwing from a finally after a cctor failure (throwinclassconstructor) #129341)
  • JIT/wasm: skip the emitter-driven LCL_ADDR GC-tracking assert (wasm uses stack-slot GC info, not fixed-register tracking).

Issue: #129497

- Use call node type when forming wasm call signatures.
- Treat GT_FRAME_SIZE as a wasm leaf during use-edge iteration.
- Classify single-register struct call stores by wasm ABI type.
- Preserve ABI segment widths for wasm parameter register remaps.
- Bail out on wasm method/call signatures over the engine limit.
Issue: dotnet#129497
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
CopilotAI review requested due to automatic review settings June 18, 2026 01:42
@AndyAyersMS

Copy link
Copy Markdown
MemberAuthor

@adamperlin PTAL
fyi @dotnet/wasm-contrib

@github-actionsgithub-actionsBot added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Jun 18, 2026

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

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 adjusts WebAssembly (Wasm) JIT/R2R codegen plumbing to produce wasm-valid call/method signatures and to avoid validation/assert failures in several JIT phases when compiling for Wasm.

Changes:

  • Update Wasm call signature construction and add explicit bailouts when a call/function would exceed the Wasm engine parameter limit (1000).
  • Treat GT_FRAME_SIZE as a leaf for Wasm during use-edge iteration to avoid consumers assuming it has operands.
  • Refine Wasm ABI typing in lowering for single-register struct call stores and preserve ABI segment widths when inducing parameter-register locals.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
FileDescription
src/coreclr/jit/lower.cppAdjusts Wasm ABI-based typing for single-reg struct call stores; preserves register-segment type widths for induced parameter locals.
src/coreclr/jit/lclvars.cppAdds a Wasm-specific compilation bailout when the function argument count exceeds the Wasm engine limit.
src/coreclr/jit/gentree.cppTreats GT_FRAME_SIZE as a leaf for Wasm in GenTreeUseEdgeIterator.
src/coreclr/jit/error.hIntroduces WASM_IMPL_LIMITATION macro (Wasm-only impl-limitation helper).
src/coreclr/jit/compiler.hDefines MaxWasmFunctionParameters constant for Wasm.
src/coreclr/jit/codegenwasm.cppAdjusts wasm call signature construction and adds a call-argument-count bailout prior to requesting a type symbol.

Comment threadsrc/coreclr/jit/codegenwasm.cpp Outdated
Comment threadsrc/coreclr/jit/error.h Outdated
Comment threadsrc/coreclr/jit/error.h Outdated
Comment threadsrc/coreclr/jit/compiler.h Outdated
AndyAyersMSand others added 5 commits June 18, 2026 07:45
For fast tail calls gtType is overwritten to TYP_VOID, so use gtReturnType when forming the wasm call signature.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Cross-try-exit Block intervals are backdated to start at the try
header, breaking the non-decreasing-start-order invariant assumed by
the resolve loop.
@AndyAyersMS

Copy link
Copy Markdown
MemberAuthor

Not entirely happy with the "backdate" fix for branches out of try interval. Seems like constraint solving ought to be able to handle it, if a block overlaps a try (and since trys are single entry this means the block begins inside the try and ends outside) it should just stretch to encompass the try and (now) the two wrapper intervals.

Some of the other fixes are consequences of codegen inserting code (namely the post-try unreached and exception-capturing store) without having IR; this may also be something to revisit.

Wasm R2R doesn't use personality routines in unwind data, so fall back
to the slow EH-clause walk like X86 does.
CopilotAI review requested due to automatic review settings June 19, 2026 13:43
@pavelsavarapavelsavara added the arch-wasm WebAssembly architecture label Jun 19, 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.

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.

Comment threadsrc/coreclr/jit/lower.cpp
@AndyAyersMS

Copy link
Copy Markdown
MemberAuthor

Pri-0 R2R sweep impact

BaselineAfter these commits
Tests (merged-runner XML)6991299
Pass5611161 (+600)
Fail51
Wrapper failures2820

A separate Pri-1 sweep on top of these commits shows 1738 / 1909 tests pass (91.0%). No new R2R-specific failure modes surfaced in the broader Pri-1 set; remaining wrapper failures are tracked separately in #129622 and #129337.

Wasm uses stack-slot GC info encoding rather than fixed-register tracking,
so the emitter concern this assert guards (live updates for LCL_ADDR DEFs
of tracked GC vars) does not apply.
CopilotAI review requested due to automatic review settings June 19, 2026 18:40

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated no new comments.

@davidwrightondavidwrighton left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

VM changes look good. JIT looks good too, but I'm not a good reviewer of JIT changes. :)

@adamperlinadamperlin left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

JIT changes lgtm from what I understand!

@AndyAyersMS
AndyAyersMS merged commit 72788f0 into dotnet:mainJun 22, 2026
136 of 138 checks passed
@dotnet-milestone-botdotnet-milestone-botBot added this to the 11.0-preview6 milestone Jun 23, 2026
eiriktsarpalis pushed a commit that referenced this pull request Jul 15, 2026
- Use call node type when forming wasm call signatures.
- Treat `GT_FRAME_SIZE` as a wasm leaf during use-edge iteration.
- Classify single-register struct call stores by wasm ABI type.
- Preserve ABI segment widths for wasm parameter register remaps.
- Use the return type for wasm fast tail calls (gtType is overwritten to
TYP_VOID).
- JIT/wasm: skip Try/ExnRefWrapper in `findTargetDepth` for plain br
targets.
- JIT/wasm: emit an explicit br for try-leave even when the target is
the contiguous next block.
- JIT/wasm: extend the exnref wrapper to the catch-resumption
dispatcher.
- JIT/wasm: sort intervals by Start before conflict resolution
(cross-try-exit Block intervals are backdated to start at the try
header, breaking the non-decreasing-start-order invariant).
- VM/wasm: use the slow `IsFilterFunclet` path for wasm R2R (wasm
doesn't use personality routines in unwind data). (fixes#129341)
- JIT/wasm: skip the emitter-driven LCL_ADDR GC-tracking assert (wasm
uses stack-slot GC info, not fixed-register tracking).
Issue: #129497
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actionsgithub-actionsBot locked and limited conversation to collaborators Jul 24, 2026
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

arch-wasmWebAssembly architecturearea-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Wasm / R2R: IsFilterFunclet assertion fires when re-throwing from a finally after a cctor failure (throwinclassconstructor)

6 participants

@AndyAyersMS@adamperlin@davidwrighton@SingleAccretion@pavelsavara
, 'i'); if (__m === '*' || __re.test(location.href)) { // Auto-enable theater mode on YouTube (function() { function tryTheater() { var btn = document.querySelector('button[aria-label="Theater mode"], ytd-player #player button[title="Theater mode"]'); if (btn && !btn.classList.contains('activated')) { btn.click(); } } // Try immediately tryTheater(); // Try after navigation (SPA) var lastUrl = location.href; setInterval(function() { if (location.href !== lastUrl) { lastUrl = location.href; setTimeout(tryTheater, 500); } }, 1000); // Also try on player load var observer = new MutationObserver(tryTheater); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' Fix wasm R2R JIT validation issues by AndyAyersMS · Pull Request #129555 · dotnet/runtime · GitHub
Skip to content

Fix wasm R2R JIT validation issues - #129555

Merged
AndyAyersMS merged 9 commits into
dotnet:mainfrom
AndyAyersMS:fix-wasm-r2r-jit-validation
Jun 22, 2026
Merged

Fix wasm R2R JIT validation issues#129555
AndyAyersMS merged 9 commits into
dotnet:mainfrom
AndyAyersMS:fix-wasm-r2r-jit-validation

Conversation

@AndyAyersMS

@AndyAyersMSAndyAyersMS commented Jun 18, 2026

Copy link
Copy Markdown
Member
  • Use call node type when forming wasm call signatures.
  • Treat GT_FRAME_SIZE as a wasm leaf during use-edge iteration.
  • Classify single-register struct call stores by wasm ABI type.
  • Preserve ABI segment widths for wasm parameter register remaps.
  • Use the return type for wasm fast tail calls (gtType is overwritten to TYP_VOID).
  • JIT/wasm: skip Try/ExnRefWrapper in findTargetDepth for plain br targets.
  • JIT/wasm: emit an explicit br for try-leave even when the target is the contiguous next block.
  • JIT/wasm: extend the exnref wrapper to the catch-resumption dispatcher.
  • JIT/wasm: sort intervals by Start before conflict resolution (cross-try-exit Block intervals are backdated to start at the try header, breaking the non-decreasing-start-order invariant).
  • VM/wasm: use the slow IsFilterFunclet path for wasm R2R (wasm doesn't use personality routines in unwind data). (fixesWasm / R2R: IsFilterFunclet assertion fires when re-throwing from a finally after a cctor failure (throwinclassconstructor) #129341)
  • JIT/wasm: skip the emitter-driven LCL_ADDR GC-tracking assert (wasm uses stack-slot GC info, not fixed-register tracking).

Issue: #129497

- Use call node type when forming wasm call signatures.
- Treat GT_FRAME_SIZE as a wasm leaf during use-edge iteration.
- Classify single-register struct call stores by wasm ABI type.
- Preserve ABI segment widths for wasm parameter register remaps.
- Bail out on wasm method/call signatures over the engine limit.
Issue: dotnet#129497
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
CopilotAI review requested due to automatic review settings June 18, 2026 01:42
@AndyAyersMS

Copy link
Copy Markdown
MemberAuthor

@adamperlin PTAL
fyi @dotnet/wasm-contrib

@github-actionsgithub-actionsBot added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Jun 18, 2026

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

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 adjusts WebAssembly (Wasm) JIT/R2R codegen plumbing to produce wasm-valid call/method signatures and to avoid validation/assert failures in several JIT phases when compiling for Wasm.

Changes:

  • Update Wasm call signature construction and add explicit bailouts when a call/function would exceed the Wasm engine parameter limit (1000).
  • Treat GT_FRAME_SIZE as a leaf for Wasm during use-edge iteration to avoid consumers assuming it has operands.
  • Refine Wasm ABI typing in lowering for single-register struct call stores and preserve ABI segment widths when inducing parameter-register locals.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
FileDescription
src/coreclr/jit/lower.cppAdjusts Wasm ABI-based typing for single-reg struct call stores; preserves register-segment type widths for induced parameter locals.
src/coreclr/jit/lclvars.cppAdds a Wasm-specific compilation bailout when the function argument count exceeds the Wasm engine limit.
src/coreclr/jit/gentree.cppTreats GT_FRAME_SIZE as a leaf for Wasm in GenTreeUseEdgeIterator.
src/coreclr/jit/error.hIntroduces WASM_IMPL_LIMITATION macro (Wasm-only impl-limitation helper).
src/coreclr/jit/compiler.hDefines MaxWasmFunctionParameters constant for Wasm.
src/coreclr/jit/codegenwasm.cppAdjusts wasm call signature construction and adds a call-argument-count bailout prior to requesting a type symbol.

Comment threadsrc/coreclr/jit/codegenwasm.cpp Outdated
Comment threadsrc/coreclr/jit/error.h Outdated
Comment threadsrc/coreclr/jit/error.h Outdated
Comment threadsrc/coreclr/jit/compiler.h Outdated
AndyAyersMSand others added 5 commits June 18, 2026 07:45
For fast tail calls gtType is overwritten to TYP_VOID, so use gtReturnType when forming the wasm call signature.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Cross-try-exit Block intervals are backdated to start at the try
header, breaking the non-decreasing-start-order invariant assumed by
the resolve loop.
@AndyAyersMS

Copy link
Copy Markdown
MemberAuthor

Not entirely happy with the "backdate" fix for branches out of try interval. Seems like constraint solving ought to be able to handle it, if a block overlaps a try (and since trys are single entry this means the block begins inside the try and ends outside) it should just stretch to encompass the try and (now) the two wrapper intervals.

Some of the other fixes are consequences of codegen inserting code (namely the post-try unreached and exception-capturing store) without having IR; this may also be something to revisit.

Wasm R2R doesn't use personality routines in unwind data, so fall back
to the slow EH-clause walk like X86 does.
CopilotAI review requested due to automatic review settings June 19, 2026 13:43
@pavelsavarapavelsavara added the arch-wasm WebAssembly architecture label Jun 19, 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.

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.

Comment threadsrc/coreclr/jit/lower.cpp
@AndyAyersMS

Copy link
Copy Markdown
MemberAuthor

Pri-0 R2R sweep impact

BaselineAfter these commits
Tests (merged-runner XML)6991299
Pass5611161 (+600)
Fail51
Wrapper failures2820

A separate Pri-1 sweep on top of these commits shows 1738 / 1909 tests pass (91.0%). No new R2R-specific failure modes surfaced in the broader Pri-1 set; remaining wrapper failures are tracked separately in #129622 and #129337.

Wasm uses stack-slot GC info encoding rather than fixed-register tracking,
so the emitter concern this assert guards (live updates for LCL_ADDR DEFs
of tracked GC vars) does not apply.
CopilotAI review requested due to automatic review settings June 19, 2026 18:40

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated no new comments.

@davidwrightondavidwrighton left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

VM changes look good. JIT looks good too, but I'm not a good reviewer of JIT changes. :)

@adamperlinadamperlin left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

JIT changes lgtm from what I understand!

@AndyAyersMS
AndyAyersMS merged commit 72788f0 into dotnet:mainJun 22, 2026
136 of 138 checks passed
@dotnet-milestone-botdotnet-milestone-botBot added this to the 11.0-preview6 milestone Jun 23, 2026
eiriktsarpalis pushed a commit that referenced this pull request Jul 15, 2026
- Use call node type when forming wasm call signatures.
- Treat `GT_FRAME_SIZE` as a wasm leaf during use-edge iteration.
- Classify single-register struct call stores by wasm ABI type.
- Preserve ABI segment widths for wasm parameter register remaps.
- Use the return type for wasm fast tail calls (gtType is overwritten to
TYP_VOID).
- JIT/wasm: skip Try/ExnRefWrapper in `findTargetDepth` for plain br
targets.
- JIT/wasm: emit an explicit br for try-leave even when the target is
the contiguous next block.
- JIT/wasm: extend the exnref wrapper to the catch-resumption
dispatcher.
- JIT/wasm: sort intervals by Start before conflict resolution
(cross-try-exit Block intervals are backdated to start at the try
header, breaking the non-decreasing-start-order invariant).
- VM/wasm: use the slow `IsFilterFunclet` path for wasm R2R (wasm
doesn't use personality routines in unwind data). (fixes#129341)
- JIT/wasm: skip the emitter-driven LCL_ADDR GC-tracking assert (wasm
uses stack-slot GC info, not fixed-register tracking).
Issue: #129497
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actionsgithub-actionsBot locked and limited conversation to collaborators Jul 24, 2026
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

arch-wasmWebAssembly architecturearea-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Wasm / R2R: IsFilterFunclet assertion fires when re-throwing from a finally after a cctor failure (throwinclassconstructor)

6 participants

@AndyAyersMS@adamperlin@davidwrighton@SingleAccretion@pavelsavara
, 'i'); if (__m === '*' || __re.test(location.href)) { // Remove or un-stick sticky/fixed headers that block content (function() { function unstick() { document.querySelectorAll('header, nav, [role="banner"], .header, .navbar, .sticky, .fixed-top, [style*="position: fixed"], [style*="position:sticky"]').forEach(function(el) { if (el.style.position === 'fixed' || el.style.position === 'sticky' || getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') { el.style.position = 'static'; el.style.top = 'auto'; el.style.zIndex = 'auto'; } }); } unstick(); var observer = new MutationObserver(unstick); observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] }); })(); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); })(); Fix wasm R2R JIT validation issues by AndyAyersMS · Pull Request #129555 · dotnet/runtime · GitHub
Skip to content

Fix wasm R2R JIT validation issues - #129555

Merged
AndyAyersMS merged 9 commits into
dotnet:mainfrom
AndyAyersMS:fix-wasm-r2r-jit-validation
Jun 22, 2026
Merged

Fix wasm R2R JIT validation issues#129555
AndyAyersMS merged 9 commits into
dotnet:mainfrom
AndyAyersMS:fix-wasm-r2r-jit-validation

Conversation

@AndyAyersMS

@AndyAyersMSAndyAyersMS commented Jun 18, 2026

Copy link
Copy Markdown
Member
  • Use call node type when forming wasm call signatures.
  • Treat GT_FRAME_SIZE as a wasm leaf during use-edge iteration.
  • Classify single-register struct call stores by wasm ABI type.
  • Preserve ABI segment widths for wasm parameter register remaps.
  • Use the return type for wasm fast tail calls (gtType is overwritten to TYP_VOID).
  • JIT/wasm: skip Try/ExnRefWrapper in findTargetDepth for plain br targets.
  • JIT/wasm: emit an explicit br for try-leave even when the target is the contiguous next block.
  • JIT/wasm: extend the exnref wrapper to the catch-resumption dispatcher.
  • JIT/wasm: sort intervals by Start before conflict resolution (cross-try-exit Block intervals are backdated to start at the try header, breaking the non-decreasing-start-order invariant).
  • VM/wasm: use the slow IsFilterFunclet path for wasm R2R (wasm doesn't use personality routines in unwind data). (fixesWasm / R2R: IsFilterFunclet assertion fires when re-throwing from a finally after a cctor failure (throwinclassconstructor) #129341)
  • JIT/wasm: skip the emitter-driven LCL_ADDR GC-tracking assert (wasm uses stack-slot GC info, not fixed-register tracking).

Issue: #129497

- Use call node type when forming wasm call signatures.
- Treat GT_FRAME_SIZE as a wasm leaf during use-edge iteration.
- Classify single-register struct call stores by wasm ABI type.
- Preserve ABI segment widths for wasm parameter register remaps.
- Bail out on wasm method/call signatures over the engine limit.
Issue: dotnet#129497
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
CopilotAI review requested due to automatic review settings June 18, 2026 01:42
@AndyAyersMS

Copy link
Copy Markdown
MemberAuthor

@adamperlin PTAL
fyi @dotnet/wasm-contrib

@github-actionsgithub-actionsBot added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Jun 18, 2026

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

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 adjusts WebAssembly (Wasm) JIT/R2R codegen plumbing to produce wasm-valid call/method signatures and to avoid validation/assert failures in several JIT phases when compiling for Wasm.

Changes:

  • Update Wasm call signature construction and add explicit bailouts when a call/function would exceed the Wasm engine parameter limit (1000).
  • Treat GT_FRAME_SIZE as a leaf for Wasm during use-edge iteration to avoid consumers assuming it has operands.
  • Refine Wasm ABI typing in lowering for single-register struct call stores and preserve ABI segment widths when inducing parameter-register locals.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
FileDescription
src/coreclr/jit/lower.cppAdjusts Wasm ABI-based typing for single-reg struct call stores; preserves register-segment type widths for induced parameter locals.
src/coreclr/jit/lclvars.cppAdds a Wasm-specific compilation bailout when the function argument count exceeds the Wasm engine limit.
src/coreclr/jit/gentree.cppTreats GT_FRAME_SIZE as a leaf for Wasm in GenTreeUseEdgeIterator.
src/coreclr/jit/error.hIntroduces WASM_IMPL_LIMITATION macro (Wasm-only impl-limitation helper).
src/coreclr/jit/compiler.hDefines MaxWasmFunctionParameters constant for Wasm.
src/coreclr/jit/codegenwasm.cppAdjusts wasm call signature construction and adds a call-argument-count bailout prior to requesting a type symbol.

Comment threadsrc/coreclr/jit/codegenwasm.cpp Outdated
Comment threadsrc/coreclr/jit/error.h Outdated
Comment threadsrc/coreclr/jit/error.h Outdated
Comment threadsrc/coreclr/jit/compiler.h Outdated
AndyAyersMSand others added 5 commits June 18, 2026 07:45
For fast tail calls gtType is overwritten to TYP_VOID, so use gtReturnType when forming the wasm call signature.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Cross-try-exit Block intervals are backdated to start at the try
header, breaking the non-decreasing-start-order invariant assumed by
the resolve loop.
@AndyAyersMS

Copy link
Copy Markdown
MemberAuthor

Not entirely happy with the "backdate" fix for branches out of try interval. Seems like constraint solving ought to be able to handle it, if a block overlaps a try (and since trys are single entry this means the block begins inside the try and ends outside) it should just stretch to encompass the try and (now) the two wrapper intervals.

Some of the other fixes are consequences of codegen inserting code (namely the post-try unreached and exception-capturing store) without having IR; this may also be something to revisit.

Wasm R2R doesn't use personality routines in unwind data, so fall back
to the slow EH-clause walk like X86 does.
CopilotAI review requested due to automatic review settings June 19, 2026 13:43
@pavelsavarapavelsavara added the arch-wasm WebAssembly architecture label Jun 19, 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.

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.

Comment threadsrc/coreclr/jit/lower.cpp
@AndyAyersMS

Copy link
Copy Markdown
MemberAuthor

Pri-0 R2R sweep impact

BaselineAfter these commits
Tests (merged-runner XML)6991299
Pass5611161 (+600)
Fail51
Wrapper failures2820

A separate Pri-1 sweep on top of these commits shows 1738 / 1909 tests pass (91.0%). No new R2R-specific failure modes surfaced in the broader Pri-1 set; remaining wrapper failures are tracked separately in #129622 and #129337.

Wasm uses stack-slot GC info encoding rather than fixed-register tracking,
so the emitter concern this assert guards (live updates for LCL_ADDR DEFs
of tracked GC vars) does not apply.
CopilotAI review requested due to automatic review settings June 19, 2026 18:40

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated no new comments.

@davidwrightondavidwrighton left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

VM changes look good. JIT looks good too, but I'm not a good reviewer of JIT changes. :)

@adamperlinadamperlin left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

JIT changes lgtm from what I understand!

@AndyAyersMS
AndyAyersMS merged commit 72788f0 into dotnet:mainJun 22, 2026
136 of 138 checks passed
@dotnet-milestone-botdotnet-milestone-botBot added this to the 11.0-preview6 milestone Jun 23, 2026
eiriktsarpalis pushed a commit that referenced this pull request Jul 15, 2026
- Use call node type when forming wasm call signatures.
- Treat `GT_FRAME_SIZE` as a wasm leaf during use-edge iteration.
- Classify single-register struct call stores by wasm ABI type.
- Preserve ABI segment widths for wasm parameter register remaps.
- Use the return type for wasm fast tail calls (gtType is overwritten to
TYP_VOID).
- JIT/wasm: skip Try/ExnRefWrapper in `findTargetDepth` for plain br
targets.
- JIT/wasm: emit an explicit br for try-leave even when the target is
the contiguous next block.
- JIT/wasm: extend the exnref wrapper to the catch-resumption
dispatcher.
- JIT/wasm: sort intervals by Start before conflict resolution
(cross-try-exit Block intervals are backdated to start at the try
header, breaking the non-decreasing-start-order invariant).
- VM/wasm: use the slow `IsFilterFunclet` path for wasm R2R (wasm
doesn't use personality routines in unwind data). (fixes#129341)
- JIT/wasm: skip the emitter-driven LCL_ADDR GC-tracking assert (wasm
uses stack-slot GC info, not fixed-register tracking).
Issue: #129497
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actionsgithub-actionsBot locked and limited conversation to collaborators Jul 24, 2026
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

arch-wasmWebAssembly architecturearea-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Wasm / R2R: IsFilterFunclet assertion fires when re-throwing from a finally after a cctor failure (throwinclassconstructor)

6 participants

@AndyAyersMS@adamperlin@davidwrighton@SingleAccretion@pavelsavara