-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add JitDasmWithAddress switch to print the process address of every instruction #43120
Conversation
@dotnet/jit-contrib |
For windows arm, we show the offsets by default something like this: G_M3239_IG01: ;; offset=0000H
[ 00007ff8`1ba198a0 ] 000000 E92D 480C push {r2,r3,r11,lr}
[ 00007ff8`1ba198a4 ] 000004 F10D 0B08 add r11, sp, 8
[ 00007ff8`1ba198a8 ] 000008 2200 movs r2, 0
[ 00007ff8`1ba198aa ] 00000A 9201 str r2, [sp+0x04] // [V04 loc2]
[ 00007ff8`1ba198ac ] 00000C 9200 str r2, [sp] // [V06 loc4]
;; bbWeight=1 PerfScore 5.00
G_M3239_IG02: ;; offset=000EH
[ 00007ff8`1ba198ae ] 00000E 6843 ldr r3, [r0+4]
[ 00007ff8`1ba198b0 ] 000010 300C adds r0, 12
[ 00007ff8`1ba198b2 ] 000012 9001 str r0, [sp+0x04] // [V04 loc2]
[ 00007ff8`1ba198b4 ] 000014 9801 ldr r0, [sp+0x04] // [V04 loc2]
[ 00007ff8`1ba198b6 ] 000016 2900 cmp r1, 0
[ 00007ff8`1ba198b8 ] 000018 D101 bne SHORT G_M3239_IG04
;; bbWeight=1 PerfScore 6.00 Want to hear the thoughts if I should make offset displaying visible (for all platforms/archs) only when we set |
Why would 32-bit arm show 64-bit addresses?
IMO, no. I believe they are disabled for |
Those are taken using altjit so it is showing the x64 address space.
Got it. Is there any reason why offset display is enabled by default just on arm and not on other archs? |
nit: regarding the address display: do we need the |
Sure, I will remove it. |
Not sure. It might be that it is useful when looking at EH or GC just on arm, or, if it is useful on other platforms nobody noticed it and enabled it. |
Here is the x64 output after removing G_M3239_IG01: ;; offset=0000H
00007ff8`370b9390 4883EC18 sub rsp, 24
00007ff8`370b9394 33C0 xor rax, rax
00007ff8`370b9396 4889442410 mov qword ptr [rsp+10H], rax
00007ff8`370b939b 4889442408 mov qword ptr [rsp+08H], rax
;; bbWeight=1 PerfScore 2.50
G_M3239_IG02: ;; offset=0010H
00007ff8`370b93a0 8B4108 mov eax, dword ptr [rcx+8]
00007ff8`370b93a3 4883C10C add rcx, 12
00007ff8`370b93a7 48894C2410 mov bword ptr [rsp+10H], rcx
00007ff8`370b93ac 488B4C2410 mov rcx, bword ptr [rsp+10H]
00007ff8`370b93b1 4885D2 test rdx, rdx
00007ff8`370b93b4 7505 jne SHORT G_M3239_IG04
;; bbWeight=1 PerfScore 5.50 |
Even on 64-bit systems we can probably just display the lowest 32-bit of the addresses:
|
Yes, I started with that, but then just reused the |
But there's no downside, except for display width, right? And there might be a benefit, if you're looking at the output while in the debugger. |
That's a good point and I agree. It will be much easier to map the instructions (and find address in the debugger disassembly) while doing debugging. I will keep it as it is. |
In order to do alignment related investigation, it will be good to have a way to print the process address where JIT code is inserted into. Added
COMPlus_JitDasmWithAddress
switch to enable printing it. If this switch is set, it will also print the offset at the top of every block. Also I noticed thatopts.dspEmit
was never getting used, so I deleted it and its usage.Sample output of x64:
x86 output: