Skip to content

Instantly share code, notes, and snippets.

@atifaziz
Last active August 15, 2020 11:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save atifaziz/b1fcf40a266ae9fecff0b33a77c5e06b to your computer and use it in GitHub Desktop.
Save atifaziz/b1fcf40a266ae9fecff0b33a77c5e06b to your computer and use it in GitHub Desktop.
using System;
public class C {
public void M((bool, object) x) {
if (x is (true, {} obj)) {
Console.WriteLine(obj);
}
}
public void N(bool f, object obj) {
if (f) {
Console.WriteLine(obj);
}
}
}
; Core CLR v4.700.20.26901 on amd64
C..ctor()
L0000: ret
C.M(System.ValueTuple`2<Boolean,System.Object>)
L0000: cmp byte ptr [rdx+8], 0
L0004: je short L001b
L0006: mov rcx, [rdx]
L0009: test rcx, rcx
L000c: je short L001b
L000e: mov rax, System.Console.WriteLine(System.Object)
L0018: jmp rax
L001b: ret
C.N(Boolean, System.Object)
L0000: test dl, dl
L0002: je short L0014
L0004: mov rcx, r8
L0007: mov rax, System.Console.WriteLine(System.Object)
L0011: jmp rax
L0014: ret
{
"version": 1,
"target": "JIT ASM",
"mode": "Release",
"branch": "core-x64"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment