-
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
Implement getStaticFieldCurrentClass for NAOT #96982
Conversation
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch Issue DetailsCloses #96963
|
/azp list |
This comment was marked as resolved.
This comment was marked as resolved.
/azp run runtime-coreclr outerloop, runtime-coreclr pgo, runtime-coreclr libraries-pgo, runtime-nativeaot-outerloop |
Azure Pipelines successfully started running 4 pipeline(s). |
/azp run runtime-nativeaot-outerloop |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run runtime-nativeaot-outerloop |
Azure Pipelines successfully started running 1 pipeline(s). |
// it can rely on them being invariant too. | ||
if (fieldDesc.HasRva) | ||
{ | ||
// Read-only RVA fields need no "is class initialized" check. |
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.
How do you know that the RVA field is read-only?
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.
How do you know that the RVA field is read-only?
Can it be not so? I thought RVA can be mutable only for C++/CLI. Here we check that the field is final.
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.
We have several of these compiler generated RVA fields. Some of them are read-only, some of them are mutable.
Here we check that the field is final.
Where do we check that?
Co-authored-by: Jan Kotas <jkotas@microsoft.com>
@@ -2395,5 +2395,36 @@ private bool notifyMethodInfoUsage(CORINFO_METHOD_STRUCT_* ftn) | |||
{ | |||
return true; | |||
} | |||
|
|||
private CORINFO_CLASS_STRUCT_* getStaticFieldCurrentClass(CORINFO_FIELD_STRUCT_* field, byte* pIsSpeculative) |
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.
I'm a bit confused about the expected semantics of this API.
// Return field's exact type if its value is known to be never changed and
// is not null (for reference types). Returns nullptr otherwise.
Like Jan said - we don't check the initonly part - neither for the RVA nor for non-RVA statics. Should this always return null for !initonly
?
We also return the type of the field, not the type of the value stored in the field (in the reference type case).
Closes #96963