1
0
Fork 0
mirror of https://github.com/VSadov/Satori.git synced 2025-06-11 10:18:21 +09:00

Fix handle dumping for AOT scenarios (#98728)

Revert #97573 to previous behavior (not dumping handle strings) for
NativeAOT and R2R compiles; those require more work to find the
handle to use.
This commit is contained in:
Bruce Forstall 2024-02-21 09:54:24 -08:00 committed by GitHub
parent cefd1a7ad9
commit 96bee8dcab
Signed by: github
GPG key ID: B5690EEEBB952194
3 changed files with 56 additions and 17 deletions

View file

@ -857,12 +857,27 @@ void Compiler::optPrintAssertion(AssertionDsc* curAssertion, AssertionIndex asse
if (curAssertion->op1.kind == O1K_EXACT_TYPE)
{
ssize_t iconVal = curAssertion->op2.u1.iconVal;
printf("Exact Type MT(0x%p %s)", dspPtr(iconVal), eeGetClassName((CORINFO_CLASS_HANDLE)iconVal));
if (IsTargetAbi(CORINFO_NATIVEAOT_ABI) || opts.IsReadyToRun())
{
printf("Exact Type MT(0x%p)", dspPtr(iconVal));
}
else
{
printf("Exact Type MT(0x%p %s)", dspPtr(iconVal),
eeGetClassName((CORINFO_CLASS_HANDLE)iconVal));
}
}
else if (curAssertion->op1.kind == O1K_SUBTYPE)
{
ssize_t iconVal = curAssertion->op2.u1.iconVal;
if (IsTargetAbi(CORINFO_NATIVEAOT_ABI) || opts.IsReadyToRun())
{
printf("MT(0x%p)", dspPtr(iconVal));
}
else
{
printf("MT(0x%p %s)", dspPtr(iconVal), eeGetClassName((CORINFO_CLASS_HANDLE)iconVal));
}
assert(curAssertion->op2.HasIconFlag());
}
else if ((curAssertion->op1.kind == O1K_BOUND_OPER_BND) ||

View file

@ -12172,13 +12172,34 @@ void Compiler::gtDispConst(GenTree* tree)
printf(" scope");
break;
case GTF_ICON_CLASS_HDL:
if (IsTargetAbi(CORINFO_NATIVEAOT_ABI) || opts.IsReadyToRun())
{
printf(" class");
}
else
{
printf(" class %s", eeGetClassName((CORINFO_CLASS_HANDLE)iconVal));
}
break;
case GTF_ICON_METHOD_HDL:
if (IsTargetAbi(CORINFO_NATIVEAOT_ABI) || opts.IsReadyToRun())
{
printf(" method");
}
else
{
printf(" method %s", eeGetMethodFullName((CORINFO_METHOD_HANDLE)iconVal));
}
break;
case GTF_ICON_FIELD_HDL:
if (IsTargetAbi(CORINFO_NATIVEAOT_ABI) || opts.IsReadyToRun())
{
printf(" field");
}
else
{
printf(" field %s", eeGetFieldName((CORINFO_FIELD_HANDLE)iconVal, true));
}
break;
case GTF_ICON_STATIC_HDL:
printf(" static");

View file

@ -9082,6 +9082,8 @@ void ValueNumStore::vnDump(Compiler* comp, ValueNum vn, bool isPtr)
ssize_t val = ConstantValue<ssize_t>(vn);
const GenTreeFlags handleFlags = GetHandleFlags(vn);
printf("Hnd const: 0x%p %s", dspPtr(val), GenTree::gtGetHandleKindString(handleFlags));
if (!comp->IsTargetAbi(CORINFO_NATIVEAOT_ABI) && !comp->opts.IsReadyToRun())
{
switch (handleFlags & GTF_ICON_HDL_MASK)
{
case GTF_ICON_CLASS_HDL:
@ -9097,6 +9099,7 @@ void ValueNumStore::vnDump(Compiler* comp, ValueNum vn, bool isPtr)
break;
}
}
}
else if (IsVNConstant(vn))
{
var_types vnt = TypeOfVN(vn);