Skip to content

Fix resolving of default interface methods in crossgen2#126351

Open
BrzVlad wants to merge 1 commit intodotnet:mainfrom
BrzVlad:fix-r2r-dim
Open

Fix resolving of default interface methods in crossgen2#126351
BrzVlad wants to merge 1 commit intodotnet:mainfrom
BrzVlad:fix-r2r-dim

Conversation

@BrzVlad
Copy link
Copy Markdown
Member

@BrzVlad BrzVlad commented Mar 31, 2026

When doing a static virtual call, we would only lookup implementations on the constrained type. If this resolution fails, we add the fallback of looking for DIMs on the implemented interfaces.

Makes Perf_DateTimeCultureInfo.ToString tests 25x faster when having only interpreter fallback

When doing a static virtual call, we would only lookup implementations on the constrained type. If this resolution fails, we add the fallback of looking for DIMs on the implemented interfaces.

Makes Perf_DateTimeCultureInfo.ToString tests 25x faster when having only interpreter fallback
Copy link
Copy Markdown
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

Improves crossgen2 handling of constrained static virtual interface calls by adding a fallback to resolve default interface method (DIM) implementations when no concrete implementation is found on the constrained type.

Changes:

  • Add DIM fallback resolution for static virtual calls when type-based resolution fails.
  • Relax a debug assertion to allow resolved targets whose owning type is an interface when the target is a static DIM.

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.

2 participants