Skip to content

[Wasm RyuJIT] Fix: Use passed in ig when possible for IF_CODE_SIZE in emitDispIns()#128172

Merged
AndyAyersMS merged 1 commit into
dotnet:mainfrom
adamperlin:adamperlin/wasm-fix-code-size-jit-dump
May 15, 2026
Merged

[Wasm RyuJIT] Fix: Use passed in ig when possible for IF_CODE_SIZE in emitDispIns()#128172
AndyAyersMS merged 1 commit into
dotnet:mainfrom
adamperlin:adamperlin/wasm-fix-code-size-jit-dump

Conversation

@adamperlin
Copy link
Copy Markdown
Contributor

We can't always rely on emitCurIG being set since emitDispIns can be called after codegen, so use the current passed in ig when possible in for IF_CODE_SIZE in emitDispIns for Wasm.

Copilot AI review requested due to automatic review settings May 14, 2026 00:28
@github-actions github-actions Bot added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label May 14, 2026
@adamperlin adamperlin added this to the 11.0.0 milestone May 14, 2026
@adamperlin adamperlin requested a review from AndyAyersMS May 14, 2026 00:28
Copy link
Copy Markdown
Contributor

Copilot AI left a 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 change updates the Wasm JIT disassembly path to compute IF_CODE_SIZE using the instruction group passed into emitDispIns() when available, instead of unconditionally relying on emitCurIG. This makes emitDispIns() more robust in scenarios where it is invoked outside the normal codegen emission flow (where emitCurIG may not be set).

Changes:

  • In emitDispIns() for IF_CODE_SIZE, prefer the passed ig parameter and fall back to emitCurIG only if needed.
  • Add assertions to enforce the expected invariant that an instruction group is available before using it to resolve the current function.

Comment thread src/coreclr/jit/emitwasm.cpp
@adamperlin
Copy link
Copy Markdown
Contributor Author

/ba-g unrelated infra failures

@am11 am11 added the arch-wasm WebAssembly architecture label May 14, 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.

@AndyAyersMS AndyAyersMS merged commit 03e2e80 into dotnet:main May 15, 2026
143 of 148 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

arch-wasm WebAssembly architecture area-CodeGen-coreclr CLR 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.

4 participants