diff options
author | Jakob Botsch Nielsen <Jakob.botsch.nielsen@gmail.com> | 2021-05-21 13:24:28 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-21 13:24:28 +0300 |
commit | dd6ff04525f2e5dae46ff7ed8c0af7948eed2250 (patch) | |
tree | 49611a627be6d445197727c78bf6009d85147efc /src/coreclr/inc | |
parent | f96ce3a4720a70526dc61bea43ff678e1d4e0bb2 (diff) |
Implement 64-bit type handle histogram counts (#52898)
Diffstat (limited to 'src/coreclr/inc')
-rw-r--r-- | src/coreclr/inc/corinfo.h | 3 | ||||
-rw-r--r-- | src/coreclr/inc/corjit.h | 14 | ||||
-rw-r--r-- | src/coreclr/inc/jithelpers.h | 3 |
3 files changed, 15 insertions, 5 deletions
diff --git a/src/coreclr/inc/corinfo.h b/src/coreclr/inc/corinfo.h index 8ae242aedf9..197450f279d 100644 --- a/src/coreclr/inc/corinfo.h +++ b/src/coreclr/inc/corinfo.h @@ -605,7 +605,8 @@ enum CorInfoHelpFunc CORINFO_HELP_STACK_PROBE, // Probes each page of the allocated stack frame CORINFO_HELP_PATCHPOINT, // Notify runtime that code has reached a patchpoint - CORINFO_HELP_CLASSPROFILE, // Update class profile for a call site + CORINFO_HELP_CLASSPROFILE32, // Update 32-bit class profile for a call site + CORINFO_HELP_CLASSPROFILE64, // Update 64-bit class profile for a call site CORINFO_HELP_COUNT, }; diff --git a/src/coreclr/inc/corjit.h b/src/coreclr/inc/corjit.h index 51fe431bbb8..c2fe4d9521e 100644 --- a/src/coreclr/inc/corjit.h +++ b/src/coreclr/inc/corjit.h @@ -319,7 +319,8 @@ public: uint32_t ExecutionCount; }; - // Data structure for a single class probe. + + // Data structure for a single class probe using 32-bit count. // // CLASS_FLAG and INTERFACE_FLAG are placed into the Other field in the schema // @@ -330,7 +331,7 @@ public: // SAMPLE_INTERVAL must be >= SIZE. SAMPLE_INTERVAL / SIZE // gives the average number of calls between table updates. // - struct ClassProfile + struct ClassProfile32 { enum { SIZE = 8, @@ -344,6 +345,12 @@ public: CORINFO_CLASS_HANDLE ClassTable[SIZE]; }; + struct ClassProfile64 + { + uint64_t Count; + CORINFO_CLASS_HANDLE ClassTable[ClassProfile32::SIZE]; + }; + enum class PgoInstrumentationKind { // This must be kept in sync with PgoInstrumentationKind in PgoFormat.cs @@ -370,7 +377,8 @@ public: Done = None, // All instrumentation schemas must end with a record which is "Done" BasicBlockIntCount = (DescriptorMin * 1) | FourByte, // basic block counter using unsigned 4 byte int BasicBlockLongCount = (DescriptorMin * 1) | EightByte, // basic block counter using unsigned 8 byte int - TypeHandleHistogramCount = (DescriptorMin * 2) | FourByte | AlignPointer, // 4 byte counter that is part of a type histogram + TypeHandleHistogramIntCount = (DescriptorMin * 2) | FourByte | AlignPointer, // 4 byte counter that is part of a type histogram. Aligned to match ClassProfile32's alignment. + TypeHandleHistogramLongCount = (DescriptorMin * 2) | EightByte, // 8 byte counter that is part of a type histogram TypeHandleHistogramTypeHandle = (DescriptorMin * 3) | TypeHandle, // TypeHandle that is part of a type histogram Version = (DescriptorMin * 4) | None, // Version is encoded in the Other field of the schema NumRuns = (DescriptorMin * 5) | None, // Number of runs is encoded in the Other field of the schema diff --git a/src/coreclr/inc/jithelpers.h b/src/coreclr/inc/jithelpers.h index 3f72fdbc8cc..fb65ea9fa61 100644 --- a/src/coreclr/inc/jithelpers.h +++ b/src/coreclr/inc/jithelpers.h @@ -357,7 +357,8 @@ #endif JITHELPER(CORINFO_HELP_PATCHPOINT, JIT_Patchpoint, CORINFO_HELP_SIG_REG_ONLY) - JITHELPER(CORINFO_HELP_CLASSPROFILE, JIT_ClassProfile, CORINFO_HELP_SIG_REG_ONLY) + JITHELPER(CORINFO_HELP_CLASSPROFILE32, JIT_ClassProfile32, CORINFO_HELP_SIG_REG_ONLY) + JITHELPER(CORINFO_HELP_CLASSPROFILE64, JIT_ClassProfile64, CORINFO_HELP_SIG_REG_ONLY) #undef JITHELPER #undef DYNAMICJITHELPER |