Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/coreclr/vm/prestub.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2367,6 +2367,13 @@ PCODE MethodDesc::DoPrestub(MethodTable *pDispatchingMT, CallerGCMode callerGCMo
{
_ASSERTE(!MayHaveEntryPointSlotsToBackpatch()); // This path doesn't lock the MethodDescBackpatchTracker as it should only
// happen for jump-stampable or non-versionable methods
#ifdef FEATURE_PORTABLE_ENTRYPOINTS
if (pMT->IsDelegate())
{
return pCode;
Copy link
Member

Choose a reason for hiding this comment

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

If we early out here, does it mean that we will be going through PreStub every time the delegate constructor is called? We should not be going through PreStub in steady state as we have discussed...

Copy link
Member Author

@radekdoulik radekdoulik Dec 18, 2025

Choose a reason for hiding this comment

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

We are not going through PreStub again as the method already has interpreter code after 1st PreStub pass and so we don't call DoPreStub again. OTOH it will leave the method in different state. I will try to better understand the conditions under which we reach the issue and possibly find better solution.

}
#endif // FEATURE_PORTABLE_ENTRYPOINTS

SetCodeEntryPoint(pCode);
}
else
Expand Down