-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Closed
Labels
area-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMICLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI
Milestone
Description
for (int i = 0; i < 100; i++)
{
Test(new ObjImpl<string>());
Thread.Sleep(16);
}
[MethodImpl(MethodImplOptions.NoInlining)]
static object Test(IObj o) => o.GetObj();
public interface IObj
{
object GetObj();
}
public class ObjImpl<T> : IObj
{
public object GetObj() => typeof(T);
}Codegen for Test in Tier1:
; Assembly listing for method Program:<<Main>$>g__Test|0_0(IObj):System.Object (Tier1)
sub rsp, 40
mov rax, 0xD1FFAB1E ; ObjImpl`1[System.String]
cmp qword ptr [rcx], rax
jne SHORT G_M33634_IG06
call [ObjImpl`1[System.__Canon]:GetObj():System.Object:this]
G_M33634_IG04:
nop
add rsp, 40
ret
G_M33634_IG06:
mov r11, 0xD1FFAB1E ; code for IObj:GetObj():System.Object:this
call [r11]IObj:GetObj():System.Object:this
jmp SHORT G_M33634_IG04
; Total bytes of code 46,GDV is applied but the method is not inlined, presumably, the root cause is the same as in #87597 - generic context from the GDV candidate is not kept (but I am not sure, decided to file since I noticed a similiar pattern in real code)
Metadata
Metadata
Assignees
Labels
area-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMICLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI