Skip to content

Instantly share code, notes, and snippets.

@svick
Created July 9, 2017 14:05
Show Gist options
  • Select an option

  • Save svick/42e825f134a9024a481f1bb42ba6c493 to your computer and use it in GitHub Desktop.

Select an option

Save svick/42e825f134a9024a481f1bb42ba6c493 to your computer and use it in GitHub Desktop.
; Assembly listing for method jitdumpapp.Program:Today(ref):ref
; Emitting BLENDED_CODE for X64 CPU with SSE2
; optimized code
; rsp based frame
; partially interruptible
; Final local variable assignments
;
; V00 arg0 [V00,T00] ( 6, 6 ) ref -> rcx class-hnd
; V01 loc0 [V01,T01] ( 3, 3 ) ref -> rax ld-addr-op class-hnd
;* V02 loc1 [V02 ] ( 0, 0 ) ref -> zero-ref ld-addr-op class-hnd
;# V03 OutArgs [V03 ] ( 1, 1 ) lclBlk ( 0) [rsp+0x00]
;
; Lcl frame size = 0
G_M2442_IG01:
G_M2442_IG02:
8B01 mov eax, dword ptr [rcx]
488B4108 mov rax, gword ptr [rcx+8]
G_M2442_IG03:
C3 ret
; Total bytes of code 7, prolog size 0 for method jitdumpapp.Program:Today(ref):ref
; ============================================================
; Assembly listing for method jitdumpapp.Program:Tomorrow(ref):ref
; Emitting BLENDED_CODE for X64 CPU with SSE2
; optimized code
; rsp based frame
; partially interruptible
; Final local variable assignments
;
; V00 arg0 [V00,T00] ( 3, 3 ) ref -> rcx class-hnd
;# V01 OutArgs [V01 ] ( 1, 1 ) lclBlk ( 0) [rsp+0x00]
;
; Lcl frame size = 0
G_M38658_IG01:
G_M38658_IG02:
488B4108 mov rax, gword ptr [rcx+8]
G_M38658_IG03:
C3 ret
; Total bytes of code 5, prolog size 0 for method jitdumpapp.Program:Tomorrow(ref):ref
; ============================================================
using System;
using System.Runtime.CompilerServices;
class Program
{
static void Main()
{
var c = new C();
Today(c);
Tomorrow(c);
}
[MethodImpl(MethodImplOptions.NoInlining)]
static string Today(C e)
{
var (x, _) = e;
return x;
}
[MethodImpl(MethodImplOptions.NoInlining)]
static string Tomorrow(C e)
{
var x = e.Foo;
return x;
}
}
class C
{
public string Foo { get; }
public string Bar { get; }
public void Deconstruct(out string foo, out string bar)
{
foo = this.Foo;
bar = this.Bar;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment