Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
26ad0a8
Add support for storing method handle histograms in profiles
jakobbotsch Apr 12, 2022
6959656
Fix R2R reader for PGO schema entries without data
jakobbotsch Apr 12, 2022
3245442
Support instrumenting method handles for delegates and vtable calls
jakobbotsch Apr 13, 2022
2cbe83f
Handle static methods and also move fcall handling
jakobbotsch Apr 14, 2022
5b31bee
Fix writing out methods
jakobbotsch Apr 14, 2022
7596146
Remove an unnecessary check
jakobbotsch Apr 15, 2022
a1c3a7e
Merge remote-tracking branch 'upstream/main' into method-handle-histo…
jakobbotsch Apr 15, 2022
5114f2c
Fix build and some logic inversions
jakobbotsch Apr 15, 2022
decb84d
Bump R2R minor version and JIT-EE GUID
jakobbotsch Apr 18, 2022
baf3662
Merge remote-tracking branch 'upstream/main' into method-handle-histo…
jakobbotsch Apr 18, 2022
8703a49
Merge remote-tracking branch 'upstream/main' into method-handle-instr…
jakobbotsch Apr 25, 2022
7b1714a
Merge branch 'method-handle-histograms' into method-handle-instrument…
jakobbotsch Apr 25, 2022
7910dba
Merge remote-tracking branch 'origin/method-handle-histograms' into m…
jakobbotsch Apr 25, 2022
01353ed
Fix after merge
jakobbotsch Apr 25, 2022
a3b04a3
Change to static_assert and remove a comment
jakobbotsch Apr 28, 2022
8dc5c6a
Foo
jakobbotsch Apr 29, 2022
da05869
Few cleanups
jakobbotsch Apr 29, 2022
af7232b
Better comment
jakobbotsch Apr 29, 2022
12d1d86
Run jit-format
jakobbotsch Apr 29, 2022
5a09741
More cleanup
jakobbotsch Apr 29, 2022
cd07709
Do not null check delegate GDV calls
jakobbotsch Apr 29, 2022
8456a11
Avoid devirt for probed calls
jakobbotsch Apr 29, 2022
e401711
Cleanup and format
jakobbotsch Apr 30, 2022
7bc4374
Fix 32-bit build
jakobbotsch Apr 30, 2022
5ee82e2
Reuse target from temp in cold call
jakobbotsch May 2, 2022
7250abe
Merge branch 'main' of github.com:dotnet/runtime into method-handle-i…
jakobbotsch May 4, 2022
98671fc
Merge branch 'main' of github.com:dotnet/runtime into method-handle-i…
jakobbotsch May 17, 2022
b175511
Fix build
jakobbotsch May 18, 2022
95af330
Add MethodProfiling PGO scenarios
jakobbotsch May 18, 2022
fa01664
Support randomized GDVs for method handle histograms
jakobbotsch May 18, 2022
7a5386e
Run jit-format
jakobbotsch May 18, 2022
f1bb0da
Merge branch 'main' of github.com:dotnet/runtime into method-handle-i…
jakobbotsch May 23, 2022
edd2db7
Fix an asertion failure
jakobbotsch May 23, 2022
e4093c9
Make sure we only log in DEBUG
jakobbotsch May 23, 2022
2c1ebe3
Avoid GDV for static calls
jakobbotsch May 23, 2022
fbbac89
Fix interaction with chained GDV
jakobbotsch May 23, 2022
d622b64
Fix cast helper probes
jakobbotsch May 23, 2022
8ce47f8
Run jit-format
jakobbotsch May 23, 2022
39ac90a
Pick random GDV after logging histogram
jakobbotsch May 24, 2022
0ab00ae
Fix GDV for vtable calls on System.Delegate
jakobbotsch May 24, 2022
93efde4
Mark early expanded vtable calls as such
jakobbotsch May 24, 2022
8a7ec55
Merge branch 'main' of github.com:dotnet/runtime into method-handle-i…
jakobbotsch May 24, 2022
4b44c8d
Pull reservoir index calculation up in profile helpers
jakobbotsch May 24, 2022
c30a951
Record only delegate cases that we can actually GDV for
jakobbotsch May 25, 2022
531ac9d
Merge branch 'main' of github.com:dotnet/runtime into method-handle-i…
jakobbotsch May 27, 2022
f6e0827
Fix pesky x86 GTF_CALL_POP_ARGS bug
jakobbotsch May 27, 2022
27aff20
Exclude dynamic methods as well as methods in collectible ALCs
jakobbotsch May 27, 2022
8444cee
Remove excessive JIT-EE calls for debug logging in non-verbose
jakobbotsch May 27, 2022
cbc494b
Increase some timeouts to get a full test run
jakobbotsch Jun 2, 2022
6beca6a
Merge branch 'main' of github.com:dotnet/runtime into method-handle-i…
jakobbotsch Jun 2, 2022
0937004
Add missing helper in CorInfoHelpFunc.cs
jakobbotsch Jun 2, 2022
56019b7
Fix conflict resolution and add profiling helpers on crossgen2 side
jakobbotsch Jun 2, 2022
1bd5203
Lower likelihood threshold to 30%, like vtable calls
jakobbotsch Jun 4, 2022
924d0b1
Revert "Increase some timeouts to get a full test run"
jakobbotsch Jun 7, 2022
dfbcc86
Add signature compatibility check
jakobbotsch Jun 7, 2022
1f7a1be
Increase some timeouts to get a full test run"
jakobbotsch Jun 7, 2022
b0a5c24
Merge branch 'main' of github.com:dotnet/runtime into method-handle-i…
jakobbotsch Jun 7, 2022
0363bf2
Fix after merge
jakobbotsch Jun 7, 2022
4201bf0
Merge branch 'main' of github.com:dotnet/runtime into method-handle-i…
jakobbotsch Jun 8, 2022
ed1a073
Separate delegate and vtable profiling
jakobbotsch Jun 8, 2022
f0010e6
Set gtTargetHandle for GDV function addrs
jakobbotsch Jun 8, 2022
2b2781d
Fix build
jakobbotsch Jun 9, 2022
993c4c2
Disable method GDV for R2R
jakobbotsch Jun 9, 2022
54b5a0b
Make extra SPMI queries for GDV debugging output purposes
jakobbotsch Jun 10, 2022
901d4d1
Reorder static and signature check
jakobbotsch Jun 10, 2022
12f3654
Misc changes
jakobbotsch Jun 10, 2022
6a9fbfe
Enable delegate profiling by default
jakobbotsch Jun 10, 2022
c46ebaa
Fix newlines when printing test profile
jakobbotsch Jun 14, 2022
2fad8de
Merge branch 'main' of github.com:dotnet/runtime into method-handle-i…
jakobbotsch Jun 15, 2022
60f140e
Add GetLikelyMethod and hook it up through R2R
jakobbotsch Jun 15, 2022
1bfc4d8
Update JIT-EE GUID
jakobbotsch Jun 15, 2022
55cdf81
Address some feedback, remove some unneeded stuff
jakobbotsch Jun 16, 2022
55c9d54
Address some more feedback
jakobbotsch Jun 16, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add GetLikelyMethod and hook it up through R2R
This makes us support generating and consuming the method handle
histograms in the same way as the type handle histograms by compressing
them before they are put in the R2R format.

