-
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
Convert isExactType check to JIT/EE interface call #97424
Conversation
The approximation of isExactType from class flags had false positives (correctness) and false negatives issues. Converting it to JIT/EE interface method fixes them both. Fixes dotnet#97134
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch Issue DetailsThe approximation of isExactType from class flags had false positives (correctness) and false negatives issues. Converting it to JIT/EE interface method fixes them both. Fixes #97134
|
cc @dotnet/jit-contrib |
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.
It's a coincidence, but in https://github.com/dotnet/runtime/pull/97387/files I currently have a failing test that fails because IsExactClass returns true for a class with [TypeIdentifier] and I assume this PR will fix it. The reason current jit's cast expansion logic is not hitting this issue becuase it doesn't try to expand CORINFO_HELP_ISINSTANCEOFANY
for exact classes
Does |
It does not and it cannot not. |
The JIT approximation returned false for int[] as well. I agree that it is interesting to get jit-diff. |
There is also |
Do you mean this place runtime/src/coreclr/jit/importer.cpp Lines 5483 to 5484 in d250dcc
getExactClasses vs. isExactType do not use "exact" to mean the same thing.)
|
Yes, I meant that case - I agree it's ok since it checks isExact explicitly 👍
Agree, |
@jkotas an unrelated question: Currently, for var result = (MySealedClass)obj; jit emits something like this: if (obj.GetType() == typeof(MySealedClass))
result = obj;
else
CORINFO_HELP_CHKCASTCLASS(obj, MySealedClass)
ret3 // always throw anyway Can we hit here the same issue we hit recently with version bubbles in R2R if |
Yes. IsEffectivelySealed for R2R returns true only if the type is in the same version bubble: Lines 18 to 21 in d250dcc
|
All implementations return the same constant. Unlikely to be needed again.
/azp run runtime-coreclr outerloop, runtime-nativeaot-outerloop |
Azure Pipelines successfully started running 2 pipeline(s). |
No jit-diffs MihuBot/runtime-utils#228 (comment) |
the build-in-progress jobs seem to stuck? 10h for the NativeAOT one |
These legs passed in previous runs. I do not think we need to retry. |
The approximation of isExactType from class flags had false positives (correctness) and false negatives issues. Converting it to JIT/EE interface method fixes them both.
Fixes #97134