Skip to content

Portable EntryPoint feature - #119178

Merged
AaronRobinsonMSFT merged 15 commits into
dotnet:mainfrom
AaronRobinsonMSFT:wasm_helpers
Aug 29, 2025
Merged

Portable EntryPoint feature#119178
AaronRobinsonMSFT merged 15 commits into
dotnet:mainfrom
AaronRobinsonMSFT:wasm_helpers

Conversation

@AaronRobinsonMSFT

@AaronRobinsonMSFTAaronRobinsonMSFT commented Aug 28, 2025

Copy link
Copy Markdown
Member

Start implementation of the Portable EntryPoint feature.

Remove all WASM specific code from the precode paths and define out precode types when FEATURE_PORTABLE_ENTRYPOINT is defined. This is currently limited to WASM, but is being developed in a WASM agnostic manner.

This is only part 1 of the work. All Precode stubs that assert need to be removed. The current WASM progress is basically unchanged with these changes, in the sense it has not regressed further.

There was also disabling of specific runtime features, which resulted in various clean-up.

This new feature will be for portable method entry points.
For example, platforms that are unable to allocation
executable memory (that is, WASM).
Change signatures to TADDR for PortableEntryPoint.
Fix up NonVirtualEntry2MethodDesc.
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

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

Comment threadsrc/coreclr/vm/precode_portable.hpp
Comment threadsrc/coreclr/vm/interpexec.cpp
Comment threadsrc/coreclr/vm/precode_portable.cpp
Comment threadsrc/coreclr/clr.featuredefines.props Outdated
Comment threaddocs/design/coreclr/botr/clr-abi.md Outdated
Comment threadsrc/coreclr/vm/method.cpp Outdated
@AaronRobinsonMSFT
AaronRobinsonMSFT marked this pull request as ready for review August 28, 2025 19:14
CopilotAI review requested due to automatic review settings August 28, 2025 19:14

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 implements the initial foundation for a Portable EntryPoint feature to abstract away execution strategies on platforms that don't allow dynamic code generation. The changes remove WASM-specific code from precode paths and introduce a new PortableEntryPoint class that can be used across platforms.

Key changes include:

  • Introduction of FEATURE_PORTABLE_ENTRYPOINTS feature flag and corresponding infrastructure
  • Creation of new portable entry point implementation with stub methods for precode compatibility
  • Refactoring of tiered compilation and interpreter code to work without platform-specific assumptions
  • Clean-up of WASM-specific precode code and various runtime feature conditionals

Reviewed Changes

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

Show a summary per file
FileDescription
src/coreclr/vm/wasm/cgencpu.hRemoves WASM-specific precode feature definitions
src/coreclr/vm/util.hppChanges EEThreadId from void pointer to SIZE_T for better type safety
src/coreclr/vm/tieredcompilation.h/.cppMoves IsTieringDelayActive method outside feature guards for broader availability
src/coreclr/vm/precode_portable.hpp/.cppAdds new portable entry point implementation with stub methods
src/coreclr/vm/precode.h/.cppWraps traditional precode code in feature guards and removes WASM-specific code
src/coreclr/vm/prestub.cppAdds portable entry point support for interpreter code paths
src/coreclr/vm/method.hpp/.cppIntegrates portable entry points into method descriptor infrastructure
src/coreclr/vm/jitinterface.cppUpdates JIT interface to handle portable entry points for interpreted code
src/coreclr/vm/interpexec.cppUpdates interpreter execution to work with portable entry points
src/coreclr/interpreter/interpretershared.hMinor formatting improvements to struct members
Various build filesAdds feature flags and build configuration for portable entry points

Comment threadsrc/coreclr/vm/precode_portable.cpp
Comment threadsrc/coreclr/vm/precode_portable.cpp
Comment threadsrc/coreclr/vm/interpexec.cpp
@AaronRobinsonMSFT

Copy link
Copy Markdown
MemberAuthor

Yay for green! @kg@jkotas@janvorli PTAL.

Comment threadsrc/coreclr/vm/appdomain.hpp
Comment threadsrc/coreclr/vm/ceemain.cpp
Comment threadsrc/coreclr/vm/codeversion.cpp Outdated
Comment threadsrc/coreclr/vm/precode_portable.hpp
kg
kg approved these changes Aug 28, 2025

@kgkg 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.

LGTM, i don't know these areas super well though so more eyes on it would be good

@jkotasjkotas 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.

LGTM!

Comment threadsrc/coreclr/vm/interpexec.cpp Outdated
@AaronRobinsonMSFT

Copy link
Copy Markdown
MemberAuthor

/ba-g Unrelated WASM on mono failures

@AaronRobinsonMSFT
AaronRobinsonMSFT merged commit ab3d027 into dotnet:mainAug 29, 2025
153 of 155 checks passed
@AaronRobinsonMSFT
AaronRobinsonMSFT deleted the wasm_helpers branch August 29, 2025 04:09
@github-actionsgithub-actionsBot locked and limited conversation to collaborators Sep 28, 2025
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

arch-wasmWebAssembly architecturearea-VM-coreclr

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@AaronRobinsonMSFT@kg@jkotas@SingleAccretion