diff --git a/src/coreclr/jit/assertionprop.cpp b/src/coreclr/jit/assertionprop.cpp index fb317faea42c1..c6dca613377e5 100644 --- a/src/coreclr/jit/assertionprop.cpp +++ b/src/coreclr/jit/assertionprop.cpp @@ -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; - printf("MT(0x%p %s)", dspPtr(iconVal), eeGetClassName((CORINFO_CLASS_HANDLE)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) || diff --git a/src/coreclr/jit/gentree.cpp b/src/coreclr/jit/gentree.cpp index ad68efef307b7..6fa2eb91d5706 100644 --- a/src/coreclr/jit/gentree.cpp +++ b/src/coreclr/jit/gentree.cpp @@ -12152,13 +12152,34 @@ void Compiler::gtDispConst(GenTree* tree) printf(" scope"); break; case GTF_ICON_CLASS_HDL: - printf(" class %s", eeGetClassName((CORINFO_CLASS_HANDLE)iconVal)); + if (IsTargetAbi(CORINFO_NATIVEAOT_ABI) || opts.IsReadyToRun()) + { + printf(" class"); + } + else + { + printf(" class %s", eeGetClassName((CORINFO_CLASS_HANDLE)iconVal)); + } break; case GTF_ICON_METHOD_HDL: - printf(" method %s", eeGetMethodFullName((CORINFO_METHOD_HANDLE)iconVal)); + if (IsTargetAbi(CORINFO_NATIVEAOT_ABI) || opts.IsReadyToRun()) + { + printf(" method"); + } + else + { + printf(" method %s", eeGetMethodFullName((CORINFO_METHOD_HANDLE)iconVal)); + } break; case GTF_ICON_FIELD_HDL: - printf(" field %s", eeGetFieldName((CORINFO_FIELD_HANDLE)iconVal, true)); + 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"); diff --git a/src/coreclr/jit/valuenum.cpp b/src/coreclr/jit/valuenum.cpp index 977e984865aac..d444e7e752fe4 100644 --- a/src/coreclr/jit/valuenum.cpp +++ b/src/coreclr/jit/valuenum.cpp @@ -9006,19 +9006,22 @@ void ValueNumStore::vnDump(Compiler* comp, ValueNum vn, bool isPtr) ssize_t val = ConstantValue(vn); const GenTreeFlags handleFlags = GetHandleFlags(vn); printf("Hnd const: 0x%p %s", dspPtr(val), GenTree::gtGetHandleKindString(handleFlags)); - switch (handleFlags & GTF_ICON_HDL_MASK) + if (!comp->IsTargetAbi(CORINFO_NATIVEAOT_ABI) && !comp->opts.IsReadyToRun()) { - case GTF_ICON_CLASS_HDL: - printf(" %s", comp->eeGetClassName((CORINFO_CLASS_HANDLE)val)); - break; - case GTF_ICON_METHOD_HDL: - printf(" %s", comp->eeGetMethodFullName((CORINFO_METHOD_HANDLE)val)); - break; - case GTF_ICON_FIELD_HDL: - printf(" %s", comp->eeGetFieldName((CORINFO_FIELD_HANDLE)val, true)); - break; - default: - break; + switch (handleFlags & GTF_ICON_HDL_MASK) + { + case GTF_ICON_CLASS_HDL: + printf(" %s", comp->eeGetClassName((CORINFO_CLASS_HANDLE)val)); + break; + case GTF_ICON_METHOD_HDL: + printf(" %s", comp->eeGetMethodFullName((CORINFO_METHOD_HANDLE)val)); + break; + case GTF_ICON_FIELD_HDL: + printf(" %s", comp->eeGetFieldName((CORINFO_FIELD_HANDLE)val, true)); + break; + default: + break; + } } } else if (IsVNConstant(vn))