-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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 asserts in CEEInfo::getStaticFieldContent() to 'if' checks #100320
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
In `fgGetStaticFieldSeqAndAddress`, if we have a static field address altered by a tree of `ADD CNS_INS` nodes, we need to verify that the address is within the found field sequence. It might not be after shared constant CSE kicks in (e.g., under OptRepeat), where the sequence of ADDs might be the alter an arbitrary constant address from one type into the address of the static field of a different type. So we can't use the FieldSeq of the base address when considering the full offset.
1. Use `eeGetFieldName` / `eeGetClassName` return pointer 2. Only query extra metadata under `verbose || JitConfig.EnableExtraSuperPmiQueries()`
dotnet-issue-labeler
bot
added
the
area-CodeGen-coreclr
CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI
label
Mar 27, 2024
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch |
jkotas
reviewed
Mar 27, 2024
This is an alternative implementation to #99845, which does more validity checks in the JIT before calling the |
BruceForstall
added a commit
to BruceForstall/runtime
that referenced
this pull request
Mar 27, 2024
Include the changes in dotnet#100320 instead of dotnet#99845
jkotas
reviewed
Mar 27, 2024
EgorBo
approved these changes
Mar 27, 2024
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
area-CodeGen-coreclr
CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Do some code cleanup as well.
In
fgGetStaticFieldSeqAndAddress
, if we have a static field addressaltered by a tree of
ADD CNS_INS
nodes, the field sequence we findmight not be the actual field with a specific "add tree" offset, after
shared constant CSE kicks in (e.g., under OptRepeat), where the
sequence of ADDs might be the alter an arbitrary constant address from
one type into the address of the static field of a different type.
This led to the asserts in question being hit. Change the asserts to
if
checks and fail the request to get static field content if the checks fail.