From 21622a848e504593c368740666bb2deea5163021 Mon Sep 17 00:00:00 2001 From: EgorBo Date: Tue, 5 Oct 2021 17:15:28 +0300 Subject: [PATCH 1/5] Add ISMETHOD and ISMETHODHASH macros --- src/coreclr/jit/gentree.h | 10 ++++------ src/coreclr/jit/jit.h | 4 ++++ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/coreclr/jit/gentree.h b/src/coreclr/jit/gentree.h index 53f73dbf7d190..6e90375c62748 100644 --- a/src/coreclr/jit/gentree.h +++ b/src/coreclr/jit/gentree.h @@ -4754,12 +4754,10 @@ struct GenTreeCall final : public GenTree void ResetArgInfo(); - GenTreeCallFlags gtCallMoreFlags; // in addition to gtFlags - - unsigned char gtCallType : 3; // value from the gtCallTypes enumeration - unsigned char gtReturnType : 5; // exact return type - - CORINFO_CLASS_HANDLE gtRetClsHnd; // The return type handle of the call if it is a struct; always available + GenTreeCallFlags gtCallMoreFlags; // in addition to gtFlags + gtCallTypes gtCallType : 3; // value from the gtCallTypes enumeration + var_types gtReturnType : 5; // exact return type + CORINFO_CLASS_HANDLE gtRetClsHnd; // The return type handle of the call if it is a struct; always available union { // only used for CALLI unmanaged calls (CT_INDIRECT) diff --git a/src/coreclr/jit/jit.h b/src/coreclr/jit/jit.h index e212226851c7c..1f3d98acdfd82 100644 --- a/src/coreclr/jit/jit.h +++ b/src/coreclr/jit/jit.h @@ -529,6 +529,8 @@ const bool dspGCtbls = true; if (JitTls::GetCompiler()->verbose) \ JitTls::GetCompiler()->fgTableDispBasicBlock(b); #define VERBOSE JitTls::GetCompiler()->verbose +#define ISMETHOD(name) !strcmp(JitTls::GetCompiler()->info.compMethodName, name) +#define ISMETHODHASH(hash) !strcmp(JitTls::GetCompiler()->info.compMethodHash, hash) #else // !DEBUG #define JITDUMP(...) #define JITDUMPEXEC(x) @@ -542,6 +544,8 @@ const bool dspGCtbls = true; #define DISPTREERANGE(range, t) #define DISPBLOCK(b) #define VERBOSE 0 +#define ISMETHOD(name) +#define ISMETHODHASH(hash) #endif // !DEBUG /***************************************************************************** From b8de204ac65cef9941d39f85c950d76d9378016a Mon Sep 17 00:00:00 2001 From: Egor Bogatov Date: Tue, 5 Oct 2021 20:00:36 +0300 Subject: [PATCH 2/5] Update src/coreclr/jit/jit.h Co-authored-by: Andy Ayers --- src/coreclr/jit/jit.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/coreclr/jit/jit.h b/src/coreclr/jit/jit.h index 1f3d98acdfd82..6c61be5c56f84 100644 --- a/src/coreclr/jit/jit.h +++ b/src/coreclr/jit/jit.h @@ -530,7 +530,7 @@ const bool dspGCtbls = true; JitTls::GetCompiler()->fgTableDispBasicBlock(b); #define VERBOSE JitTls::GetCompiler()->verbose #define ISMETHOD(name) !strcmp(JitTls::GetCompiler()->info.compMethodName, name) -#define ISMETHODHASH(hash) !strcmp(JitTls::GetCompiler()->info.compMethodHash, hash) +#define ISMETHODHASH(hash) (JitTls::GetCompiler()->impInlineRoot()->info.compMethodHash() == hash) #else // !DEBUG #define JITDUMP(...) #define JITDUMPEXEC(x) From ae898f359f0ade81587ab8ec5366dab5c82fc589 Mon Sep 17 00:00:00 2001 From: Egor Bogatov Date: Tue, 5 Oct 2021 20:01:25 +0300 Subject: [PATCH 3/5] Update jit.h --- src/coreclr/jit/jit.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/coreclr/jit/jit.h b/src/coreclr/jit/jit.h index 6c61be5c56f84..e49b9c90b9186 100644 --- a/src/coreclr/jit/jit.h +++ b/src/coreclr/jit/jit.h @@ -529,7 +529,7 @@ const bool dspGCtbls = true; if (JitTls::GetCompiler()->verbose) \ JitTls::GetCompiler()->fgTableDispBasicBlock(b); #define VERBOSE JitTls::GetCompiler()->verbose -#define ISMETHOD(name) !strcmp(JitTls::GetCompiler()->info.compMethodName, name) +#define ISMETHOD(name) !strcmp(JitTls::GetCompiler()->impInlineRoot()->info.compMethodName, name) #define ISMETHODHASH(hash) (JitTls::GetCompiler()->impInlineRoot()->info.compMethodHash() == hash) #else // !DEBUG #define JITDUMP(...) From 3754ba59adea7439b1ac21a0d645b270230a8bdb Mon Sep 17 00:00:00 2001 From: Egor Bogatov Date: Tue, 5 Oct 2021 20:03:38 +0300 Subject: [PATCH 4/5] Update jit.h --- src/coreclr/jit/jit.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/coreclr/jit/jit.h b/src/coreclr/jit/jit.h index e49b9c90b9186..dda9ba1ace869 100644 --- a/src/coreclr/jit/jit.h +++ b/src/coreclr/jit/jit.h @@ -529,7 +529,7 @@ const bool dspGCtbls = true; if (JitTls::GetCompiler()->verbose) \ JitTls::GetCompiler()->fgTableDispBasicBlock(b); #define VERBOSE JitTls::GetCompiler()->verbose -#define ISMETHOD(name) !strcmp(JitTls::GetCompiler()->impInlineRoot()->info.compMethodName, name) +#define ISMETHOD(name) (strcmp(JitTls::GetCompiler()->impInlineRoot()->info.compMethodName, name) == 0) #define ISMETHODHASH(hash) (JitTls::GetCompiler()->impInlineRoot()->info.compMethodHash() == hash) #else // !DEBUG #define JITDUMP(...) From 29c97fb66c0e0aa36fe9a13065b3bf86f5a16b27 Mon Sep 17 00:00:00 2001 From: Egor Bogatov Date: Wed, 6 Oct 2021 11:29:00 +0300 Subject: [PATCH 5/5] Update jit.h --- src/coreclr/jit/jit.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/coreclr/jit/jit.h b/src/coreclr/jit/jit.h index dda9ba1ace869..218871e154fc5 100644 --- a/src/coreclr/jit/jit.h +++ b/src/coreclr/jit/jit.h @@ -529,6 +529,7 @@ const bool dspGCtbls = true; if (JitTls::GetCompiler()->verbose) \ JitTls::GetCompiler()->fgTableDispBasicBlock(b); #define VERBOSE JitTls::GetCompiler()->verbose +// Development-time only macros, simplify guards for specified IL methods one wants to debug/add log messages for #define ISMETHOD(name) (strcmp(JitTls::GetCompiler()->impInlineRoot()->info.compMethodName, name) == 0) #define ISMETHODHASH(hash) (JitTls::GetCompiler()->impInlineRoot()->info.compMethodHash() == hash) #else // !DEBUG @@ -544,8 +545,6 @@ const bool dspGCtbls = true; #define DISPTREERANGE(range, t) #define DISPBLOCK(b) #define VERBOSE 0 -#define ISMETHOD(name) -#define ISMETHODHASH(hash) #endif // !DEBUG /*****************************************************************************