Also finish some SPMI support.
  • Loading branch information
jakobbotsch committed Jun 15, 2022
commit 60f140ea83e7c4b152523ac82aa283ef23ec670d
2 changes: 1 addition & 1 deletion src/coreclr/inc/readytorun.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

// Keep these in sync with src/coreclr/tools/Common/Internal/Runtime/ModuleHeaders.cs
#define READYTORUN_MAJOR_VERSION 0x0006
#define READYTORUN_MINOR_VERSION 0x0001
#define READYTORUN_MINOR_VERSION 0x0002

#define MINIMUM_READYTORUN_MAJOR_VERSION 0x006

Expand Down
1 change: 1 addition & 0 deletions src/coreclr/jit/ClrJit.PAL.exports
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
getJit
jitStartup
getLikelyClasses
getLikelyMethods
jitBuildString
1 change: 1 addition & 0 deletions src/coreclr/jit/ClrJit.exports
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ EXPORTS
getJit
jitStartup
getLikelyClasses
getLikelyMethods
jitBuildString
4 changes: 4 additions & 0 deletions src/coreclr/jit/fgprofile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2159,6 +2159,10 @@ PhaseStatus Compiler::fgIncorporateProfileData()
fgPgoClassProfiles++;
break;

case ICorJitInfo::PgoInstrumentationKind::GetLikelyMethod:
fgPgoMethodProfiles++;
break;

case ICorJitInfo::PgoInstrumentationKind::HandleHistogramIntCount:
case ICorJitInfo::PgoInstrumentationKind::HandleHistogramLongCount:
if (iSchema + 1 < fgPgoSchemaCount)
Expand Down
5 changes: 3 additions & 2 deletions src/coreclr/jit/likelyclass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ static unsigned getLikelyClassesOrMethods(LikelyClassMethodRecord*
{
return 0;
}
assert(result != 0); // we don't expect zero in GetLikelyClass
assert(result != 0); // we don't expect zero in GetLikelyClass/GetLikelyMethod
pLikelyEntries[0].likelihood = (UINT32)(schema[i].Other & 0xFF);
pLikelyEntries[0].handle = result;
return 1;
Expand Down Expand Up @@ -380,7 +380,8 @@ void Compiler::getRandomGDV(ICorJitInfo::PgoInstrumentationSchema* schema,
continue;
}

if ((schema[i].InstrumentationKind == ICorJitInfo::PgoInstrumentationKind::GetLikelyClass) &&
if (((schema[i].InstrumentationKind == ICorJitInfo::PgoInstrumentationKind::GetLikelyClass) ||
(schema[i].InstrumentationKind == ICorJitInfo::PgoInstrumentationKind::GetLikelyMethod)) &&
(schema[i].Count == 1))
{
INT_PTR result = *(INT_PTR*)(pInstrumentationData + schema[i].Offset);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ internal struct ReadyToRunHeaderConstants
public const uint Signature = 0x00525452; // 'RTR'

public const ushort CurrentMajorVersion = 6;
public const ushort CurrentMinorVersion = 1;
public const ushort CurrentMinorVersion = 2;
}

#pragma warning disable 0169
Expand Down
77 changes: 56 additions & 21 deletions src/coreclr/tools/Common/JitInterface/CorInfoImpl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -101,20 +101,23 @@ public static IntPtr Get()
private static readonly IntPtr s_jit;
}

private struct LikelyClassRecord
private struct LikelyClassMethodRecord
{
public IntPtr clsHandle;
public IntPtr handle;
public uint likelihood;

public LikelyClassRecord(IntPtr clsHandle, uint likelihood)
public LikelyClassMethodRecord(IntPtr handle, uint likelihood)
{
this.clsHandle = clsHandle;
this.handle = handle;
this.likelihood = likelihood;
}
}

[DllImport(JitLibrary)]
private extern static uint getLikelyClasses(LikelyClassRecord* pLikelyClasses, uint maxLikelyClasses, PgoInstrumentationSchema* schema, uint countSchemaItems, byte*pInstrumentationData, int ilOffset);
private extern static uint getLikelyClasses(LikelyClassMethodRecord* pLikelyClasses, uint maxLikelyClasses, PgoInstrumentationSchema* schema, uint countSchemaItems, byte*pInstrumentationData, int ilOffset);

[DllImport(JitLibrary)]
private extern static uint getLikelyMethods(LikelyClassMethodRecord* pLikelyMethods, uint maxLikelyMethods, PgoInstrumentationSchema* schema, uint countSchemaItems, byte*pInstrumentationData, int ilOffset);

[DllImport(JitSupportLibrary)]
private extern static IntPtr GetJitHost(IntPtr configProvider);
Expand Down Expand Up @@ -192,17 +195,18 @@ private Logger Logger

public static IEnumerable<PgoSchemaElem> ConvertTypeHandleHistogramsToCompactTypeHistogramFormat(PgoSchemaElem[] pgoData, CompilationModuleGroup compilationModuleGroup)
{
bool hasTypeHistogram = false;
bool hasHistogram = false;
foreach (var elem in pgoData)
{
if (elem.InstrumentationKind == PgoInstrumentationKind.HandleHistogramTypes)
if (elem.InstrumentationKind == PgoInstrumentationKind.HandleHistogramTypes ||
elem.InstrumentationKind == PgoInstrumentationKind.HandleHistogramMethods)
{
// found histogram
hasTypeHistogram = true;
hasHistogram = true;
break;
}
}
if (!hasTypeHistogram)
if (!hasHistogram)
{
foreach (var elem in pgoData)
{
Expand All @@ -222,9 +226,10 @@ public static IEnumerable<PgoSchemaElem> ConvertTypeHandleHistogramsToCompactTyp
if ((i + 1 < pgoData.Length) &&
(pgoData[i].InstrumentationKind == PgoInstrumentationKind.HandleHistogramIntCount ||
pgoData[i].InstrumentationKind == PgoInstrumentationKind.HandleHistogramLongCount) &&
(pgoData[i + 1].InstrumentationKind == PgoInstrumentationKind.HandleHistogramTypes))
(pgoData[i + 1].InstrumentationKind == PgoInstrumentationKind.HandleHistogramTypes ||
pgoData[i + 1].InstrumentationKind == PgoInstrumentationKind.HandleHistogramMethods))
{
PgoSchemaElem? newElem = ComputeLikelyClass(i, handleToObject, nativeSchema, instrumentationData, compilationModuleGroup);
PgoSchemaElem? newElem = ComputeLikelyClassMethod(i, handleToObject, nativeSchema, instrumentationData, compilationModuleGroup);
if (newElem.HasValue)
{
yield return newElem.Value;
Expand All @@ -249,33 +254,63 @@ IntPtr LocalObjectToHandle(object input)
}
}

private static PgoSchemaElem? ComputeLikelyClass(int index, Dictionary<IntPtr, object> handleToObject, PgoInstrumentationSchema[] nativeSchema, byte[] instrumentationData, CompilationModuleGroup compilationModuleGroup)
private static PgoSchemaElem? ComputeLikelyClassMethod(int index, Dictionary<IntPtr, object> handleToObject, PgoInstrumentationSchema[] nativeSchema, byte[] instrumentationData, CompilationModuleGroup compilationModuleGroup)
{
// getLikelyClasses will use two entries from the native schema table. There must be at least two present to avoid overruning the buffer
if (index > (nativeSchema.Length - 2))
return null;

bool isType = nativeSchema[index + 1].InstrumentationKind == PgoInstrumentationKind.HandleHistogramTypes;

fixed(PgoInstrumentationSchema* pSchema = &nativeSchema[index])
{
fixed(byte* pInstrumentationData = &instrumentationData[0])
{
// We're going to store only the most popular type to reduce size of the profile
LikelyClassRecord* likelyClasses = stackalloc LikelyClassRecord[1];
uint numberOfClasses = getLikelyClasses(likelyClasses, 1, pSchema, 2, pInstrumentationData, nativeSchema[index].ILOffset);
// We're going to store only the most popular type/method to reduce size of the profile
LikelyClassMethodRecord* likelyClassMethods = stackalloc LikelyClassMethodRecord[1];
uint numberOfRecords;
if (isType)
{
numberOfRecords = getLikelyClasses(likelyClassMethods, 1, pSchema, 2, pInstrumentationData, nativeSchema[index].ILOffset);
}
else
{
numberOfRecords = getLikelyMethods(likelyClassMethods, 1, pSchema, 2, pInstrumentationData, nativeSchema[index].ILOffset);
}

if (numberOfClasses > 0)
if (numberOfRecords > 0)
{
TypeDesc type = (TypeDesc)handleToObject[likelyClasses->clsHandle];
TypeSystemEntityOrUnknown[] newData = null;
if (isType)
{
TypeDesc type = (TypeDesc)handleToObject[likelyClassMethods->handle];
#if READYTORUN
if (compilationModuleGroup.VersionsWithType(type))
#endif
{
newData = new[] { new TypeSystemEntityOrUnknown(type) };
}
}
else
{
MethodDesc method = (MethodDesc)handleToObject[likelyClassMethods->handle];

#if READYTORUN
if (compilationModuleGroup.VersionsWithType(type))
if (compilationModuleGroup.VersionsWithMethodBody(method))
#endif
{
newData = new[] { new TypeSystemEntityOrUnknown(method) };
}
}

if (newData != null)
{
PgoSchemaElem likelyClassElem = new PgoSchemaElem();
likelyClassElem.InstrumentationKind = PgoInstrumentationKind.GetLikelyClass;
likelyClassElem.InstrumentationKind = isType ? PgoInstrumentationKind.GetLikelyClass : PgoInstrumentationKind.GetLikelyMethod;
likelyClassElem.ILOffset = nativeSchema[index].ILOffset;
likelyClassElem.Count = 1;
likelyClassElem.Other = (int)(likelyClasses->likelihood | (numberOfClasses << 8));
likelyClassElem.DataObject = new TypeSystemEntityOrUnknown[] { new TypeSystemEntityOrUnknown(type) };
likelyClassElem.Other = (int)(likelyClassMethods->likelihood | (numberOfRecords << 8));
likelyClassElem.DataObject = newData;
return likelyClassElem;
}
}
Expand Down
1 change: 1 addition & 0 deletions src/coreclr/tools/Common/Pgo/PgoFormat.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ public enum PgoInstrumentationKind
EdgeIntCount = (DescriptorMin * 6) | FourByte, // edge counter using unsigned 4 byte int
EdgeLongCount = (DescriptorMin * 6) | EightByte, // edge counter using unsigned 8 byte int
GetLikelyClass = (DescriptorMin * 7) | TypeHandle, // Compressed get likely class data
GetLikelyMethod = (DescriptorMin * 7) | MethodHandle, // Compressed get likely method data
}

public interface IPgoSchemaDataLoader<TType, TMethod>
Expand Down
8 changes: 7 additions & 1 deletion src/coreclr/tools/superpmi/mcs/verbdumpmap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,9 @@ void DumpMap(int index, MethodContext* mc)
bool hasClassProfile = false;
bool hasMethodProfile = false;
bool hasLikelyClass = false;
bool hasLikelyMethod = false;
ICorJitInfo::PgoSource pgoSource = ICorJitInfo::PgoSource::Unknown;
if (mc->hasPgoData(hasEdgeProfile, hasClassProfile, hasMethodProfile, hasLikelyClass, pgoSource))
if (mc->hasPgoData(hasEdgeProfile, hasClassProfile, hasMethodProfile, hasLikelyClass, hasLikelyMethod, pgoSource))
{
rawFlags |= 1ULL << (EXTRA_JIT_FLAGS::HAS_PGO);

Expand All @@ -118,6 +119,11 @@ void DumpMap(int index, MethodContext* mc)
rawFlags |= 1ULL << (EXTRA_JIT_FLAGS::HAS_LIKELY_CLASS);
}

if (hasLikelyMethod)
{
rawFlags |= 1ULL << (EXTRA_JIT_FLAGS::HAS_LIKELY_METHOD);
}

if (pgoSource == ICorJitInfo::PgoSource::Static)
{
rawFlags |= 1ULL << (EXTRA_JIT_FLAGS::HAS_STATIC_PROFILE);
Expand Down
8 changes: 7 additions & 1 deletion src/coreclr/tools/superpmi/mcs/verbjitflags.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,9 @@ int verbJitFlags::DoWork(const char* nameOfInput)
bool hasClassProfile = false;
bool hasMethodProfile = false;
bool hasLikelyClass = false;
bool hasLikelyMethod = false;
ICorJitInfo::PgoSource pgoSource = ICorJitInfo::PgoSource::Unknown;
if (mc->hasPgoData(hasEdgeProfile, hasClassProfile, hasMethodProfile, hasLikelyClass, pgoSource))
if (mc->hasPgoData(hasEdgeProfile, hasClassProfile, hasMethodProfile, hasLikelyClass, hasLikelyMethod, pgoSource))
{
rawFlags |= 1ULL << (EXTRA_JIT_FLAGS::HAS_PGO);

Expand All @@ -56,6 +57,11 @@ int verbJitFlags::DoWork(const char* nameOfInput)
rawFlags |= 1ULL << (EXTRA_JIT_FLAGS::HAS_LIKELY_CLASS);
}

if (hasLikelyMethod)
{
rawFlags |= 1ULL << (EXTRA_JIT_FLAGS::HAS_LIKELY_METHOD);
}

if (pgoSource == ICorJitInfo::PgoSource::Static)
{
rawFlags |= 1ULL << (EXTRA_JIT_FLAGS::HAS_STATIC_PROFILE);
Expand Down
11 changes: 7 additions & 4 deletions src/coreclr/tools/superpmi/superpmi-shared/methodcontext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5607,9 +5607,10 @@ void MethodContext::dmpGetPgoInstrumentationResults(DWORDLONG key, const Agnosti
}
break;
case ICorJitInfo::PgoInstrumentationKind::GetLikelyClass:
case ICorJitInfo::PgoInstrumentationKind::GetLikelyMethod:
{
// (N)umber, (L)ikelihood, (C)lass
printf("N %u L %u C %016llX", (unsigned)(pBuf[i].Other >> 8), (unsigned)(pBuf[i].Other && 0xFF), CastHandle(*(uintptr_t*)(pInstrumentationData + pBuf[i].Offset)));
// (N)umber, (L)ikelihood, (H)andle
printf("N %u L %u H %016llX", (unsigned)(pBuf[i].Other >> 8), (unsigned)(pBuf[i].Other && 0xFF), CastHandle(*(uintptr_t*)(pInstrumentationData + pBuf[i].Offset)));
}
break;
default:
Expand Down Expand Up @@ -7072,12 +7073,13 @@ int MethodContext::dumpMD5HashToBuffer(BYTE* pBuffer, int bufLen, char* hash, in
return m_hash.HashBuffer(pBuffer, bufLen, hash, hashLen);
}

bool MethodContext::hasPgoData(bool& hasEdgeProfile, bool& hasClassProfile, bool& hasMethodProfile, bool& hasLikelyClass, ICorJitInfo::PgoSource& pgoSource)
bool MethodContext::hasPgoData(bool& hasEdgeProfile, bool& hasClassProfile, bool& hasMethodProfile, bool& hasLikelyClass, bool& hasLikelyMethod, ICorJitInfo::PgoSource& pgoSource)
{
hasEdgeProfile = false;
hasClassProfile = false;
hasMethodProfile = false;
hasLikelyClass = false;
hasLikelyMethod = false;

// Obtain the Method Info structure for this method
CORINFO_METHOD_INFO info;
Expand All @@ -7102,8 +7104,9 @@ bool MethodContext::hasPgoData(bool& hasEdgeProfile, bool& hasClassProfile, bool
hasClassProfile |= (schema[i].InstrumentationKind == ICorJitInfo::PgoInstrumentationKind::HandleHistogramTypes);
hasMethodProfile |= (schema[i].InstrumentationKind == ICorJitInfo::PgoInstrumentationKind::HandleHistogramMethods);
hasLikelyClass |= (schema[i].InstrumentationKind == ICorJitInfo::PgoInstrumentationKind::GetLikelyClass);
hasLikelyMethod |= (schema[i].InstrumentationKind == ICorJitInfo::PgoInstrumentationKind::GetLikelyMethod);

if (hasEdgeProfile && hasClassProfile && hasLikelyClass)
if (hasEdgeProfile && hasClassProfile && hasLikelyClass && hasLikelyMethod)
{
break;
}
Expand Down
5 changes: 4 additions & 1 deletion src/coreclr/tools/superpmi/superpmi-shared/methodcontext.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ enum EXTRA_JIT_FLAGS
HAS_STATIC_PROFILE = 59,
HAS_DYNAMIC_PROFILE = 58,
HAS_METHOD_PROFILE = 57,
HAS_LIKELY_METHOD = 56,
};

// Asserts to catch changes in corjit flags definitions.
Expand All @@ -64,6 +65,8 @@ static_assert((int)EXTRA_JIT_FLAGS::HAS_CLASS_PROFILE == (int)CORJIT_FLAGS::CorJ
static_assert((int)EXTRA_JIT_FLAGS::HAS_LIKELY_CLASS == (int)CORJIT_FLAGS::CorJitFlag::CORJIT_FLAG_UNUSED33, "Jit Flags Mismatch");
static_assert((int)EXTRA_JIT_FLAGS::HAS_STATIC_PROFILE == (int)CORJIT_FLAGS::CorJitFlag::CORJIT_FLAG_UNUSED32, "Jit Flags Mismatch");
static_assert((int)EXTRA_JIT_FLAGS::HAS_DYNAMIC_PROFILE == (int)CORJIT_FLAGS::CorJitFlag::CORJIT_FLAG_UNUSED31, "Jit Flags Mismatch");
static_assert((int)EXTRA_JIT_FLAGS::HAS_METHOD_PROFILE == (int)CORJIT_FLAGS::CorJitFlag::CORJIT_FLAG_UNUSED30, "Jit Flags Mismatch");
static_assert((int)EXTRA_JIT_FLAGS::HAS_LIKELY_METHOD == (int)CORJIT_FLAGS::CorJitFlag::CORJIT_FLAG_UNUSED29, "Jit Flags Mismatch");

class MethodContext
{
Expand Down Expand Up @@ -106,7 +109,7 @@ class MethodContext
int dumpMethodIdentityInfoToBuffer(char* buff, int len, bool ignoreMethodName = false, CORINFO_METHOD_INFO* optInfo = nullptr, unsigned optFlags = 0);
int dumpMethodMD5HashToBuffer(char* buff, int len, bool ignoreMethodName = false, CORINFO_METHOD_INFO* optInfo = nullptr, unsigned optFlags = 0);

bool hasPgoData(bool& hasEdgeProfile, bool& hasClassProfile, bool& hasMethodProfile, bool& hasLikelyClass, ICorJitInfo::PgoSource& pgoSource);
bool hasPgoData(bool& hasEdgeProfile, bool& hasClassProfile, bool& hasMethodProfile, bool& hasLikelyClass, bool& hasLikelyMethod, ICorJitInfo::PgoSource& pgoSource);

void recGlobalContext(const MethodContext& other);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,7 @@ std::string SpmiDumpHelper::DumpJitFlags(unsigned long long flags)
AddFlagNumeric(HAS_CLASS_PROFILE, EXTRA_JIT_FLAGS::HAS_CLASS_PROFILE);
AddFlagNumeric(HAS_METHOD_PROFILE, EXTRA_JIT_FLAGS::HAS_METHOD_PROFILE);
AddFlagNumeric(HAS_LIKELY_CLASS, EXTRA_JIT_FLAGS::HAS_LIKELY_CLASS);
AddFlagNumeric(HAS_LIKELY_METHOD, EXTRA_JIT_FLAGS::HAS_LIKELY_METHOD);
AddFlagNumeric(HAS_STATIC_PROFILE, EXTRA_JIT_FLAGS::HAS_STATIC_PROFILE);
AddFlagNumeric(HAS_DYNAMIC_PROFILE, EXTRA_JIT_FLAGS::HAS_DYNAMIC_PROFILE);

Expand Down