Skip to content

JIT: Support FIELD_LIST stack args on more platforms #88086

@jakobbotsch

Description

@jakobbotsch

For example:

static void Main()
{
    Test(null, null, null, null, null, true);
}

[MethodImpl(MethodImplOptions.NoInlining)]
private static void Test(object a, object b, object c, object d, object e, bool? stack) { }

Produces on win-x64:

;  V00 OutArgs      [V00    ] (  1,  1   )  struct (48) [rsp+00H]   do-not-enreg[XS] addr-exposed "OutgoingArgSpace"
;* V01 tmp1         [V01    ] (  0,  0   )  struct ( 8) zero-ref    ld-addr-op "NewObj constructor temp"
;* V02 tmp2         [V02,T01] (  0,  0   )    bool  ->  zero-ref    "field V01.hasValue (fldOffset=0x0)" P-INDEP
;* V03 tmp3         [V03,T02] (  0,  0   )    bool  ->  zero-ref    "field V01.value (fldOffset=0x1)" P-INDEP
;  V04 tmp4         [V04,T00] (  3,  6   )  struct ( 8) [rsp+30H]   do-not-enreg[SF] "by-value struct argument"
;
; Lcl frame size = 56

G_M27646_IG01:  ;; offset=0000H
       sub      rsp, 56
						;; size=4 bbWeight=1 PerfScore 0.25
G_M27646_IG02:  ;; offset=0004H
       xor      rcx, rcx
       mov      gword ptr [rsp+20H], rcx
       mov      byte  ptr [rsp+30H], 1
       mov      byte  ptr [rsp+31H], 1
       movzx    rcx, word  ptr [rsp+30H]
       mov      dword ptr [rsp+28H], ecx
       xor      rcx, rcx
       xor      rdx, rdx
       xor      r8, r8
       xor      r9, r9
       call     [Program:Test(System.Object,System.Object,System.Object,System.Object,System.Object,System.Nullable`1[bool])]

But we should be able to produce:

-       mov      byte  ptr [rsp+28H], 1
-       mov      byte  ptr [rsp+31H], 1
+       mov      byte  ptr [rsp+28H], 1
+       mov      byte  ptr [rsp+29H], 1
-       movzx    rcx, word  ptr [rsp+30H]
-       mov      dword ptr [rsp+28H], ecx
        xor      rcx, rcx
        xor      rdx, rdx
        xor      r8, r8
        xor      r9, r9
        call     [Program:Test(System.Object,System.Object,System.Object,System.Object,System.Object,System.Nullable`1[bool])]

Metadata

Metadata

Assignees

Labels

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

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions