Skip to content

Commit 97c44df

Browse files
committed
[clr-interp] Verbose logging for method passed in DOTNET_InterpDump
1 parent c413a94 commit 97c44df

File tree

3 files changed

+12
-5
lines changed

3 files changed

+12
-5
lines changed

src/coreclr/interpreter/compiler.cpp

+7-3
Original file line numberDiff line numberDiff line change
@@ -827,14 +827,18 @@ int32_t* InterpCompiler::GetCode(int32_t *pCodeSize)
827827
}
828828

829829
InterpCompiler::InterpCompiler(COMP_HANDLE compHnd,
830-
CORINFO_METHOD_INFO* methodInfo,
831-
bool verbose)
830+
CORINFO_METHOD_INFO* methodInfo)
832831
{
833832
m_methodHnd = methodInfo->ftn;
834833
m_compScopeHnd = methodInfo->scope;
835834
m_compHnd = compHnd;
836835
m_methodInfo = methodInfo;
837-
m_verbose = verbose;
836+
837+
#ifdef DEBUG
838+
m_methodName = compHnd->getMethodNameFromMetadata(methodInfo->ftn, nullptr, nullptr, nullptr, 0);
839+
if (m_methodName && InterpConfig.InterpDump() && !strcmp(m_methodName, InterpConfig.InterpDump()))
840+
m_verbose = true;
841+
#endif
838842
}
839843

840844
InterpMethod* InterpCompiler::CompileMethod()

src/coreclr/interpreter/compiler.h

+4-1
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,10 @@ class InterpCompiler
266266
CORINFO_MODULE_HANDLE m_compScopeHnd;
267267
COMP_HANDLE m_compHnd;
268268
CORINFO_METHOD_INFO* m_methodInfo;
269+
#ifdef DEBUG
270+
const char *m_methodName;
269271
bool m_verbose;
272+
#endif
270273

271274
static int32_t InterpGetMovForType(InterpType interpType, bool signExtend);
272275

@@ -424,7 +427,7 @@ class InterpCompiler
424427
void PrintCompiledIns(const int32_t *ip, const int32_t *start);
425428
public:
426429

427-
InterpCompiler(COMP_HANDLE compHnd, CORINFO_METHOD_INFO* methodInfo, bool verbose);
430+
InterpCompiler(COMP_HANDLE compHnd, CORINFO_METHOD_INFO* methodInfo);
428431

429432
InterpMethod* CompileMethod();
430433

src/coreclr/interpreter/eeinterp.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ CorJitResult CILInterp::compileMethod(ICorJitInfo* compHnd,
7979
return CORJIT_SKIPPED;
8080
}
8181

82-
InterpCompiler compiler(compHnd, methodInfo, false /* verbose */);
82+
InterpCompiler compiler(compHnd, methodInfo);
8383
InterpMethod *pMethod = compiler.CompileMethod();
8484

8585
int32_t IRCodeSize;

0 commit comments

Comments
 (0)