Skip to content

Conversation

@MichalStrehovsky
Copy link
Member

Ran into this as I was trying something with #121456. That PR introduces a situation where two MethodDescs could map to the same EntryPoint. We didn't previously have that since MethodEntrypointOrTentativeMethod doesn't support unboxing thunks (that do a similar trick).

Without this fix we would end up with two TentativeInstanceMethodNode that point to the same EntryPoint and that doesn't lead to anything good. These need to be 1:1 with entrypoints.

Cc @dotnet/ilc-contrib

…r different MethodDescs

Ran into this as I was trying something with #121456. That PR introduces a situation where two MethodDescs could map to the same EntryPoint. We didn't previously have that since MethodEntrypointOrTentativeMethod doesn't support unboxing thunks (that do a similar trick).
@dotnet-policy-service
Copy link
Contributor

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

Copilot finished reviewing on behalf of MichalStrehovsky November 17, 2025 10:03
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

This PR modifies the NodeFactory to support scenarios where multiple MethodDesc instances can map to the same entrypoint. The key change is converting the _tentativeMethods cache from being keyed by MethodDesc to being keyed by IMethodBodyNode (the actual entrypoint), ensuring a 1:1 relationship between TentativeInstanceMethodNode instances and entrypoints.

  • Changes the cache key for tentative methods from MethodDesc to IMethodBodyNode
  • Ensures that when different MethodDescs share the same entrypoint, they also share the same TentativeInstanceMethodNode
  • Prevents issues that could arise from having multiple TentativeInstanceMethodNode instances pointing to the same entrypoint

@MichalStrehovsky MichalStrehovsky merged commit 8ec531d into main Nov 17, 2025
100 of 103 checks passed
@MichalStrehovsky MichalStrehovsky deleted the MichalStrehovsky-patch-2 branch November 17, 2025 21:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants