Uh oh!
There was an error while loading. Please reload this page.
Add disasm comments for field data addresses and code addresses - #70437
Merged
Conversation
ghost
commented
Jun 8, 2022
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch Issue DetailsThis adds disassembly comments for field addresses and function addresses. To make this more useful, it also supports displaying the comments for x64 instructions with addressing modes. For example, for publicclassProgram{publicstaticints_primitive;privatestaticGuids_guid;publicstaticvoidMain(){Console.WriteLine(s_primitive);Console.WriteLine(s_guid);Actiona=Main;}}the diff in the disasm on x64 is mov rcx, 0xD1FFAB1E
mov edx, 1
call CORINFO_HELP_GETSHARED_NONGCSTATIC_BASE
- mov ecx, dword ptr [(reloc)]+ mov ecx, dword ptr [(reloc)] ; data for Program:s_primitive
call [System.Console:WriteLine(int)]
mov rcx, 0xD1FFAB1E ; System.Guid
call CORINFO_HELP_NEWSFAST
- mov rcx, 0xD1FFAB1E+ mov rcx, 0xD1FFAB1E ; box for Program:s_guid
mov rcx, gword ptr [rcx]
vmovupd xmm0, xmmword ptr [rcx+8]
vmovupd xmmword ptr [rax+8], xmm0
mov rcx, rax
call [System.Console:WriteLine(System.Object)]
- mov rcx, 0xD1FFAB1E+ mov rcx, 0xD1FFAB1E ; data for <>O:<0>__Main
cmp gword ptr [rcx], 0
jne SHORT G_M27646_IG04
;; size=95 bbWeight=1 PerfScore 23.50
G_M27646_IG03:
- mov rcx, 0xD1FFAB1E+ mov rcx, 0xD1FFAB1E ; token handle
call CORINFO_HELP_NEWSFAST
mov rsi, rax
lea rcx, bword ptr [rsi+8]
mov rdx, rsi
call CORINFO_HELP_ASSIGN_REF
- mov rdx, 0xD1FFAB1E+ mov rdx, 0xD1FFAB1E ; function address
mov qword ptr [rsi+24], rdx
- mov rdx, 0xD1FFAB1E+ mov rdx, 0xD1FFAB1E ; code address for Program:Main
mov qword ptr [rsi+32], rdx
- mov rcx, 0xD1FFAB1E+ mov rcx, 0xD1FFAB1E ; data for <>O:<0>__Main
mov rdx, rsi
call CORINFO_HELP_ASSIGN_REF
;; size=76 bbWeight=0.50 PerfScore 3.62For ARM64 it looks like (due to CSE not all of the static field accesses show up): mov w1, #1
bl CORINFO_HELP_GETSHARED_NONGCSTATIC_BASE
ldr w0, [x19,#56]
- movz x1, #0xd1ffab1e+ movz x1, #0xd1ffab1e // code address for System.Console:WriteLine
movk x1, #0xd1ffab1e LSL #16
movk x1, #0xd1ffab1e LSL #32
ldr x1, [x1]
@@ -40,13 +40,13 @@ G_M27646_IG02:
movk x0, #0xd1ffab1e LSL #16
movk x0, #0xd1ffab1e LSL #32
bl CORINFO_HELP_NEWSFAST
- movz x19, #0xd1ffab1e+ movz x19, #0xd1ffab1e // box for Program:s_guid
movk x19, #0xd1ffab1e LSL #16
movk x19, #0xd1ffab1e LSL #32
ldr x1, [x19]
ldr q16, [x1,#8]
str q16, [x0,#8]
- movz x1, #0xd1ffab1e+ movz x1, #0xd1ffab1e // code address for System.Console:WriteLine
movk x1, #0xd1ffab1e LSL #16
movk x1, #0xd1ffab1e LSL #32
ldr x1, [x1]
@@ -66,7 +66,7 @@ G_M27646_IG03:
movk x14, #0xd1ffab1e LSL #16
movk x14, #0xd1ffab1e LSL #32
str x14, [x0,#24]
- movz x14, #0xd1ffab1e+ movz x14, #0xd1ffab1e // code address for Program:Main
movk x14, #0xd1ffab1e LSL #16
movk x14, #0xd1ffab1e LSL #32
str x14, [x0,#32]
|
jakobbotsch
commented
Jun 8, 2022
MemberAuthor
cc @dotnet/jit-contrib PTAL @kunalspathak@BruceForstall |
14 tasks
This was mistakenly creating a handle for the parent (always a class) but specifying the handle type of the child (e.g. constructor method handle).
jakobbotsch
commented
Jun 8, 2022
MemberAuthor
Running the tests with |
MemberAuthor
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This adds disassembly comments for field addresses and function addresses. To make this more useful, it also supports displaying the comments for x64 instructions with addressing modes.
For example, for
the diff in the disasm on x64 is
For ARM64 it looks like (due to CSE not all of the static field accesses show up):