-
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
Fix SPMI to handle replays of BBINSTR jit method contexts #41386
Conversation
Move the handling of allocMethodBlockCounts to the method context. While this data is both an input and an output, we're more interested in the input side. We could also treat it as an output, if we say wanted to verify that the replay jit wrote the same sequence of IL offsets into the BlockCount records, but that doesn't seem crucial as changes here would also lead to code diffs. Fix the code that checks the AddressMap for reloc hints so it doesn't fail if the exact lookup fails, but instead falls back to a search. This is needed because the base of the replay count buffer is recorded as the map key, but the instrumentation probes in jitted code refer to offsets from this value. Fixes dotnet#37270.
@BruceForstall PTAL |
It seems odd to record both the It seems like the CompileResult side currently has a bug because as far as I can tell, we save off the BlockCounts array when it is allocated, but before it is filled in. It seems like it should be handled more like Comments? |
Agree,. This is validation that was there before; I can remove it.
The allocated block buffer is no longer part of the compile result, that's the main upshot of this change. We do need to communicate the buffer address and length to the compile result so that when handling relocs we can properly adjust for the different value we have during replay vs what we saw in record (that is, the address of the buffer appears in codegen, so -- unlike GC info say -- we need to do more work to compensate for it during replay).
Right, I alluded to this above ("we could treat it as output"). I don't see doing that as being all that interesting. |
I see, so because the address of the recorded table appears in codegen, we need to record that address (and the count) for use with the address map for relocations. It seems like
and So we wouldn't save the IL offsets in the table in the CR, but that would be ok. |
Right, no need to save the buffer, as as a MC component, it will always just hold zeros. I'll update. |
See if you like this new version any better. |
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.
LGTM except for one cleanup bit. Good point about associating the buffer properly to get it cleaned up appropriately.
{ | ||
DWORDLONG address; | ||
DWORD count; | ||
DWORD pBlockCounts_index; |
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.
You should delete pBlockCounts_index
now (and from the dmp function)
X86 tests hit another instance of #11063
OSX build failed to download the checkout bundle
|
Move the handling of allocMethodBlockCounts to the method context.
While this data is both an input and an output, we're more interested
in the input side.
We could also treat it as an output, if we say wanted to verify that
the replay jit wrote the same sequence of IL offsets into the BlockCount
records, but that doesn't seem crucial as changes here would also lead
to code diffs.
Fix the code that checks the AddressMap for reloc hints so it doesn't
fail if the exact lookup fails, but instead falls back to a search.
This is needed because the base of the replay count buffer is recorded
as the map key, but the instrumentation probes in jitted code refer
to offsets from this value.
Fixes #37270.