Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
51b978d
Remove SPILLED JitDisasm in favor of JitDisasmSpilled
jakobbotsch Aug 23, 2022
8100597
JIT: Simplify MethodSet matching behavior
jakobbotsch Aug 23, 2022
efdc84a
Update docs, minor nits
jakobbotsch Aug 23, 2022
a2af04b
Merge branch 'main' of github.com:dotnet/runtime into jit-method-name…
jakobbotsch Aug 23, 2022
dc67a40
Apply suggestions from code review
jakobbotsch Aug 24, 2022
03a1fa7
Update docs/design/coreclr/jit/viewing-jit-dumps.md
jakobbotsch Aug 25, 2022
4ded1a9
Use appendClassName to get namespaces and generic instantiations
jakobbotsch Aug 31, 2022
4dcce2a
Format instantiations in JIT
jakobbotsch Sep 1, 2022
510e5ec
Minor adjustments
jakobbotsch Sep 1, 2022
da27ae0
Add method instantiations
jakobbotsch Sep 1, 2022
55693f3
Update docs
jakobbotsch Sep 1, 2022
e9e6e06
Go back to square brackets
jakobbotsch Sep 1, 2022
daf08e4
Congruence
jakobbotsch Sep 1, 2022
633fa76
Single quotes
jakobbotsch Sep 1, 2022
2764293
Add some SPMI error traps
jakobbotsch Sep 1, 2022
0748742
Switch vsnprintf_s -> _vsnprintf_s, move StringPrinter::Printf to cpp…
jakobbotsch Sep 1, 2022
5de9b29
Another compilation fix
jakobbotsch Sep 1, 2022
98eee9f
Change crossgen2/ILC to fill in instantiations always
jakobbotsch Sep 2, 2022
bebe9f4
Fix a couple more angle brackets, add some braces to single line ifs
jakobbotsch Sep 2, 2022
0cf37d7
Make globbing quadratic instead of exponential
jakobbotsch Sep 2, 2022
68dfcda
Use asCorInfoType instead of getTypeForPrimitiveValueClass
jakobbotsch Sep 2, 2022
a94ac52
Run jit-format
jakobbotsch Sep 2, 2022
b0d00ac
Merge branch 'main' of github.com:dotnet/runtime into jit-method-name…
jakobbotsch Sep 2, 2022
a3f01e9
SPMI: Fix getTypeInstantiationArgument
jakobbotsch Sep 2, 2022
ae673c1
Bump JIT-EE GUID
jakobbotsch Sep 2, 2022
a8737b3
Add header comments, rename some parameters
jakobbotsch Sep 2, 2022
4507256
Apply suggestions from code review
jakobbotsch Sep 2, 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 some SPMI error traps
  • Loading branch information
