; ForEachBenchmarks.Array()
; var sum = 0;
; ^^^^^^^^^^^^
xor eax,eax
; foreach (var item in array!)
; ^^^^^^
mov rdx,[rcx+8]
xor ecx,ecx
mov r8d,[rdx+8]
test r8d,r8d
jle short M00_L01
nop dword ptr [rax]
nop dword ptr [rax+rax]
M00_L00:
movsxd r9,ecx
mov r9d,[rdx+r9*4+10]
; sum += item;
; ^^^^^^^^^^^^
add eax,r9d
inc ecx
cmp r8d,ecx
jg short M00_L00
M00_L01:
ret
; Total bytes of code 51
; ForEachBenchmarks.Array_AsSpan()
; var sum = 0;
; ^^^^^^^^^^^^
xor eax,eax
; foreach (var item in array!.AsSpan())
; ^^^^^^^^^^^^^^^
mov rdx,[rcx+8]
test rdx,rdx
jne short M00_L00
xor ecx,ecx
xor r8d,r8d
jmp short M00_L01
M00_L00:
lea rcx,[rdx+10]
mov r8d,[rdx+8]
M00_L01:
xor edx,edx
test r8d,r8d
jle short M00_L03
M00_L02:
movsxd r9,edx
mov r9d,[rcx+r9*4]
; sum += item;
; ^^^^^^^^^^^^
add eax,r9d
inc edx
cmp edx,r8d
jl short M00_L02
M00_L03:
ret
; Total bytes of code 51
; ForEachBenchmarks.List()
sub rsp,28
; var sum = 0;
; ^^^^^^^^^^^^
xor eax,eax
; foreach (var item in list!)
; ^^^^^
mov rdx,[rcx+10]
mov ecx,[rdx+14]
mov r8d,ecx
xor r9d,r9d
jmp short M00_L01
; sum += item;
; ^^^^^^^^^^^^
M00_L00:
add eax,r10d
M00_L01:
cmp r8d,ecx
jne short M00_L04
cmp r9d,[rdx+10]
jae short M00_L02
mov r10,[rdx+8]
cmp r9d,[r10+8]
jae short M00_L05
movsxd r11,r9d
mov r10d,[r10+r11*4+10]
inc r9d
mov r11d,1
jmp short M00_L03
M00_L02:
mov r9d,[rdx+10]
inc r9d
xor r10d,r10d
xor r11d,r11d
M00_L03:
test r11d,r11d
jne short M00_L00
add rsp,28
ret
M00_L04:
call System.ThrowHelper.ThrowInvalidOperationException_InvalidOperation_EnumFailedVersion()
int 3
M00_L05:
call CORINFO_HELP_RNGCHKFAIL
int 3
; Total bytes of code 99
Method was not JITted yet. System.ThrowHelper.ThrowInvalidOperationException_InvalidOperation_EnumFailedVersion()
; ForEachBenchmarks.List_AsSpan()
sub rsp,28
; var sum = 0;
; ^^^^^^^^^^^^
xor eax,eax
; foreach (var item in CollectionsMarshal.AsSpan(list!))
; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
mov rdx,[rcx+10]
test rdx,rdx
je short M00_L02
mov rcx,[rdx+8]
mov edx,[rdx+10]
test rcx,rcx
jne short M00_L00
test edx,edx
jne short M00_L06
xor r8d,r8d
xor edx,edx
jmp short M00_L01
M00_L00:
mov r8d,[rcx+8]
mov r9d,edx
cmp r8,r9
jb short M00_L06
add rcx,10
mov r8,rcx
M00_L01:
jmp short M00_L03
M00_L02:
xor r8d,r8d
xor edx,edx
M00_L03:
xor ecx,ecx
test edx,edx
jle short M00_L05
M00_L04:
movsxd r9,ecx
mov r9d,[r8+r9*4]
; sum += item;
; ^^^^^^^^^^^^
add eax,r9d
inc ecx
cmp ecx,edx
jl short M00_L04
M00_L05:
add rsp,28
ret
M00_L06:
call System.ThrowHelper.ThrowArgumentOutOfRangeException()
int 3
; Total bytes of code 97
Method was not JITted yet. System.ThrowHelper.ThrowArgumentOutOfRangeException()
; ForEachBenchmarks.ImmutableArray()
sub rsp,28
; var sum = 0;
; ^^^^^^^^^^^^
xor eax,eax
; foreach (var item in immutableArray!)
; ^^^^^^^^^^^^^^^
add rcx,20
cmp byte ptr [rcx],0
je short M00_L02
mov rdx,[rcx+8]
mov ecx,[rdx+8]
xor r8d,r8d
test ecx,ecx
jle short M00_L01
nop dword ptr [rax]
M00_L00:
movsxd r9,r8d
mov r9d,[rdx+r9*4+10]
; sum += item;
; ^^^^^^^^^^^^
add eax,r9d
inc r8d
cmp ecx,r8d
jg short M00_L00
M00_L01:
add rsp,28
ret
M00_L02:
call System.ThrowHelper.ThrowInvalidOperationException_InvalidOperation_NoValue()
int 3
; Total bytes of code 62
Method was not JITted yet. System.ThrowHelper.ThrowInvalidOperationException_InvalidOperation_NoValue()
; ForEachBenchmarks.Array()
; var sum = 0;
; ^^^^^^^^^^^^
; foreach (var item in array!)
; ^^^^^^
; sum += item;
; ^^^^^^^^^^^^
; return sum;
; ^^^^^^^^^^^
xor eax,eax
mov rdx,[rcx+8]
xor ecx,ecx
mov r8d,[rdx+8]
test r8d,r8d
jle short M00_L01
M00_L00:
mov r9d,ecx
add eax,[rdx+r9*4+10]
inc ecx
cmp r8d,ecx
jg short M00_L00
M00_L01:
ret
; Total bytes of code 33
; ForEachBenchmarks.Array_AsSpan()
; var sum = 0;
; ^^^^^^^^^^^^
; foreach (var item in array!.AsSpan())
; ^^^^^^^^^^^^^^^
; sum += item;
; ^^^^^^^^^^^^
; return sum;
; ^^^^^^^^^^^
xor eax,eax
mov rdx,[rcx+8]
test rdx,rdx
je short M00_L03
lea rcx,[rdx+10]
mov edx,[rdx+8]
M00_L00:
xor r8d,r8d
test edx,edx
jle short M00_L02
nop dword ptr [rax]
M00_L01:
mov r9d,r8d
add eax,[rcx+r9*4]
inc r8d
cmp r8d,edx
jl short M00_L01
M00_L02:
ret
M00_L03:
xor ecx,ecx
xor edx,edx
jmp short M00_L00
; Total bytes of code 54
; ForEachBenchmarks.List()
; var sum = 0;
; ^^^^^^^^^^^^
; foreach (var item in list!)
; ^^^^^
; sum += item;
; ^^^^^^^^^^^^
; return sum;
; ^^^^^^^^^^^
sub rsp,28
xor eax,eax
mov rdx,[rcx+10]
mov ecx,[rdx+14]
xor ecx,ecx
jmp short M00_L01
M00_L00:
add eax,r8d
M00_L01:
mov r8d,[rdx+10]
cmp ecx,r8d
jae short M00_L02
mov r8,[rdx+8]
cmp ecx,[r8+8]
jae short M00_L03
mov r9d,ecx
mov r8d,[r8+r9*4+10]
inc ecx
jmp short M00_L00
M00_L02:
add rsp,28
ret
M00_L03:
call CORINFO_HELP_RNGCHKFAIL
int 3
; Total bytes of code 62
; ForEachBenchmarks.List_AsSpan()
; var sum = 0;
; ^^^^^^^^^^^^
; foreach (var item in CollectionsMarshal.AsSpan(list!))
; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
; sum += item;
; ^^^^^^^^^^^^
; return sum;
; ^^^^^^^^^^^
sub rsp,28
xor eax,eax
mov rdx,[rcx+10]
test rdx,rdx
je short M00_L05
mov rcx,[rdx+8]
mov edx,[rdx+10]
test rcx,rcx
je short M00_L03
cmp [rcx+8],edx
jb short M00_L04
add rcx,10
M00_L00:
xor r8d,r8d
test edx,edx
jle short M00_L02
M00_L01:
mov r9d,r8d
add eax,[rcx+r9*4]
inc r8d
cmp r8d,edx
jl short M00_L01
M00_L02:
add rsp,28
ret
M00_L03:
test edx,edx
jne short M00_L04
xor ecx,ecx
xor edx,edx
jmp short M00_L00
M00_L04:
call qword ptr [7FFF24E04390]
int 3
M00_L05:
xor ecx,ecx
xor edx,edx
jmp short M00_L00
; Total bytes of code 86
; ForEachBenchmarks.ImmutableArray()
; var sum = 0;
; ^^^^^^^^^^^^
; foreach (var item in immutableArray!)
; ^^^^^^^^^^^^^^^
; sum += item;
; ^^^^^^^^^^^^
; return sum;
; ^^^^^^^^^^^
sub rsp,28
xor eax,eax
add rcx,20
cmp byte ptr [rcx],0
je short M00_L02
mov rdx,[rcx+8]
mov ecx,[rdx+8]
xor r8d,r8d
test ecx,ecx
jle short M00_L01
nop dword ptr [rax]
M00_L00:
mov r9d,r8d
add eax,[rdx+r9*4+10]
inc r8d
cmp ecx,r8d
jg short M00_L00
M00_L01:
add rsp,28
ret
M00_L02:
call qword ptr [7FFF24E149D8]
int 3
; Total bytes of code 60