Fix SPMI to handle replays of BBINSTR jit method contexts (#41386)
authorAndy Ayers <andya@microsoft.com>
Thu, 27 Aug 2020 19:26:33 +0000 (12:26 -0700)
committerGitHub <noreply@github.com>
Thu, 27 Aug 2020 19:26:33 +0000 (12:26 -0700)
commit5088d541cb10e96092b9455a51f313bd85198166
treedad6b70d255a7726715282c0a60f47158502934d
parent56f80c7ab00cd373d19af75dc6c475be5058ea94
Fix SPMI to handle replays of BBINSTR jit method contexts (#41386)

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.
src/coreclr/src/ToolBox/superpmi/superpmi-shared/compileresult.cpp
src/coreclr/src/ToolBox/superpmi/superpmi-shared/compileresult.h
src/coreclr/src/ToolBox/superpmi/superpmi-shared/crlwmlist.h
src/coreclr/src/ToolBox/superpmi/superpmi-shared/lightweightmap.h
src/coreclr/src/ToolBox/superpmi/superpmi-shared/lwmlist.h
src/coreclr/src/ToolBox/superpmi/superpmi-shared/methodcontext.cpp
src/coreclr/src/ToolBox/superpmi/superpmi-shared/methodcontext.h
src/coreclr/src/ToolBox/superpmi/superpmi-shim-collector/icorjitinfo.cpp
src/coreclr/src/ToolBox/superpmi/superpmi/icorjitinfo.cpp