Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify devirtualization in crossgen2 #45744

Merged
merged 1 commit into from
Dec 8, 2020
Merged

Simplify devirtualization in crossgen2 #45744

merged 1 commit into from
Dec 8, 2020

Conversation

jkotas
Copy link
Member

@jkotas jkotas commented Dec 8, 2020

No description provided.

@jkotas
Copy link
Member Author

jkotas commented Dec 8, 2020

@MichalStrehovsky suggested in dotnet/runtimelab#437 (comment) that the call to FindMethodOnTypeWithMatchingTypicalMethod may not be required.

@AndyAyersMS Do you happen to remember why you have added it?

@AndyAyersMS
Copy link
Member

As part of #45526 I asked David what the counterpart was to GetExactDeclaringType in the runtime, and this is what he suggested.

@jkotas
Copy link
Member Author

jkotas commented Dec 8, 2020

The managed type system is always exact. It does not share MethodDesc between types some of the time like the CoreCLR runtime type system that requires the GetExactDeclaringType.

I believe that it should be safe to delete this as proposed in this PR.

@AndyAyersMS
Copy link
Member

Is there a writeup anywhere on how the managed type system differs from the type system in the runtime?

@jkotas
Copy link
Member Author

jkotas commented Dec 8, 2020

We have write up at https://github.com/dotnet/corert/blob/master/Documentation/botr/type-system.md

The doc does not have an explicit list. Most of the differences fall out from the design. This specific detail is fall out from the pluggable algorithms.

In CoreCLR type system, MethodDescs have to have 1:1 mapping with entrypoints. It means that the code sharing policy affects when you get exact MethodDescs.

In managed type system, the code sharing policy is one of the pluggable algorithms and it does not have cascading affect on how the type system as a whole works.

@AndyAyersMS
Copy link
Member

Thanks. I would not have deduced that a pluggable sharing policy implies that there are only exact types.

Given that we're going to support both type systems indefinitely, perhaps it is worth being more explicit on how things differ between the two?

Copy link
Member

@MichalStrehovsky MichalStrehovsky left a comment

Choose a reason for hiding this comment

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

Thanks!

@jkotas
Copy link
Member Author

jkotas commented Dec 8, 2020

perhaps it is worth being more explicit on how things differ between the two?

dotnet/runtimelab#440. Also, I will look into moving this doc to dotnet/runtime.

@jkotas jkotas merged commit 5432a66 into dotnet:master Dec 8, 2020
@jkotas jkotas deleted the devirt branch December 8, 2020 20:16
@ghost ghost locked as resolved and limited conversation to collaborators Jan 7, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants