GCInfo: Support versioning.
authorSwaroop Sridhar <swaroops@microsoft.com>
Fri, 15 Jul 2016 07:41:30 +0000 (00:41 -0700)
committerSwaroop Sridhar <swaroops@microsoft.com>
Thu, 21 Jul 2016 02:51:50 +0000 (19:51 -0700)
commita90448e2acbf75db02fb93321d4093afaccfb685
tree5167de6fdaeab27bbfc2bc67f48b971f05322263
parent9734495d4446016b2b0a6e62b5fe2ebb0e75aa05
GCInfo: Support versioning.

This change enables the VM to support multiple versions GCInfo concurrently.
This is necessary in light of upcoming work to add ReturnType and other
modifications to the GCInfo format -- so that existing ReadyToRun images
will continue to run correctly.

The version# is not stored in the GcInfo structure -- because it is
wasteful to store the version once for every method. Instead, it is
tracked per range-section of generated/loaded methods.

The GCInfo version is computed as:
1) The current GCINFO_VERSION for JITted and Ngened images
2) A function of the Ready-to-run major version stored in READYTORUN_HEADER
   for ready-to-run images. ReadyToRunJitManager::JitTokenToGCInfoVersion()
   provides the GcInfo version for any Method. Currently, there's only one
   version of GCInfo.

An abstraction GCInfoToken is added to the GcInfo interface, which tracks the
{GcInfo, Version} pair in-memory. Several GcInfo APIs are
modified to use GCInfoToken in place of GcInfo pointers.

Notes:
1) SOS GcDump: The GCDump API has separate dump routines for Header and the
pointer-liveness information (DumpGCTable and DumpGCHeader) each of which
advance a pointer to the GCInfo block. These APIs are not changed to
recieve a GCInfoToken in place of the GcInfo block pointer. Instead, they
recieve the GcInfo version at the time of construction.
2) Some routines that are specific to x86 gcInfo (ex: crackMethodInfoHdr)
are not yet updated to use versioning, since the development plan is to
update the Non-x86 GcInfo structure first.
3) The x86 specific structs defining GcInfo headers are moved to GcInfoTypes.h,
along with the non-x86 GcInfo type definitions.

Commit migrated from https://github.com/dotnet/coreclr/commit/f915aebaf5db0b829f062dc9940e23bb5c38d575
32 files changed:
src/coreclr/src/ToolBox/SOS/Strike/disasm.cpp
src/coreclr/src/ToolBox/SOS/Strike/disasm.h
src/coreclr/src/ToolBox/SOS/Strike/disasmARM.cpp
src/coreclr/src/ToolBox/SOS/Strike/disasmARM64.cpp
src/coreclr/src/ToolBox/SOS/Strike/exts.h
src/coreclr/src/ToolBox/SOS/Strike/strike.cpp
src/coreclr/src/debug/daccess/daccess.cpp
src/coreclr/src/debug/daccess/enummem.cpp
src/coreclr/src/debug/daccess/nidump.cpp
src/coreclr/src/debug/daccess/request.cpp
src/coreclr/src/gcdump/gcdump.cpp
src/coreclr/src/gcdump/gcdumpnonx86.cpp
src/coreclr/src/gcinfo/gcinfodumper.cpp
src/coreclr/src/inc/eetwain.h
src/coreclr/src/inc/gcdecoder.cpp
src/coreclr/src/inc/gcdump.h
src/coreclr/src/inc/gcinfo.h
src/coreclr/src/inc/gcinfodecoder.h
src/coreclr/src/inc/gcinfodumper.h
src/coreclr/src/inc/gcinfotypes.h
src/coreclr/src/jit/gcencode.cpp
src/coreclr/src/jit/jitgcinfo.h
src/coreclr/src/vm/codeman.cpp
src/coreclr/src/vm/codeman.h
src/coreclr/src/vm/debughelp.cpp
src/coreclr/src/vm/eedbginterfaceimpl.cpp
src/coreclr/src/vm/eetwain.cpp
src/coreclr/src/vm/gccover.cpp
src/coreclr/src/vm/gccover.h
src/coreclr/src/vm/gcenv.ee.cpp
src/coreclr/src/vm/gcinfodecoder.cpp
src/coreclr/src/vm/stackwalk.h