Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
AbusingCSharp.Benchmarks.ArrayChunkBenchmarks-asm.md

.NET Core 5.0.0 (CoreCLR 5.0.20.45114, CoreFX 5.0.20.45114), X64 RyuJIT

; AbusingCSharp.Benchmarks.ArrayChunkBenchmarks.TestIndexerRef()
       sub       rsp,28
       mov       rax,[rcx+8]
       mov       rax,[rax+8]
       cmp       dword ptr [rax+8],8
       jbe       short M00_L00
       add       rax,30
       add       rsp,28
       ret
M00_L00:
       call      CORINFO_HELP_RNGCHKFAIL
       int       3
; Total bytes of code 33

.NET Core 5.0.0 (CoreCLR 5.0.20.45114, CoreFX 5.0.20.45114), X64 RyuJIT

; AbusingCSharp.Benchmarks.ArrayChunkBenchmarks.TestItemRef()
       sub       rsp,28
       mov       rax,[rcx+8]
       mov       rax,[rax+8]
       cmp       dword ptr [rax+8],0
       jbe       short M00_L00
       add       rax,10
       add       rax,20
       add       rsp,28
       ret
M00_L00:
       call      CORINFO_HELP_RNGCHKFAIL
       int       3
; Total bytes of code 37

.NET Core 5.0.0 (CoreCLR 5.0.20.45114, CoreFX 5.0.20.45114), X64 RyuJIT

; AbusingCSharp.Benchmarks.ArrayChunkBenchmarks.TestItemRef2()
       mov       rcx,[rcx+8]
       mov       edx,8
       cmp       [rcx],ecx
       jmp       near ptr AbusingCSharp.Library.ArrayChunkOfStructs`1[[System.Int32, System.Private.CoreLib]].ItemRef2(Int32)
; Total bytes of code 16
; AbusingCSharp.Library.ArrayChunkOfStructs`1[[System.Int32, System.Private.CoreLib]].ItemRef2(Int32)
       mov       rax,[rcx+8]
       test      rax,rax
       jne       short M01_L00
       xor       ecx,ecx
       jmp       short M01_L01
M01_L00:
       lea       rcx,[rax+10]
       mov       eax,[rax+8]
M01_L01:
       movsxd    rax,edx
       lea       rax,[rcx+rax*4]
       ret
; Total bytes of code 28

.NET Core 5.0.0 (CoreCLR 5.0.20.45114, CoreFX 5.0.20.45114), X64 RyuJIT

; AbusingCSharp.Benchmarks.ArrayChunkBenchmarks.TestItemRef3()
       mov       rax,[rcx+8]
       mov       rax,[rax+8]
       cmp       [rax],eax
       add       rax,10
       add       rax,20
       ret
; Total bytes of code 19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment