Uh oh!
There was an error while loading. Please reload this page.
[JIT]: Inline TLS field access for GC type - #85619
Conversation
ghost
commented
May 1, 2023
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch Issue DetailsAlong the lines of #82973 but for GC type fields.
|
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
kunalspathak
commented
May 3, 2023
@dotnet/jit-contrib |
BruceForstall
left a comment
There was a problem hiding this comment.
Some questions/comments
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
| if (pTLM == NULL) | ||
| return NULL; | ||
| return dac_cast<PTR_BYTE>(pTLM->GetPrecomputedGCStaticsBaseHandle()); |
There was a problem hiding this comment.
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.
which method are you referring?
Uh oh!
There was an error while loading. Please reload this page.
kunalspathak
commented
May 11, 2023
gcstress is clean except the failure pointed in #85590. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
jkotas
commented
May 12, 2023
The VM side LGTM |
| key = CastHandle(field); | ||
| GetThreadLocalFieldInfo->Add(key, result); | ||
| DEBUG_REC(dmpGetThreadLocalFieldInfo(key, result)); | ||
| DEBUG_REC(dmpGetGCThreadLocalFieldInfo(key, result)); |
There was a problem hiding this comment.
This is a bug; the function doesn't exist?
There was a problem hiding this comment.
hhm, wondering this doesn't fail during compilation?
There was a problem hiding this comment.
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.
Can you fix the alignment?
There was a problem hiding this comment.
seems these projects are excluded from auto-fixing using formatter?
There was a problem hiding this comment.
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.
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.
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.
This function should also take bool isGCType and use that to determine the key.
Also, please align the =
kunalspathak
commented
May 12, 2023
@BruceForstall - fixed. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
kunalspathak
commented
May 12, 2023
#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.