Skip to content

Enable COMPlus_JitDisasmWithGC by default#45991

Closed
BruceForstall wants to merge 1 commit intodotnet:masterfrom
BruceForstall:EnableInterleavedGcInfoByDefault
Closed

Enable COMPlus_JitDisasmWithGC by default#45991
BruceForstall wants to merge 1 commit intodotnet:masterfrom
BruceForstall:EnableInterleavedGcInfoByDefault

Conversation

@BruceForstall
Copy link
Contributor

Change the default disassembly output to include interleaved GC info
using the COMPlus_JitDisasmWithGC mechanism. With this, asm diffs
will automatically include GC info diffs. You can revert to the previous behavior
(no interleaved GC info) by setting COMPlus_JitDisasmWithGC=0.

Note that COMPlus_JitDisasmWithGC uses codegen GC tracking info to
display GC info; it does not decode the actual generated GC info or the
emitter-level GC tracking info, so there can still be GC info bugs not
shown with this display.

The motivation behind this change to make GC info tracking more visible
for all JIT changes.

The output is roughly like the SOS u -gcinfo display.

Example (with lots of GC info):

call     System.Collections.Immutable.ImmutableArray:ToImmutableArray(System.Collections.Generic.IEnumerable`1[__Canon]):System.Collections.Immutable.ImmutableArray`1[__Canon]
; gcrRegs -[rdx rdi] +[rax]
; gcr arg pop 0
mov      gword ptr [rbp-80H], rax
; GC ptr vars +{V25}
mov      rdx, r14
; gcrRegs +[rdx]
mov      rcx, 0xD1FFAB1E
; GC ptr vars -{V25}
call     System.Collections.Immutable.ImmutableArray:ToImmutableArray(System.Collections.Generic.IEnumerable`1[__Canon]):System.Collections.Immutable.ImmutableArray`1[__Canon]
; gcrRegs -[rdx r14]
; gcr arg pop 0
mov      gword ptr [rbp-88H], rax
; GC ptr vars +{V26}

Related: #41647

Change the default disassembly output to include interleaved GC info
using the `COMPlus_JitDisasmWithGC` mechanism. With this, asm diffs
will automatically include GC info diffs. You can revert to the previous behavior
(no interleaved GC info) by setting `COMPlus_JitDisasmWithGC=0`.

Note that `COMPlus_JitDisasmWithGC` uses codegen GC tracking info to
display GC info; it does not decode the actual generated GC info or the
emitter-level GC tracking info, so there can still be GC info bugs not
shown with this display.

The motivation behind this change to make GC info tracking more visible
for all JIT changes.

The output is roughly like the SOS `u -gcinfo` display.

Example (with lots of GC info):
```
call     System.Collections.Immutable.ImmutableArray:ToImmutableArray(System.Collections.Generic.IEnumerable`1[__Canon]):System.Collections.Immutable.ImmutableArray`1[__Canon]
; gcrRegs -[rdx rdi] +[rax]
; gcr arg pop 0
mov      gword ptr [rbp-80H], rax
; GC ptr vars +{V25}
mov      rdx, r14
; gcrRegs +[rdx]
mov      rcx, 0xD1FFAB1E
; GC ptr vars -{V25}
call     System.Collections.Immutable.ImmutableArray:ToImmutableArray(System.Collections.Generic.IEnumerable`1[__Canon]):System.Collections.Immutable.ImmutableArray`1[__Canon]
; gcrRegs -[rdx r14]
; gcr arg pop 0
mov      gword ptr [rbp-88H], rax
; GC ptr vars +{V26}
```

Related: dotnet#41647
@Dotnet-GitSync-Bot Dotnet-GitSync-Bot added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Dec 12, 2020
@BruceForstall
Copy link
Contributor Author

@dotnet/jit-contrib PTAL

Comments on this change?

@AndyAyersMS
Copy link
Member

I guess I'd prefer not to have it on by default... but perhaps PMI/SPMI can turn it on when they generate ASM?

@ghost ghost locked as resolved and limited conversation to collaborators Feb 13, 2021
@BruceForstall BruceForstall deleted the EnableInterleavedGcInfoByDefault branch February 28, 2021 03:07
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants