Skip to content

Conversation

AaronRobinsonMSFT
Copy link
Member

This inserted ifdefs and reorganizes things to remove usage of Precode::GetPrecodeFromEntryPoint in WASM.

This removes the issue described in #120319

@AaronRobinsonMSFT AaronRobinsonMSFT added this to the 11.0.0 milestone Oct 9, 2025
@Copilot Copilot AI review requested due to automatic review settings October 9, 2025 23:35
@AaronRobinsonMSFT AaronRobinsonMSFT added arch-wasm WebAssembly architecture area-VM-coreclr labels Oct 9, 2025
Copy link
Contributor

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

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 removes the usage of Precode::GetPrecodeFromEntryPoint in WebAssembly (WASM) to address compilation issues. The changes restructure code around precode management and code versioning features to make them conditional based on whether portable entrypoints are enabled.

Key changes:

  • Conditionally compile precode-related code based on FEATURE_PORTABLE_ENTRYPOINTS
  • Wrap code versioning functionality with FEATURE_CODE_VERSIONING ifdefs
  • Update build configuration to only enable code versioning when tiered compilation is enabled

Reviewed Changes

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

Show a summary per file
File Description
src/coreclr/vm/stubmgr.h Wraps PrecodeStubManager class definition with FEATURE_PORTABLE_ENTRYPOINTS ifdef
src/coreclr/vm/stubmgr.cpp Conditionally compiles PrecodeStubManager implementation and DAC enumeration
src/coreclr/vm/proftoeeinterfaceimpl.cpp Wraps code versioning related functionality with FEATURE_CODE_VERSIONING ifdefs
src/coreclr/vm/prestub.cpp Adds conditional compilation for precode operations and code versioning features
src/coreclr/vm/precode_portable.hpp Removes GetPrecodeFromEntryPoint method declaration
src/coreclr/vm/precode_portable.cpp Removes GetPrecodeFromEntryPoint method implementation
src/coreclr/vm/methodtablebuilder.cpp Removes a debugging assertion
src/coreclr/vm/method.hpp Conditionally compiles precode and code versioning related methods
src/coreclr/vm/method.cpp Wraps various method implementations with appropriate feature ifdefs
src/coreclr/vm/jitinterface.cpp Conditionally compiles precode-related function entry point logic
src/coreclr/vm/interpexec.cpp Refactors prestub checking logic and fixes formatting
src/coreclr/vm/dllimportcallback.h Improves conditional compilation logic for interpreter features
src/coreclr/vm/dllimport.cpp Adds assertion for unsupported vararg P/Invoke with portable entrypoints
src/coreclr/vm/datadescriptor/datadescriptor.inc Conditionally includes code versioning data descriptors
src/coreclr/vm/comdelegate.cpp Wraps precode-related delegate conversion logic
src/coreclr/vm/codeversion.h Fixes endif comment formatting
src/coreclr/vm/ceemain.cpp Conditionally initializes CodeVersionManager
src/coreclr/vm/ceeload.inl Wraps IL code versioning lookup method
src/coreclr/vm/ceeload.h Conditionally compiles IL code versioning state mapping
src/coreclr/vm/ceeload.cpp Conditionally allocates memory for IL code versioning maps
src/coreclr/vm/appdomain.cpp Conditionally initializes PrecodeStubManager
src/coreclr/clrdefinitions.cmake Moves FEATURE_CODE_VERSIONING definition to tiered compilation section

pMD->GetTemporaryEntryPoint() && // The prestub may not yet be ready to be used, so force temporary entry point creation, and check again.
!pMD->IsPointingToPrestub())
return;
// The prestub may not yet be ready to be used, so force temporary entry point creation, and check again.
Copy link
Member

Choose a reason for hiding this comment

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

We do a simple IsPointingToPrestub check in other places as DoPrestub skipping optimization, e.g. ReflectionInvocation_CompileMethod. If the correct way to do the prestub skipping is this, we have bugs in the other places.

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't fully understand this multi-step process either. @davidwrighton wrote this check originally. I simply didn't care for the complex checks in a predicate so rewrote it.

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.

2 participants