static void Foo(object o)
{
if (o == null)
throw new ArgumentNullException();
// other code
}
; Method Prog:Foo(System.Object)
G_M6323_IG01:
push rbp
sub rsp, 48
lea rbp, [rsp+30H]
xor eax, eax
mov qword ptr [rbp-08H], rax
mov gword ptr [rbp+10H], rcx
cmp gword ptr [rbp+10H], 0
jne SHORT G_M6323_IG04
G_M6323_IG03:
inc dword ptr [(reloc)] ;;; <------------
mov rcx, 0xD1FFAB1E
call CORINFO_HELP_NEWSFAST
mov gword ptr [rbp-08H], rax
mov rcx, gword ptr [rbp-08H]
call [System.ArgumentNullException:.ctor():this]
mov rcx, gword ptr [rbp-08H]
call CORINFO_HELP_THROW
G_M6323_IG04:
inc dword ptr [(reloc)] ;;; <------------
...
Currently, we emit 2 edge counters for such patterns. If we assume that throw new is always cold we can skip the other edge too and then re-construct missing weights from other blocks
cc @AndyAyersMS the idea we discussed last week
If the throw new is actually hot then 🤷♂️ presumably savings/bad decisions from PGO will be not noticeable compared to EH
Currently, we emit 2 edge counters for such patterns. If we assume that
throw newis always cold we can skip the other edge too and then re-construct missing weights from other blockscc @AndyAyersMS the idea we discussed last week
If the
throw newis actually hot then 🤷♂️ presumably savings/bad decisions from PGO will be not noticeable compared to EH