-
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
[JIT]: Inline TLS field access for GC type #85619
Conversation
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch Issue DetailsAlong the lines of #82973 but for GC type fields.
|
@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.
Some questions/comments
if (pTLM == NULL) | ||
return NULL; | ||
|
||
return dac_cast<PTR_BYTE>(pTLM->GetPrecomputedGCStaticsBaseHandle()); |
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.
This is almost a copy of the function above, but that one doesn't use dac_cast<PTR_BYTE>
; is that an omission?
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.
which method are you referring?
gcstress is clean except the failure pointed in #85590. |
The VM side LGTM |
@@ -3610,7 +3610,7 @@ void MethodContext::recGetThreadLocalFieldInfo(CORINFO_FIELD_HANDLE field, uint3 | |||
|
|||
key = CastHandle(field); | |||
GetThreadLocalFieldInfo->Add(key, result); | |||
DEBUG_REC(dmpGetThreadLocalFieldInfo(key, result)); | |||
DEBUG_REC(dmpGetGCThreadLocalFieldInfo(key, result)); |
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.
This is a bug; the function doesn't exist?
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.
hhm, wondering this doesn't fail during compilation?
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 might not normally build with DEBUG_REC defined.
value.offsetOfMaxThreadStaticBlocks = pInfo->offsetOfMaxThreadStaticBlocks; | ||
value.offsetOfThreadLocalStoragePointer = pInfo->offsetOfThreadLocalStoragePointer; | ||
value.offsetOfThreadStaticBlocks = pInfo->offsetOfThreadStaticBlocks; | ||
value.offsetOfGCDataPointer = pInfo->offsetOfGCDataPointer; |
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.
Can you fix the alignment?
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.
seems these projects are excluded from auto-fixing using formatter?
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.
Sergey set up using the formatter, but it's not part of the normal JIT runs or validation in CI.
value.offsetOfMaxThreadStaticBlocks = pInfo->offsetOfMaxThreadStaticBlocks; | ||
value.offsetOfThreadLocalStoragePointer = pInfo->offsetOfThreadLocalStoragePointer; | ||
value.offsetOfThreadStaticBlocks = pInfo->offsetOfThreadStaticBlocks; | ||
value.offsetOfMaxThreadStaticBlocks = pInfo->offsetOfMaxThreadStaticBlocks; |
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.
This function signature needs to match getThreadLocalFieldInfo
: it needs to take a bool isGCType
.
Then, instead of key 0
the key should be 0
for isGCType == false
and 1
for isGCType == true
.
", offsetOfMaxThreadStaticBlocks-%u, offsetOfThreadLocalStoragePointer-%u, offsetOfThreadStaticBlocks-%u", | ||
value.tlsIndex.handle, value.offsetOfMaxThreadStaticBlocks, value.offsetOfThreadLocalStoragePointer, | ||
value.offsetOfThreadStaticBlocks); | ||
", offsetOfThreadLocalStoragePointer-%u, offsetOfMaxThreadStaticBlocks-%u" |
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.
The key
won't always be zero if it's based on isGCType
pInfo->offsetOfMaxThreadStaticBlocks = value.offsetOfMaxThreadStaticBlocks; | ||
pInfo->offsetOfThreadLocalStoragePointer = value.offsetOfThreadLocalStoragePointer; | ||
pInfo->offsetOfThreadStaticBlocks = value.offsetOfThreadStaticBlocks; | ||
pInfo->offsetOfMaxThreadStaticBlocks = value.offsetOfMaxThreadStaticBlocks; |
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.
This function should also take bool isGCType
and use that to determine the key.
Also, please align the =
@BruceForstall - fixed. |
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.
A few nits
src/coreclr/tools/superpmi/superpmi-shim-collector/icorjitinfo.cpp
Outdated
Show resolved
Hide resolved
#86176 fixed the test build failure, so will make sure that everything is clean before merging. |
Along the lines of #82973 but for GC type fields.