From f20292493e86aed7ff07023feda9f8bac5e09756 Mon Sep 17 00:00:00 2001 From: Andrew Au Date: Mon, 5 Jun 2023 13:45:51 -0700 Subject: [PATCH] Documentation for the HotColdMap section (#87023) --- docs/design/coreclr/botr/readytorun-format.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/docs/design/coreclr/botr/readytorun-format.md b/docs/design/coreclr/botr/readytorun-format.md index 2c63997332e..d68099747d8 100644 --- a/docs/design/coreclr/botr/readytorun-format.md +++ b/docs/design/coreclr/botr/readytorun-format.md @@ -179,6 +179,7 @@ The following section types are defined and described later in this document: | PgoInstrumentationData | 117 | Image (added in V5.2) | ManifestAssemblyMvids | 118 | Image (added in V5.3) | CrossModuleInlineInfo | 119 | Image (added in V6.3) +| HotColdMap | 120 | Image (added in V8.0) ## ReadyToRunSectionType.CompilerIdentifier @@ -644,6 +645,15 @@ The entry of the hashtable is a counted sequence of compressed unsigned integers This section may be included in addition to a InliningInfo2 section. +## ReadyToRunSectionType.HotColdMap (v8.0+) +In ReadyToRun 8.0+, the format supports splitting a method into hot and cold parts so that they are not located together. This hot-cold map section captures the information about how methods are split so that the runtime can locate them for various services. + +For every method that is split, there is a single entry in the section. Each entry has two unsigned 32-bit integers. The first integer is the runtime function index of the cold part and the second integer is the runtime function index of the hot part. + +The methods in this table are sorted by their hot part runtime function indices, which are also sorted by their cold part runtime function indices because we always emit the cold part in the same order as the hot parts, or by their RVAs because the runtime function table itself is sorted by the RVAs. + +This section may not exist if no method is split - this happens when the `--hot-cold-splitting` flag is not specified during compilation, or the compiler decides it should not split any methods. + # Native Format Native format is set of encoding patterns that allow persisting type system data in a binary format that is