Skip to content

Conversation

AaronRobinsonMSFT
Copy link
Member

@AaronRobinsonMSFT AaronRobinsonMSFT commented Aug 28, 2025

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

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

@AaronRobinsonMSFT AaronRobinsonMSFT marked this pull request as ready for review August 28, 2025 19:14
@Copilot Copilot AI review requested due to automatic review settings August 28, 2025 19:14
Copy link
Contributor

@Copilot 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 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
File Description
src/coreclr/vm/wasm/cgencpu.h Removes WASM-specific precode feature definitions
src/coreclr/vm/util.hpp Changes EEThreadId from void pointer to SIZE_T for better type safety
src/coreclr/vm/tieredcompilation.h/.cpp Moves IsTieringDelayActive method outside feature guards for broader availability
src/coreclr/vm/precode_portable.hpp/.cpp Adds new portable entry point implementation with stub methods
src/coreclr/vm/precode.h/.cpp Wraps traditional precode code in feature guards and removes WASM-specific code
src/coreclr/vm/prestub.cpp Adds portable entry point support for interpreter code paths
src/coreclr/vm/method.hpp/.cpp Integrates portable entry points into method descriptor infrastructure
src/coreclr/vm/jitinterface.cpp Updates JIT interface to handle portable entry points for interpreted code
src/coreclr/vm/interpexec.cpp Updates interpreter execution to work with portable entry points
src/coreclr/interpreter/interpretershared.h Minor formatting improvements to struct members
Various build files Adds feature flags and build configuration for portable entry points

@AaronRobinsonMSFT
Copy link
Member Author

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

Copy link
Member

@kg kg left a comment

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

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.

LGTM!

@AaronRobinsonMSFT
Copy link
Member Author

/ba-g Unrelated WASM on mono failures

@AaronRobinsonMSFT AaronRobinsonMSFT merged commit ab3d027 into dotnet:main Aug 29, 2025
153 of 155 checks passed
@AaronRobinsonMSFT AaronRobinsonMSFT deleted the wasm_helpers branch August 29, 2025 04:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arch-wasm WebAssembly architecture area-VM-coreclr
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants