-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Make MemberInfoCache`1<System.__Canon>.AddMethod prejittable #90441
Conversation
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch Issue DetailsWhen we run empty app, the following method shows up in JitDisasmSummary:
I've debugged why it's not prejitted, basically, it fails with an exception due to an optimization in jit: So when JIT tries to be smart and optimizes It happens on
|
if ((info.compCompHnd->getClassAttribs(handle) & CORINFO_FLG_SHAREDINST) == 0) | ||
uint32_t attrs = info.compCompHnd->getClassAttribs(handle); | ||
|
||
// Filter out all shared generic instantiations and non-exact arrays |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the difference between isExact
that we have checked above and impIsClassExact
that we are repeating here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isExact
means that JIT knows the exact type of the tree (e.g. it sees that it's created via new
). impIsClassExact
is supposed to mean that a class is sealed (or "effectively sealed")
Looks like a crossgen2 bug to me. I do not see any reason why it should be disallowed to embed |
cc @dotnet/crossgen-contrib |
hmm, not sure either. @trylek, might have some context. Assume if crossgen would support it this change wouldnt be required, or would we want to take this as well? |
Repro: just run whatever we do for
(double `` for powershell) |
Yes, it should not be required, all "non-embeddable" handles are expected to be filter out by |
As Egor Bogatov discovered in dotnet#90441 Crossgen2 is unable to compile a method taking RuntimeTypeMethod[] parameter because Crossgen2 decides that the array doesn't version with the module being compiled (System.Private.CoreLib in this case). This change modifies the relevant logic so that, for parameterized types, we decide on versioning based on the parameter type. Thanks Tomas
Closing in favour of #90501 |
As Egor Bogatov discovered in #90441 Crossgen2 is unable to compile a method taking RuntimeTypeMethod[] parameter because Crossgen2 decides that the array doesn't version with the module being compiled (System.Private.CoreLib in this case). This change modifies the relevant logic so that, for parameterized types, we decide on versioning based on the parameter type. Thanks Tomas
Contributes to #85791
When we run empty app, the following method shows up in JitDisasmSummary:
I've debugged why it's not prejitted and, basically, it fails with an exception due to an optimization in jit:
So when JIT tries to be smart and optimizes
IND(obj)
to just an embedded class handle, it fails here.It happens on
RuntimeTypeMethod[]
type - I guess the reason is because arrays are not final on R2R?cc @jkotas @MichalStrehovsky