Skip to content

[RyuJIT] Add a JIT flag for Portable Entry Points and set it by default for Browser compilations#125284

Merged
kg merged 10 commits intodotnet:mainfrom
kg:ryujit-pep-flag
Mar 10, 2026
Merged

[RyuJIT] Add a JIT flag for Portable Entry Points and set it by default for Browser compilations#125284
kg merged 10 commits intodotnet:mainfrom
kg:ryujit-pep-flag

Conversation

@kg
Copy link
Member

@kg kg commented Mar 6, 2026

cc @jkotas just improvising here based on existing code.

@kg kg added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Mar 6, 2026
Copilot AI review requested due to automatic review settings March 6, 2026 22:44
@dotnet-policy-service
Copy link
Contributor

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

Copy link
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

Adds a new JIT/EE interface flag intended to enable “portable entry points”, and enables it by default when compiling for Browser targets (likely for WASM AOT scenarios).

Changes:

  • Introduce CORJIT_FLAG_PORTABLE_ENTRY_POINTS / JIT_FLAG_PORTABLE_ENTRY_POINTS with bit value 32 across managed and native JIT interface definitions.
  • Set the new flag by default in CorInfoImpl.getJitFlags when TargetOS.Browser is the compilation target.
  • Extend JIT flag equality assertions to include the new flag mapping.

Reviewed changes

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

File Description
src/coreclr/tools/Common/JitInterface/CorInfoTypes.cs Adds the managed CorJitFlag enum value for portable entry points.
src/coreclr/tools/Common/JitInterface/CorInfoImpl.cs Sets the portable entry points flag automatically for Browser-target compilations.
src/coreclr/jit/jitee.h Adds the corresponding JIT_FLAG_* enum value and asserts it matches CORJIT_FLAGS.
src/coreclr/inc/corjitflags.h Adds the native CORJIT_FLAG_PORTABLE_ENTRY_POINTS definition in the JIT/EE interface.

@jkotas
Copy link
Member

jkotas commented Mar 6, 2026

We can use this flag around lvaInitWasmPortableEntryPtr and info.compArgsCount += 2; in lclvars.cpp

Copilot AI review requested due to automatic review settings March 9, 2026 16:29
Copy link
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

Copilot reviewed 7 out of 7 changed files in this pull request and generated 5 comments.

@kg
Copy link
Member Author

kg commented Mar 9, 2026

How would I describe this flag? I'm not exactly clear on the semantics

@jkotas
Copy link
Member

jkotas commented Mar 9, 2026

How would I describe this flag? I'm not exactly clear on the semantics

My suggestion from #125284 (comment)

"Use portable entrypoints for managed calling convention (see clr-abi.md for details)"

Copilot AI review requested due to automatic review settings March 10, 2026 00:30
@kg kg marked this pull request as ready for review March 10, 2026 00:31
@kg kg requested a review from MichalStrehovsky as a code owner March 10, 2026 00:31
Copy link
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

Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.

Copy link
Member

@jkotas jkotas left a comment

Choose a reason for hiding this comment

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

Thanks

@kg kg merged commit 5ed2d9b into dotnet:main Mar 10, 2026
118 checks passed
Copilot AI pushed a commit that referenced this pull request Mar 13, 2026
…lt for Browser compilations (#125284)

* Introduces CORJIT_FLAG_PORTABLE_ENTRY_POINTS
* Wires up the new PEP flag in a couple places (there are more left to fix)
* Renumbers CORJIT_FLAG_ASYNC to not be grouped with the ARM-only JIT flags
* This PR consumes two unused JIT flags
* Fixes some places where CORJIT_FLAG_ASYNC was not handled
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

3 participants