jakobbotsch committed Sep 1, 2022
commit 276429329156f498191699e3ba5705d5c1973a94
7 changes: 6 additions & 1 deletion src/coreclr/jit/ee_il_dll.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1509,7 +1509,12 @@ const char* Compiler::eeGetFieldName(CORINFO_FIELD_HANDLE field, const char** cl
const char* Compiler::eeGetClassName(CORINFO_CLASS_HANDLE clsHnd)
{
StringPrinter printer(getAllocator(CMK_DebugOnly));
eePrintType(&printer, clsHnd, true, true);
if (!eeRunFunctorWithSPMIErrorTrap([&]() { eePrintType(&printer, clsHnd, true, true); }))
{
printer.Truncate(0);
printer.Printf("hackishClassName");
}

return printer.GetBuffer();
}

Expand Down
99 changes: 52 additions & 47 deletions src/coreclr/jit/eeinterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,56 +111,41 @@ void Compiler::eePrintMethod(StringPrinter* p,

if (includeSignature)
{
size_t signatureIndex = p->GetLength();
bool failed = true;
p->Printf("(");

auto closure = [&]() {
p->Printf("(");
CORINFO_ARG_LIST_HANDLE argLst = sig->args;
for (unsigned i = 0; i < sig->numArgs; i++)
{
if (i > 0)
p->Printf(",");

CORINFO_ARG_LIST_HANDLE argLst = sig->args;
for (unsigned i = 0; i < sig->numArgs; i++)
CORINFO_CLASS_HANDLE vcClsHnd;
var_types type = JitType2PreciseVarType(strip(info.compCompHnd->getArgType(sig, argLst, &vcClsHnd)));
switch (type)
{
if (i > 0)
p->Printf(",");

CORINFO_CLASS_HANDLE vcClsHnd;
var_types type = JitType2PreciseVarType(strip(info.compCompHnd->getArgType(sig, argLst, &vcClsHnd)));
switch (type)
case TYP_REF:
case TYP_STRUCT:
{
case TYP_REF:
case TYP_STRUCT:
CORINFO_CLASS_HANDLE clsHnd = eeGetArgClass(sig, argLst);
// For some SIMD struct types we can get a nullptr back from eeGetArgClass on Linux/X64
if (clsHnd != NO_CLASS_HANDLE)
{
CORINFO_CLASS_HANDLE clsHnd = eeGetArgClass(sig, argLst);
// For some SIMD struct types we can get a nullptr back from eeGetArgClass on Linux/X64
if (clsHnd != NO_CLASS_HANDLE)
{
eePrintType(p, clsHnd, includeNamespaces, true);
break;
}
}

FALLTHROUGH;
default:
eePrintJitType(p, type);
eePrintType(p, clsHnd, includeNamespaces, true);
break;
}
}

argLst = info.compCompHnd->getArgNext(argLst);
FALLTHROUGH;
default:
eePrintJitType(p, type);
break;
}

p->Printf(")");

failed = false;
};

eeRunFunctorWithSPMIErrorTrap(closure);

if (failed)
{
p->Truncate(signatureIndex);
p->Printf("(<failed to print signature>)");
argLst = info.compCompHnd->getArgNext(argLst);
}

p->Printf(")");

if (includeReturnType)
{
var_types retType = JitType2PreciseVarType(sig->retType);
Expand Down Expand Up @@ -205,20 +190,40 @@ const char* Compiler::eeGetMethodFullName(CORINFO_METHOD_HANDLE hnd, bool includ
return methodName;
}

CORINFO_CLASS_HANDLE clsHnd = NO_CLASS_HANDLE;
CORINFO_SIG_INFO sig;
StringPrinter p(getAllocator(CMK_DebugOnly));
CORINFO_CLASS_HANDLE clsHnd = NO_CLASS_HANDLE;
bool success = eeRunFunctorWithSPMIErrorTrap([&]() {
clsHnd = info.compCompHnd->getMethodClass(hnd);
CORINFO_SIG_INFO sig;
eeGetMethodSig(hnd, &sig);
eePrintMethod(&p, clsHnd, hnd, &sig,
/* includeNamespaces */ true,
/* includeClassInstantiation */ true,
/* includeMethodInstantiation */ true,
/* includeSignature */ true, includeReturnType, includeThisSpecifier);

});

CORINFO_SIG_INFO* pSig = success ? &sig : nullptr;
StringPrinter p(getAllocator(CMK_DebugOnly));
eePrintMethod(&p, clsHnd, hnd, pSig,
/* includeNamespaces */ true,
/* includeClassInstantiation */ true,
/* includeMethodInstantiation */ true,
/* includeSignature */ pSig != nullptr, includeReturnType, includeThisSpecifier);
if (!success)
{
// Try with bare minimum
p.Truncate(0);

success = eeRunFunctorWithSPMIErrorTrap([&]() {
eePrintMethod(&p, clsHnd, hnd,
/* sig */ nullptr,
/* includeNamespaces */ true,
/* includeClassInstantiation */ false,
/* includeMethodInstantiation */ false,
/* includeSignature */ false, includeReturnType, includeThisSpecifier);
});

if (!success)
{
p.Truncate(0);
p.Printf("hackishClassName:hackishMethodName(?)");
}
}

return p.GetBuffer();
}
Expand Down
24 changes: 16 additions & 8 deletions src/coreclr/jit/jitconfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -151,21 +151,29 @@ bool JitConfigValues::MethodSet::contains(CORINFO_METHOD_HANDLE methodHnd,
StringPrinter printer(comp->getAllocator(CMK_DebugOnly), buffer, ArrLen(buffer));
MethodName* prevPattern = nullptr;

for (MethodName *name = m_names; name != nullptr; prevPattern = name, name = name->m_next)
for (MethodName* name = m_names; name != nullptr; name = name->m_next)
{
if ((prevPattern == nullptr) || (name->m_containsClassName != prevPattern->m_containsClassName) ||
(name->m_classNameContainsInstantiation != prevPattern->m_classNameContainsInstantiation) ||
(name->m_methodNameContainsInstantiation != prevPattern->m_methodNameContainsInstantiation) ||
(name->m_containsSignature != prevPattern->m_containsSignature))
{
printer.Truncate(0);
comp->eePrintMethod(&printer, name->m_containsClassName ? classHnd : NO_CLASS_HANDLE, methodHnd, sigInfo,
/* includeNamespaces */ true,
/* includeClassInstantiation */ name->m_classNameContainsInstantiation,
/* includeMethodInstantiation */ name->m_methodNameContainsInstantiation,
/* includeSignature */ name->m_containsSignature,
/* includeReturnType */ false,
/* includeThis */ false);
bool success = comp->eeRunFunctorWithSPMIErrorTrap([&]() {
comp->eePrintMethod(&printer, name->m_containsClassName ? classHnd : NO_CLASS_HANDLE, methodHnd,
sigInfo,
/* includeNamespaces */ true,
/* includeClassInstantiation */ name->m_classNameContainsInstantiation,
/* includeMethodInstantiation */ name->m_methodNameContainsInstantiation,
/* includeSignature */ name->m_containsSignature,
/* includeReturnType */ false,
/* includeThis */ false);
});

if (!success)
continue;

prevPattern = name;
}

if (matchGlob(name->m_patternStart, name->m_patternEnd, printer.GetBuffer()))
Expand Down