Skip to content

JIT: omit wasm Virtual IP updates in throw helper blocks - #137201

Merged
AndyAyersMS merged 1 commit into
dotnet:mainfrom
AndyAyersMS:wasm-throw-helper-vip
Nov 9, 2026
Merged

AndyAyersMS merged 1 commit into
dotnet:mainfrom
AndyAyersMS:wasm-throw-helper-vip

Conversation

@AndyAyersMS

Copy link
Copy Markdown
Member

Throw helpers inherit the throwing site's Virtual IP, so they don't need their own updates. Exclude these blocks from VIP store insertion while retaining their numbering and EH extents.

The existing availability analysis misses this redundancy because throw-helper branches aren't ordinary CFG edges.

Size

Havit composite R2R:

Metric Reduction
Wasm owner image 474,256 bytes (1.48%)
Brotli-compressed owner image 10,399 bytes (0.25%)
SuperPMI code bytes 238,693 bytes (1.61%)

SuperPMI: 38,469 successful contexts per JIT, 29,189 smaller, none larger. No GC-info size or EH-clause-count changes. One context with identical missing collection data on both JITs was excluded. Size figures use emitted code-byte metrics; the Wasm native differ has known decoder failures and false reports.

Validation

  • build.cmd clr.crossarchtools -os browser -arch wasm -c Release /p:RuntimeFlavor=CoreCLR passed.
  • 69 managed controls passed under Node with baseline and changed JITs, including throw helpers in nested tries, catches, finally blocks, filters and rethrows.
  • Havit and control Wasm images validated; formatting and whitespace checks passed.
  • Havit browser walkthrough completed. Strict smoke retains the same baseline Bootstrap JavaScript error.
  • Full runtime suite, clang-tidy and performance timing comparisons were not run.

Contributes to #135985.

Note

This PR description was generated with GitHub Copilot.

Throw helpers inherit the throwing site's Virtual IP.

Contributes to dotnet#135985.

Co-authored-by: Copilot <[email protected]>
Copilot-Session: 1da7d7aa-79b4-4ae1-ae4a-9861fdf9681c
@azure-pipelines

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

@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 Nov 9, 2026
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch
See info in area-owners.md if you want to be subscribed.

@AndyAyersMS

Copy link
Copy Markdown
Member Author

Throw helper blocks don't have predecessors, so the flow based analysis we do made the worst-case assumption that a VIP update was needed. They're not, and the VIP updates done there were redundant.

Apparently brotli is pretty good at compressing redundant sequences, so the compressed savings are pretty small.

ptal @adamperlin
fyi @dotnet/wasm-contrib

@pavelsavara pavelsavara added the arch-wasm WebAssembly architecture label Nov 9, 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

Copy link
Copy Markdown
Member Author

diffs

@AndyAyersMS
AndyAyersMS merged commit a86dc48 into dotnet:main Nov 9, 2026
127 checks passed
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 12.0-preview1 milestone Nov 10, 2026
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