Update code in AwaitUnsafeOnCompleted to use interface matching
authorAndy Ayers <andya@microsoft.com>
Tue, 24 Oct 2017 21:39:29 +0000 (14:39 -0700)
committerAndy Ayers <andya@microsoft.com>
Mon, 30 Oct 2017 21:36:24 +0000 (14:36 -0700)
commit868692d7f48d1266d0bc187ec61baebce4d938fd
tree3ec287d774fd56cf0645a06ad5ebb0f30af43397
parent215ee89756e612bcdd7e9bd61ea500eacaf4973f
Update code in AwaitUnsafeOnCompleted to use interface matching

Given that the jit can now avoid boxing on some interface calls to value types,
generalize the patterns introduced in AwaitUnsafeOnCompleted in #14718 by
using interfaces instead of checking for specific types.

Also move the catch-all processing back in line as the jit can now fold the
interface tests early and not pull in the EH portion of the method unless it is
needed.
src/mscorlib/shared/System/Runtime/CompilerServices/ConfiguredValueTaskAwaitable.cs
src/mscorlib/shared/System/Runtime/CompilerServices/ValueTaskAwaiter.cs
src/mscorlib/src/System/Runtime/CompilerServices/AsyncMethodBuilder.cs
src/mscorlib/src/System/Runtime/CompilerServices/TaskAwaiter.cs