Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[release/9.0] Fix devirtualization across genericness in the hierarchy - #108470

#108470
Merged
jeffschwMSFT merged 2 commits into
dotnet:release/9.0dotnet/runtime:release/9.0from
MichalStrehovsky:backport108442MichalStrehovsky/runtime:backport108442Copy head branch name to clipboard
Oct 3, 2024
Merged

[release/9.0] Fix devirtualization across genericness in the hierarchy#108470
jeffschwMSFT merged 2 commits into
dotnet:release/9.0dotnet/runtime:release/9.0from
MichalStrehovsky:backport108442MichalStrehovsky/runtime:backport108442Copy head branch name to clipboard

Conversation

@MichalStrehovsky

@MichalStrehovsky MichalStrehovsky commented Oct 2, 2024

Copy link
Copy Markdown
Member

Backport of #108442 to release/9.0

Customer Impact

  • Customer reported
  • Found internally

A new optimization added in 9.0 was causing incorrect devirtualization to a method on a base class instead of the correct more derived class.

Regression

  • Yes
  • No

Introduced in #97812 when the optimization was added.

Testing

This was found when I was making devirtualization kick in even more often in a .NET 10 PR. It is however hittable in .NET 9 too.

Risk

Should be low. The change was straightforward and none of our test passes found problems with it.

This code was trying to answer question: "Was this method overriden by something else in a more derived class"? It was walking the base hierarchy in canonical form, but that was leading to methods not resolving at all. The fix is to walk the non-canonical hierarchy and canonicalize after we resolved everything.

I ran into this in dotnet#108379 that unlocked more whole program devirtualization and `StringSearchValuesBase` is in this shape.
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

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

@jeffschwMSFT jeffschwMSFT left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

lgtm. please get a code review. we will take for consideration in 9 GA

@jeffschwMSFT jeffschwMSFT added the Servicing-consider Issue for next servicing release review label Oct 2, 2024
@jeffschwMSFT jeffschwMSFT added this to the 9.0.0 milestone Oct 2, 2024
@agocke agocke added Servicing-approved Approved for servicing release and removed Servicing-consider Issue for next servicing release review labels Oct 3, 2024
@jeffschwMSFT
jeffschwMSFT merged commit 2924cc8 into dotnet:release/9.0 Oct 3, 2024
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 3, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-NativeAOT-coreclr Servicing-approved Approved for servicing release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.