Interface devirt #10192
More details in the per-commit messages.
For interface calls, when jitting, this invokes the same paths in the runtime as a stub dispatch would, and so may trigger cache updates. It is not clear yet if this update is desirable or should be suppressed. The impact on the caches is similar to what would be without interface call devirtualization, and opportunities for devirtualization are still somewhat scarce, so it may not be easy to find cases where performance differs.
Will post some stats shortly, and workup the desktop equivalent and run tests there too.
Data from jit-diff on frameworks. A total of 397 interface calls were devirtualized.
Cherry-picked good looking diff where we can now dead code a runtime lookup:
; Assembly listing for method System.Collections.Concurrent.ConcurrentStack`1 ; [__Canon][System.__Canon]:System.Collections.IEnumerable.GetEnumerator():ref:this ; ** Before ** ; Total bytes of code 63 G_M45156_IG01: push rsi sub rsp, 48 mov qword ptr [rsp+28H], rcx mov rsi, rcx G_M45156_IG02: mov rcx, qword ptr [rsi] mov rdx, qword ptr [rcx+56] mov rdx, qword ptr [rdx] mov r11, qword ptr [rdx+40] test r11, r11 jne SHORT G_M45156_IG03 lea rdx, [(reloc)] call CORINFO_HELP_RUNTIMEHANDLE_CLASS mov r11, rax G_M45156_IG03: mov rcx, rsi mov rax, qword ptr [r11] cmp dword ptr [rcx], ecx G_M45156_IG04: add rsp, 48 pop rsi rex.jmp rax ; ** After ** ; Devirtualized interface call to System.Collections.Generic.IEnumerable`1[__Canon]:GetEnumerator; ; now direct call to System.Collections.Concurrent.ConcurrentStack`1[__Canon][System.__Canon]:GetEnumerator [final method] ; ; Total bytes of code 38 G_M45158_IG01: push rsi sub rsp, 16 mov qword ptr [rsp+08H], rcx mov rsi, rcx G_M45158_IG02: mov rdx, qword ptr [rsi] mov rdx, gword ptr [rsi+8] mov rcx, rsi lea rax, [(reloc)] G_M45158_IG03: add rsp, 16 pop rsi rex.jmp rax
Windows debug failure was a timeout in tailcall_v4_hijacking.
Windows release failures don't repro locally. Only one of the cases does any interface call devirtualization, and it looks to be correct.
Hate to do this but I am going to retry....