From 0da6f43fcdc61af0f31d83589f4fd863adaec180 Mon Sep 17 00:00:00 2001 From: Kunal Pathak Date: Tue, 6 Oct 2020 16:45:33 -0700 Subject: [PATCH 1/6] Add COMPlus_JitDasmWithAddress to print the address --- src/coreclr/src/jit/compiler.cpp | 7 +++++++ src/coreclr/src/jit/compiler.h | 1 + src/coreclr/src/jit/emit.cpp | 14 ++++++++++++-- src/coreclr/src/jit/emit.h | 2 +- src/coreclr/src/jit/emitarm.cpp | 4 +++- src/coreclr/src/jit/emitarm64.cpp | 4 +++- src/coreclr/src/jit/emitxarch.cpp | 3 ++- src/coreclr/src/jit/jitconfigvalues.h | 1 + 8 files changed, 30 insertions(+), 6 deletions(-) diff --git a/src/coreclr/src/jit/compiler.cpp b/src/coreclr/src/jit/compiler.cpp index 22784047fcbc0..3e4b07a737640 100644 --- a/src/coreclr/src/jit/compiler.cpp +++ b/src/coreclr/src/jit/compiler.cpp @@ -2820,6 +2820,7 @@ void Compiler::compInitOptions(JitFlags* jitFlags) opts.disAsm = false; opts.disAsmSpilled = false; opts.disDiffable = false; + opts.disAddr = false; opts.dspCode = false; opts.dspEHTable = false; opts.dspDebugInfo = false; @@ -2962,6 +2963,12 @@ void Compiler::compInitOptions(JitFlags* jitFlags) opts.dspDiffable = true; } + // This one applies to both Ngen/Jit Disasm output: COMPlus_JitDasmWithAddress=1 + if (JitConfig.DasmWithAddress() != 0) + { + opts.disAddr = true; + } + if (JitConfig.JitLongAddress() != 0) { opts.compLongAddress = true; diff --git a/src/coreclr/src/jit/compiler.h b/src/coreclr/src/jit/compiler.h index 0f0460f6cb8f7..60090744f7854 100644 --- a/src/coreclr/src/jit/compiler.h +++ b/src/coreclr/src/jit/compiler.h @@ -8945,6 +8945,7 @@ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX bool disAsmSpilled; // Display native code when any register spilling occurs bool disasmWithGC; // Display GC info interleaved with disassembly. bool disDiffable; // Makes the Disassembly code 'diff-able' + bool disAddr; // Display process address next to each instruction in Disassembly code bool disAsm2; // Display native code after it is generated using external disassembler bool dspOrder; // Display names of each of the methods that we ngen/jit bool dspUnwind; // Display the unwind info output diff --git a/src/coreclr/src/jit/emit.cpp b/src/coreclr/src/jit/emit.cpp index 51b52b94cafe0..b032eb9b8decf 100644 --- a/src/coreclr/src/jit/emit.cpp +++ b/src/coreclr/src/jit/emit.cpp @@ -1211,8 +1211,13 @@ void emitter::appendToCurIG(instrDesc* id) #ifdef DEBUG -void emitter::emitDispInsOffs(unsigned offs, bool doffs) +void emitter::emitDispInsOffs(unsigned offs, bool doffs, BYTE* code) { + if (emitComp->opts.disAddr) + { + printf("[" FMT_ADDR "] ", DBG_ADDR(code)); + } + if (doffs) { printf("%06X", offs); @@ -5085,7 +5090,12 @@ unsigned emitter::emitEndCodeGen(Compiler* comp, } else { - printf("\nG_M%03u_IG%02u:\n", emitComp->compMethodID, ig->igNum); + printf("\nG_M%03u_IG%02u:", emitComp->compMethodID, ig->igNum); + if (emitComp->opts.disAddr) + { + printf("\t\t;; offset=%04XH", ig->igOffs); + } + printf("\n"); } } #endif // DEBUG diff --git a/src/coreclr/src/jit/emit.h b/src/coreclr/src/jit/emit.h index 893b100274bc4..8c66e6f940d1d 100644 --- a/src/coreclr/src/jit/emit.h +++ b/src/coreclr/src/jit/emit.h @@ -1508,7 +1508,7 @@ class emitter void emitDispGCinfo(); void emitDispClsVar(CORINFO_FIELD_HANDLE fldHnd, ssize_t offs, bool reloc = false); void emitDispFrameRef(int varx, int disp, int offs, bool asmfm); - void emitDispInsOffs(unsigned offs, bool doffs); + void emitDispInsOffs(unsigned offs, bool doffs, BYTE* code); void emitDispInsHex(instrDesc* id, BYTE* code, size_t sz); #else // !DEBUG diff --git a/src/coreclr/src/jit/emitarm.cpp b/src/coreclr/src/jit/emitarm.cpp index 3dc696f119758..e77f18098e156 100644 --- a/src/coreclr/src/jit/emitarm.cpp +++ b/src/coreclr/src/jit/emitarm.cpp @@ -6977,11 +6977,13 @@ void emitter::emitDispInsHelp( sz = 0; if (!emitComp->opts.dspEmit && !isNew && !asmfm && sz) + { doffs = true; + } /* Display the instruction offset */ - emitDispInsOffs(offset, doffs); + emitDispInsOffs(offset, doffs, code); /* Display the instruction hex code */ diff --git a/src/coreclr/src/jit/emitarm64.cpp b/src/coreclr/src/jit/emitarm64.cpp index 42af7099e27f3..c68cbcee88008 100644 --- a/src/coreclr/src/jit/emitarm64.cpp +++ b/src/coreclr/src/jit/emitarm64.cpp @@ -12108,11 +12108,13 @@ void emitter::emitDispIns( sz = 0; if (!emitComp->opts.dspEmit && !isNew && !asmfm && sz) + { doffs = true; + } /* Display the instruction offset */ - emitDispInsOffs(offset, doffs); + emitDispInsOffs(offset, doffs, pCode); /* Display the instruction hex code */ diff --git a/src/coreclr/src/jit/emitxarch.cpp b/src/coreclr/src/jit/emitxarch.cpp index 0a6c7ae991bb0..296b847f77f44 100644 --- a/src/coreclr/src/jit/emitxarch.cpp +++ b/src/coreclr/src/jit/emitxarch.cpp @@ -8245,7 +8245,7 @@ void emitter::emitDispIns( /* Display the instruction offset */ - emitDispInsOffs(offset, doffs); + emitDispInsOffs(offset, doffs, code); if (code != nullptr) { @@ -13985,6 +13985,7 @@ emitter::insExecutionCharacteristics emitter::getInsExecutionCharacteristics(ins switch (ins) { + case INS_align: case INS_nop: case INS_int3: assert(memFmt == IF_NONE); diff --git a/src/coreclr/src/jit/jitconfigvalues.h b/src/coreclr/src/jit/jitconfigvalues.h index 41e2bb8fdfc1a..b6c570afc8d9d 100644 --- a/src/coreclr/src/jit/jitconfigvalues.h +++ b/src/coreclr/src/jit/jitconfigvalues.h @@ -22,6 +22,7 @@ CONFIG_INTEGER(BreakOnDumpToken, W("BreakOnDumpToken"), 0xffffffff) // Breaks wh CONFIG_INTEGER(DebugBreakOnVerificationFailure, W("DebugBreakOnVerificationFailure"), 0) // Halts the jit on // verification failure CONFIG_INTEGER(DiffableDasm, W("JitDiffableDasm"), 0) // Make the disassembly diff-able +CONFIG_INTEGER(DasmWithAddress, W("JitDasmWithAddress"), 0) // Print the process address next to each instruction of the disassembly CONFIG_INTEGER(DisplayLoopHoistStats, W("JitLoopHoistStats"), 0) // Display JIT loop hoisting statistics CONFIG_INTEGER(DisplayLsraStats, W("JitLsraStats"), 0) // Display JIT Linear Scan Register Allocator statistics CONFIG_INTEGER(DumpJittedMethods, W("DumpJittedMethods"), 0) // Prints all jitted methods to the console From 93387f2f3a9f04b4a769c205382c7376d3274b15 Mon Sep 17 00:00:00 2001 From: Kunal Pathak Date: Tue, 6 Oct 2020 16:49:43 -0700 Subject: [PATCH 2/6] Remove dspEmit variable --- src/coreclr/src/jit/compiler.cpp | 3 +-- src/coreclr/src/jit/compiler.h | 1 - src/coreclr/src/jit/emit.cpp | 29 +++-------------------------- src/coreclr/src/jit/emitarm.cpp | 4 ++-- src/coreclr/src/jit/emitarm64.cpp | 4 ++-- src/coreclr/src/jit/emitxarch.cpp | 4 ++-- 6 files changed, 10 insertions(+), 35 deletions(-) diff --git a/src/coreclr/src/jit/compiler.cpp b/src/coreclr/src/jit/compiler.cpp index 3e4b07a737640..e07bb433c1896 100644 --- a/src/coreclr/src/jit/compiler.cpp +++ b/src/coreclr/src/jit/compiler.cpp @@ -2813,7 +2813,6 @@ void Compiler::compInitOptions(JitFlags* jitFlags) #ifdef DEBUG opts.dspInstrs = false; - opts.dspEmit = false; opts.dspLines = false; opts.varNames = false; opts.dmpHex = false; @@ -6097,7 +6096,7 @@ int Compiler::compCompileHelper(CORINFO_MODULE_HANDLE classPtr, #ifdef DEBUG /* Give the function a unique number */ - if (opts.disAsm || opts.dspEmit || verbose) + if (opts.disAsm || verbose) { compMethodID = ~info.compMethodHash() & 0xffff; } diff --git a/src/coreclr/src/jit/compiler.h b/src/coreclr/src/jit/compiler.h index 60090744f7854..3249b65763a2e 100644 --- a/src/coreclr/src/jit/compiler.h +++ b/src/coreclr/src/jit/compiler.h @@ -8937,7 +8937,6 @@ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX bool dspEHTable; // Display the EH table reported to the VM bool dspDebugInfo; // Display the Debug info reported to the VM bool dspInstrs; // Display the IL instructions intermixed with the native code output - bool dspEmit; // Display emitter output bool dspLines; // Display source-code lines intermixed with native code output bool dmpHex; // Display raw bytes in hex of native code output bool varNames; // Display variables names in native code output diff --git a/src/coreclr/src/jit/emit.cpp b/src/coreclr/src/jit/emit.cpp index b032eb9b8decf..5a9bd398e5d65 100644 --- a/src/coreclr/src/jit/emit.cpp +++ b/src/coreclr/src/jit/emit.cpp @@ -5058,7 +5058,7 @@ unsigned emitter::emitEndCodeGen(Compiler* comp, assert(coldCodeBlock); cp = coldCodeBlock; #ifdef DEBUG - if (emitComp->opts.disAsm || emitComp->opts.dspEmit || emitComp->verbose) + if (emitComp->opts.disAsm || emitComp->verbose) { printf("\n************** Beginning of cold code **************\n"); } @@ -5081,7 +5081,7 @@ unsigned emitter::emitEndCodeGen(Compiler* comp, #ifdef DEBUG /* Print the IG label, but only if it is a branch label */ - if (emitComp->opts.disAsm || emitComp->opts.dspEmit || emitComp->verbose) + if (emitComp->opts.disAsm || emitComp->verbose) { if (emitComp->verbose || emitComp->opts.disasmWithGC) { @@ -5193,7 +5193,7 @@ unsigned emitter::emitEndCodeGen(Compiler* comp, } #ifdef DEBUG - if (emitComp->opts.disAsm || emitComp->opts.dspEmit || emitComp->verbose) + if (emitComp->opts.disAsm || emitComp->verbose) { printf("\t\t\t\t\t\t;; bbWeight=%s PerfScore %.2f", refCntWtd2str(ig->igWeight), ig->igPerfScore); } @@ -6481,10 +6481,6 @@ unsigned char emitter::emitOutputByte(BYTE* dst, ssize_t val) *castto(dst, unsigned char*) = (unsigned char)val; #ifdef DEBUG - if (emitComp->opts.dspEmit) - { - printf("; emit_byte 0%02XH\n", val & 0xFF); - } #ifdef TARGET_AMD64 // if we're emitting code bytes, ensure that we've already emitted the rex prefix! assert(((val & 0xFF00000000LL) == 0) || ((val & 0xFFFFFFFF00000000LL) == 0xFFFFFFFF00000000LL)); @@ -6504,10 +6500,6 @@ unsigned char emitter::emitOutputWord(BYTE* dst, ssize_t val) MISALIGNED_WR_I2(dst, (short)val); #ifdef DEBUG - if (emitComp->opts.dspEmit) - { - printf("; emit_word 0%02XH,0%02XH\n", (val & 0xFF), (val >> 8) & 0xFF); - } #ifdef TARGET_AMD64 // if we're emitting code bytes, ensure that we've already emitted the rex prefix! assert(((val & 0xFF00000000LL) == 0) || ((val & 0xFFFFFFFF00000000LL) == 0xFFFFFFFF00000000LL)); @@ -6527,10 +6519,6 @@ unsigned char emitter::emitOutputLong(BYTE* dst, ssize_t val) MISALIGNED_WR_I4(dst, (int)val); #ifdef DEBUG - if (emitComp->opts.dspEmit) - { - printf("; emit_long 0%08XH\n", (int)val); - } #ifdef TARGET_AMD64 // if we're emitting code bytes, ensure that we've already emitted the rex prefix! assert(((val & 0xFF00000000LL) == 0) || ((val & 0xFFFFFFFF00000000LL) == 0xFFFFFFFF00000000LL)); @@ -6553,17 +6541,6 @@ unsigned char emitter::emitOutputSizeT(BYTE* dst, ssize_t val) MISALIGNED_WR_ST(dst, val); #endif -#ifdef DEBUG - if (emitComp->opts.dspEmit) - { -#ifdef TARGET_AMD64 - printf("; emit_size_t 0%016llXH\n", val); -#else // TARGET_AMD64 - printf("; emit_size_t 0%08XH\n", val); -#endif // TARGET_AMD64 - } -#endif // DEBUG - return TARGET_POINTER_SIZE; } diff --git a/src/coreclr/src/jit/emitarm.cpp b/src/coreclr/src/jit/emitarm.cpp index e77f18098e156..0724cb34e1a57 100644 --- a/src/coreclr/src/jit/emitarm.cpp +++ b/src/coreclr/src/jit/emitarm.cpp @@ -6530,7 +6530,7 @@ size_t emitter::emitOutputInstr(insGroup* ig, instrDesc* id, BYTE** dp) size_t expected = emitSizeOfInsDsc(id); assert(sz == expected); - if (emitComp->opts.disAsm || emitComp->opts.dspEmit || emitComp->verbose) + if (emitComp->opts.disAsm || emitComp->verbose) { emitDispIns(id, false, dspOffs, true, emitCurCodeOffs(odst), *dp, (dst - *dp), ig); } @@ -6976,7 +6976,7 @@ void emitter::emitDispInsHelp( if (code == NULL) sz = 0; - if (!emitComp->opts.dspEmit && !isNew && !asmfm && sz) + if (!isNew && !asmfm && sz) { doffs = true; } diff --git a/src/coreclr/src/jit/emitarm64.cpp b/src/coreclr/src/jit/emitarm64.cpp index c68cbcee88008..dbb585b1c67f4 100644 --- a/src/coreclr/src/jit/emitarm64.cpp +++ b/src/coreclr/src/jit/emitarm64.cpp @@ -11462,7 +11462,7 @@ size_t emitter::emitOutputInstr(insGroup* ig, instrDesc* id, BYTE** dp) size_t expected = emitSizeOfInsDsc(id); assert(sz == expected); - if (emitComp->opts.disAsm || emitComp->opts.dspEmit || emitComp->verbose) + if (emitComp->opts.disAsm || emitComp->verbose) { emitDispIns(id, false, dspOffs, true, emitCurCodeOffs(odst), *dp, (dst - *dp), ig); } @@ -12107,7 +12107,7 @@ void emitter::emitDispIns( if (pCode == NULL) sz = 0; - if (!emitComp->opts.dspEmit && !isNew && !asmfm && sz) + if (!isNew && !asmfm && sz) { doffs = true; } diff --git a/src/coreclr/src/jit/emitxarch.cpp b/src/coreclr/src/jit/emitxarch.cpp index 296b847f77f44..badd972c10502 100644 --- a/src/coreclr/src/jit/emitxarch.cpp +++ b/src/coreclr/src/jit/emitxarch.cpp @@ -8238,7 +8238,7 @@ void emitter::emitDispIns( // printf("[A=%08X] " , emitSimpleByrefStkMask); // printf("[L=%02u] " , id->idCodeSize()); - if (!emitComp->opts.dspEmit && !isNew && !asmfm) + if (!isNew && !asmfm) { doffs = true; } @@ -13680,7 +13680,7 @@ size_t emitter::emitOutputInstr(insGroup* ig, instrDesc* id, BYTE** dp) assert(*dp != dst || emitInstHasNoCode(ins)); #ifdef DEBUG - if (emitComp->opts.disAsm || emitComp->opts.dspEmit || emitComp->verbose) + if (emitComp->opts.disAsm || emitComp->verbose) { emitDispIns(id, false, dspOffs, true, emitCurCodeOffs(*dp), *dp, (dst - *dp)); } From 4cea9376fd2de5f0fcf28bda56d36bf57ef7c25e Mon Sep 17 00:00:00 2001 From: Kunal Pathak Date: Wed, 7 Oct 2020 10:09:50 -0700 Subject: [PATCH 3/6] remove the square brackets --- src/coreclr/src/jit/emit.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/coreclr/src/jit/emit.cpp b/src/coreclr/src/jit/emit.cpp index 5a9bd398e5d65..eae558f245ba2 100644 --- a/src/coreclr/src/jit/emit.cpp +++ b/src/coreclr/src/jit/emit.cpp @@ -1215,7 +1215,7 @@ void emitter::emitDispInsOffs(unsigned offs, bool doffs, BYTE* code) { if (emitComp->opts.disAddr) { - printf("[" FMT_ADDR "] ", DBG_ADDR(code)); + printf(FMT_ADDR, DBG_ADDR(code)); } if (doffs) From 7adbe05b072ab578591bdee227d64c16a9b83ffe Mon Sep 17 00:00:00 2001 From: Kunal Pathak Date: Fri, 9 Oct 2020 13:19:33 -0700 Subject: [PATCH 4/6] review comments --- src/coreclr/src/jit/compiler.h | 2 +- src/coreclr/src/jit/emit.cpp | 14 +++++++++++--- src/coreclr/src/jit/emit.h | 3 ++- src/coreclr/src/jit/emitarm.cpp | 6 +++++- src/coreclr/src/jit/emitarm64.cpp | 6 +++++- src/coreclr/src/jit/emitxarch.cpp | 6 +++++- src/coreclr/src/jit/jitconfigvalues.h | 5 +++-- 7 files changed, 32 insertions(+), 10 deletions(-) diff --git a/src/coreclr/src/jit/compiler.h b/src/coreclr/src/jit/compiler.h index 3249b65763a2e..f1ef53f285e91 100644 --- a/src/coreclr/src/jit/compiler.h +++ b/src/coreclr/src/jit/compiler.h @@ -8944,7 +8944,7 @@ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX bool disAsmSpilled; // Display native code when any register spilling occurs bool disasmWithGC; // Display GC info interleaved with disassembly. bool disDiffable; // Makes the Disassembly code 'diff-able' - bool disAddr; // Display process address next to each instruction in Disassembly code + bool disAddr; // Display process address next to each instruction in disassembly code bool disAsm2; // Display native code after it is generated using external disassembler bool dspOrder; // Display names of each of the methods that we ngen/jit bool dspUnwind; // Display the unwind info output diff --git a/src/coreclr/src/jit/emit.cpp b/src/coreclr/src/jit/emit.cpp index eae558f245ba2..8cdf589f2f089 100644 --- a/src/coreclr/src/jit/emit.cpp +++ b/src/coreclr/src/jit/emit.cpp @@ -1211,13 +1211,16 @@ void emitter::appendToCurIG(instrDesc* id) #ifdef DEBUG -void emitter::emitDispInsOffs(unsigned offs, bool doffs, BYTE* code) +void emitter::emitDispInsAddr(BYTE* code) { if (emitComp->opts.disAddr) { printf(FMT_ADDR, DBG_ADDR(code)); } +} +void emitter::emitDispInsOffs(unsigned offs, bool doffs) +{ if (doffs) { printf("%06X", offs); @@ -5091,9 +5094,14 @@ unsigned emitter::emitEndCodeGen(Compiler* comp, else { printf("\nG_M%03u_IG%02u:", emitComp->compMethodID, ig->igNum); - if (emitComp->opts.disAddr) + if (!emitComp->opts.disDiffable) { - printf("\t\t;; offset=%04XH", ig->igOffs); +#ifdef TARGET_XARCH + printf(" ;; offset=%04XH", ig->igOffs); +#elif defined(TARGET_ARM64) + // Only display for arm64 because offset is already displayed by default for arm + printf(" ;; offset=%04XH", ig->igOffs); +#endif } printf("\n"); } diff --git a/src/coreclr/src/jit/emit.h b/src/coreclr/src/jit/emit.h index 8c66e6f940d1d..0adba185f9c5c 100644 --- a/src/coreclr/src/jit/emit.h +++ b/src/coreclr/src/jit/emit.h @@ -1508,7 +1508,8 @@ class emitter void emitDispGCinfo(); void emitDispClsVar(CORINFO_FIELD_HANDLE fldHnd, ssize_t offs, bool reloc = false); void emitDispFrameRef(int varx, int disp, int offs, bool asmfm); - void emitDispInsOffs(unsigned offs, bool doffs, BYTE* code); + void emitDispInsAddr(BYTE* code); + void emitDispInsOffs(unsigned offs, bool doffs); void emitDispInsHex(instrDesc* id, BYTE* code, size_t sz); #else // !DEBUG diff --git a/src/coreclr/src/jit/emitarm.cpp b/src/coreclr/src/jit/emitarm.cpp index 0724cb34e1a57..2b558a50a8cd4 100644 --- a/src/coreclr/src/jit/emitarm.cpp +++ b/src/coreclr/src/jit/emitarm.cpp @@ -6981,9 +6981,13 @@ void emitter::emitDispInsHelp( doffs = true; } + /* Display the instruction address */ + + emitDispInsAddr(code); + /* Display the instruction offset */ - emitDispInsOffs(offset, doffs, code); + emitDispInsOffs(offset, doffs); /* Display the instruction hex code */ diff --git a/src/coreclr/src/jit/emitarm64.cpp b/src/coreclr/src/jit/emitarm64.cpp index dbb585b1c67f4..b7ca1dc29c8c8 100644 --- a/src/coreclr/src/jit/emitarm64.cpp +++ b/src/coreclr/src/jit/emitarm64.cpp @@ -12112,9 +12112,13 @@ void emitter::emitDispIns( doffs = true; } + /* Display the instruction address */ + + emitDispInsAddr(pCode); + /* Display the instruction offset */ - emitDispInsOffs(offset, doffs, pCode); + emitDispInsOffs(offset, doffs); /* Display the instruction hex code */ diff --git a/src/coreclr/src/jit/emitxarch.cpp b/src/coreclr/src/jit/emitxarch.cpp index badd972c10502..7774b850ef8d8 100644 --- a/src/coreclr/src/jit/emitxarch.cpp +++ b/src/coreclr/src/jit/emitxarch.cpp @@ -8243,9 +8243,13 @@ void emitter::emitDispIns( doffs = true; } + /* Display the instruction address */ + + emitDispInsAddr(code); + /* Display the instruction offset */ - emitDispInsOffs(offset, doffs, code); + emitDispInsOffs(offset, doffs); if (code != nullptr) { diff --git a/src/coreclr/src/jit/jitconfigvalues.h b/src/coreclr/src/jit/jitconfigvalues.h index b6c570afc8d9d..5d77d6a0affda 100644 --- a/src/coreclr/src/jit/jitconfigvalues.h +++ b/src/coreclr/src/jit/jitconfigvalues.h @@ -21,8 +21,9 @@ CONFIG_INTEGER(BreakOnDumpToken, W("BreakOnDumpToken"), 0xffffffff) // Breaks wh // particular token value. CONFIG_INTEGER(DebugBreakOnVerificationFailure, W("DebugBreakOnVerificationFailure"), 0) // Halts the jit on // verification failure -CONFIG_INTEGER(DiffableDasm, W("JitDiffableDasm"), 0) // Make the disassembly diff-able -CONFIG_INTEGER(DasmWithAddress, W("JitDasmWithAddress"), 0) // Print the process address next to each instruction of the disassembly +CONFIG_INTEGER(DiffableDasm, W("JitDiffableDasm"), 0) // Make the disassembly diff-able +CONFIG_INTEGER(JitDasmWithAddress, W("JitDasmWithAddress"), 0) // Print the process address next to each instruction of + // the disassembly CONFIG_INTEGER(DisplayLoopHoistStats, W("JitLoopHoistStats"), 0) // Display JIT loop hoisting statistics CONFIG_INTEGER(DisplayLsraStats, W("JitLsraStats"), 0) // Display JIT Linear Scan Register Allocator statistics CONFIG_INTEGER(DumpJittedMethods, W("DumpJittedMethods"), 0) // Prints all jitted methods to the console From f5c5b2c2a789a276521473f8ebd92aecd8f893ce Mon Sep 17 00:00:00 2001 From: Kunal Pathak Date: Fri, 9 Oct 2020 13:21:01 -0700 Subject: [PATCH 5/6] always display offset --- src/coreclr/src/jit/emit.cpp | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/coreclr/src/jit/emit.cpp b/src/coreclr/src/jit/emit.cpp index 8cdf589f2f089..39b1d88b14d74 100644 --- a/src/coreclr/src/jit/emit.cpp +++ b/src/coreclr/src/jit/emit.cpp @@ -5096,12 +5096,7 @@ unsigned emitter::emitEndCodeGen(Compiler* comp, printf("\nG_M%03u_IG%02u:", emitComp->compMethodID, ig->igNum); if (!emitComp->opts.disDiffable) { -#ifdef TARGET_XARCH printf(" ;; offset=%04XH", ig->igOffs); -#elif defined(TARGET_ARM64) - // Only display for arm64 because offset is already displayed by default for arm - printf(" ;; offset=%04XH", ig->igOffs); -#endif } printf("\n"); } From 56268796b65c65932d4177711dcfd5d3edbf7300 Mon Sep 17 00:00:00 2001 From: Kunal Pathak Date: Fri, 9 Oct 2020 14:17:59 -0700 Subject: [PATCH 6/6] fix the reference of JitDasmWithAddress --- src/coreclr/src/jit/compiler.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/coreclr/src/jit/compiler.cpp b/src/coreclr/src/jit/compiler.cpp index e07bb433c1896..9f35799120f3d 100644 --- a/src/coreclr/src/jit/compiler.cpp +++ b/src/coreclr/src/jit/compiler.cpp @@ -2963,7 +2963,7 @@ void Compiler::compInitOptions(JitFlags* jitFlags) } // This one applies to both Ngen/Jit Disasm output: COMPlus_JitDasmWithAddress=1 - if (JitConfig.DasmWithAddress() != 0) + if (JitConfig.JitDasmWithAddress() != 0) { opts.disAddr = true; }