Skip to content
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,8 @@ public static partial class AsyncHelpers
// * a continuation object if the call requires suspension.
// In this case the formal result of the call is undefined.
[Intrinsic]
private static Continuation? AsyncCallContinuation() => throw new UnreachableException();
[BypassReadyToRun]
Comment thread
jtschuster marked this conversation as resolved.
Outdated
internal static Continuation? AsyncCallContinuation() => throw new UnreachableException(); // Unconditionally expanded intrinsic

// Used during suspensions to hold the continuation chain and on what we are waiting.
// Methods like FinalizeTaskReturningThunk will unlink the state and wrap into a Task.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,14 @@ protected override int CompareToImpl(MethodDesc other, TypeSystemComparer compar
return comparer.Compare(_targetMethod, ((AsyncResumptionStub)other)._targetMethod);
}
}

internal sealed partial class ExplicitContinuationAsyncMethod : MethodDesc
{
protected override int ClassCode => 0xd076659;

protected override int CompareToImpl(MethodDesc other, TypeSystemComparer comparer)
{
return comparer.Compare(_wrappedMethod, ((ExplicitContinuationAsyncMethod)other)._wrappedMethod);
}
}
}
161 changes: 155 additions & 6 deletions src/coreclr/tools/Common/TypeSystem/IL/Stubs/AsyncResumptionStub.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,13 @@
public partial class AsyncResumptionStub : ILStubMethod
{
private readonly MethodDesc _targetMethod;
private readonly TypeDesc _owningType;

Check failure on line 17 in src/coreclr/tools/Common/TypeSystem/IL/Stubs/AsyncResumptionStub.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux-x64 Debug NativeAOT)

src/coreclr/tools/Common/TypeSystem/IL/Stubs/AsyncResumptionStub.cs#L17

src/coreclr/tools/Common/TypeSystem/IL/Stubs/AsyncResumptionStub.cs(17,35): error CS0649: (NETCORE_ENGINEERING_TELEMETRY=Build) Field 'AsyncResumptionStub._owningType' is never assigned to, and will always have its default value null

Check failure on line 17 in src/coreclr/tools/Common/TypeSystem/IL/Stubs/AsyncResumptionStub.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux-arm64 Release NativeAOT)

src/coreclr/tools/Common/TypeSystem/IL/Stubs/AsyncResumptionStub.cs#L17

src/coreclr/tools/Common/TypeSystem/IL/Stubs/AsyncResumptionStub.cs(17,35): error CS0649: (NETCORE_ENGINEERING_TELEMETRY=Build) Field 'AsyncResumptionStub._owningType' is never assigned to, and will always have its default value null

Check failure on line 17 in src/coreclr/tools/Common/TypeSystem/IL/Stubs/AsyncResumptionStub.cs

View check run for this annotation

Azure Pipelines / runtime-dev-innerloop (Build Source-Build (Linux_x64))

src/coreclr/tools/Common/TypeSystem/IL/Stubs/AsyncResumptionStub.cs#L17

src/coreclr/tools/Common/TypeSystem/IL/Stubs/AsyncResumptionStub.cs(17,35): error CS0649: (NETCORE_ENGINEERING_TELEMETRY=Build) Field 'AsyncResumptionStub._owningType' is never assigned to, and will always have its default value null

Check failure on line 17 in src/coreclr/tools/Common/TypeSystem/IL/Stubs/AsyncResumptionStub.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux-arm64 Release NativeAOT_Libraries)

src/coreclr/tools/Common/TypeSystem/IL/Stubs/AsyncResumptionStub.cs#L17

src/coreclr/tools/Common/TypeSystem/IL/Stubs/AsyncResumptionStub.cs(17,35): error CS0649: (NETCORE_ENGINEERING_TELEMETRY=Build) Field 'AsyncResumptionStub._owningType' is never assigned to, and will always have its default value null

Check failure on line 17 in src/coreclr/tools/Common/TypeSystem/IL/Stubs/AsyncResumptionStub.cs

View check run for this annotation

Azure Pipelines / runtime (Build osx-arm64 Release NativeAOT_Libraries)

src/coreclr/tools/Common/TypeSystem/IL/Stubs/AsyncResumptionStub.cs#L17

src/coreclr/tools/Common/TypeSystem/IL/Stubs/AsyncResumptionStub.cs(17,35): error CS0649: (NETCORE_ENGINEERING_TELEMETRY=Build) Field 'AsyncResumptionStub._owningType' is never assigned to, and will always have its default value null

Check failure on line 17 in src/coreclr/tools/Common/TypeSystem/IL/Stubs/AsyncResumptionStub.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux_musl-arm Debug AllSubsets_CoreCLR_ReleaseRuntimeLibs)

src/coreclr/tools/Common/TypeSystem/IL/Stubs/AsyncResumptionStub.cs#L17

src/coreclr/tools/Common/TypeSystem/IL/Stubs/AsyncResumptionStub.cs(17,35): error CS0649: (NETCORE_ENGINEERING_TELEMETRY=Build) Field 'AsyncResumptionStub._owningType' is never assigned to, and will always have its default value null

Check failure on line 17 in src/coreclr/tools/Common/TypeSystem/IL/Stubs/AsyncResumptionStub.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux-x64 Release NativeAOT)

src/coreclr/tools/Common/TypeSystem/IL/Stubs/AsyncResumptionStub.cs#L17

src/coreclr/tools/Common/TypeSystem/IL/Stubs/AsyncResumptionStub.cs(17,35): error CS0649: (NETCORE_ENGINEERING_TELEMETRY=Build) Field 'AsyncResumptionStub._owningType' is never assigned to, and will always have its default value null

Check failure on line 17 in src/coreclr/tools/Common/TypeSystem/IL/Stubs/AsyncResumptionStub.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux-arm Debug AllSubsets_CoreCLR_ReleaseRuntimeLibs)

src/coreclr/tools/Common/TypeSystem/IL/Stubs/AsyncResumptionStub.cs#L17

src/coreclr/tools/Common/TypeSystem/IL/Stubs/AsyncResumptionStub.cs(17,35): error CS0649: (NETCORE_ENGINEERING_TELEMETRY=Build) Field 'AsyncResumptionStub._owningType' is never assigned to, and will always have its default value null

Check failure on line 17 in src/coreclr/tools/Common/TypeSystem/IL/Stubs/AsyncResumptionStub.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux-x86 checked CoreCLR)

src/coreclr/tools/Common/TypeSystem/IL/Stubs/AsyncResumptionStub.cs#L17

src/coreclr/tools/Common/TypeSystem/IL/Stubs/AsyncResumptionStub.cs(17,35): error CS0649: (NETCORE_ENGINEERING_TELEMETRY=Build) Field 'AsyncResumptionStub._owningType' is never assigned to, and will always have its default value null

Check failure on line 17 in src/coreclr/tools/Common/TypeSystem/IL/Stubs/AsyncResumptionStub.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux-x64 checked CLR_Tools_Tests)

src/coreclr/tools/Common/TypeSystem/IL/Stubs/AsyncResumptionStub.cs#L17

src/coreclr/tools/Common/TypeSystem/IL/Stubs/AsyncResumptionStub.cs(17,35): error CS0649: (NETCORE_ENGINEERING_TELEMETRY=Build) Field 'AsyncResumptionStub._owningType' is never assigned to, and will always have its default value null

Check failure on line 17 in src/coreclr/tools/Common/TypeSystem/IL/Stubs/AsyncResumptionStub.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux_musl-arm checked CoreCLR_ReleaseLibraries)

src/coreclr/tools/Common/TypeSystem/IL/Stubs/AsyncResumptionStub.cs#L17

src/coreclr/tools/Common/TypeSystem/IL/Stubs/AsyncResumptionStub.cs(17,35): error CS0649: (NETCORE_ENGINEERING_TELEMETRY=Build) Field 'AsyncResumptionStub._owningType' is never assigned to, and will always have its default value null

Check failure on line 17 in src/coreclr/tools/Common/TypeSystem/IL/Stubs/AsyncResumptionStub.cs

View check run for this annotation

Azure Pipelines / runtime (Build ios-arm64 Release AllSubsets_NativeAOT)

src/coreclr/tools/Common/TypeSystem/IL/Stubs/AsyncResumptionStub.cs#L17

src/coreclr/tools/Common/TypeSystem/IL/Stubs/AsyncResumptionStub.cs(17,35): error CS0649: (NETCORE_ENGINEERING_TELEMETRY=Build) Field 'AsyncResumptionStub._owningType' is never assigned to, and will always have its default value null

Check failure on line 17 in src/coreclr/tools/Common/TypeSystem/IL/Stubs/AsyncResumptionStub.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux-arm checked CoreCLR_ReleaseLibraries)

src/coreclr/tools/Common/TypeSystem/IL/Stubs/AsyncResumptionStub.cs#L17

src/coreclr/tools/Common/TypeSystem/IL/Stubs/AsyncResumptionStub.cs(17,35): error CS0649: (NETCORE_ENGINEERING_TELEMETRY=Build) Field 'AsyncResumptionStub._owningType' is never assigned to, and will always have its default value null

Check failure on line 17 in src/coreclr/tools/Common/TypeSystem/IL/Stubs/AsyncResumptionStub.cs

View check run for this annotation

Azure Pipelines / runtime (Build osx-x64 Release NativeAOT)

src/coreclr/tools/Common/TypeSystem/IL/Stubs/AsyncResumptionStub.cs#L17

src/coreclr/tools/Common/TypeSystem/IL/Stubs/AsyncResumptionStub.cs(17,35): error CS0649: (NETCORE_ENGINEERING_TELEMETRY=Build) Field 'AsyncResumptionStub._owningType' is never assigned to, and will always have its default value null

Check failure on line 17 in src/coreclr/tools/Common/TypeSystem/IL/Stubs/AsyncResumptionStub.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux-armel checked CoreCLR_NonPortable)

src/coreclr/tools/Common/TypeSystem/IL/Stubs/AsyncResumptionStub.cs#L17

src/coreclr/tools/Common/TypeSystem/IL/Stubs/AsyncResumptionStub.cs(17,35): error CS0649: (NETCORE_ENGINEERING_TELEMETRY=Build) Field 'AsyncResumptionStub._owningType' is never assigned to, and will always have its default value null

Check failure on line 17 in src/coreclr/tools/Common/TypeSystem/IL/Stubs/AsyncResumptionStub.cs

View check run for this annotation

Azure Pipelines / runtime (Build android-arm64 Release AllSubsets_CoreCLR)

src/coreclr/tools/Common/TypeSystem/IL/Stubs/AsyncResumptionStub.cs#L17

src/coreclr/tools/Common/TypeSystem/IL/Stubs/AsyncResumptionStub.cs(17,35): error CS0649: (NETCORE_ENGINEERING_TELEMETRY=Build) Field 'AsyncResumptionStub._owningType' is never assigned to, and will always have its default value null

Check failure on line 17 in src/coreclr/tools/Common/TypeSystem/IL/Stubs/AsyncResumptionStub.cs

View check run for this annotation

Azure Pipelines / runtime (Build android-x64 Release AllSubsets_CoreCLR)

src/coreclr/tools/Common/TypeSystem/IL/Stubs/AsyncResumptionStub.cs#L17

src/coreclr/tools/Common/TypeSystem/IL/Stubs/AsyncResumptionStub.cs(17,35): error CS0649: (NETCORE_ENGINEERING_TELEMETRY=Build) Field 'AsyncResumptionStub._owningType' is never assigned to, and will always have its default value null

Check failure on line 17 in src/coreclr/tools/Common/TypeSystem/IL/Stubs/AsyncResumptionStub.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux-arm64 Debug AllSubsets_CoreCLR)

src/coreclr/tools/Common/TypeSystem/IL/Stubs/AsyncResumptionStub.cs#L17

src/coreclr/tools/Common/TypeSystem/IL/Stubs/AsyncResumptionStub.cs(17,35): error CS0649: (NETCORE_ENGINEERING_TELEMETRY=Build) Field 'AsyncResumptionStub._owningType' is never assigned to, and will always have its default value null

Check failure on line 17 in src/coreclr/tools/Common/TypeSystem/IL/Stubs/AsyncResumptionStub.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux_musl-arm64 Debug AllSubsets_CoreCLR_ReleaseRuntimeLibs)

src/coreclr/tools/Common/TypeSystem/IL/Stubs/AsyncResumptionStub.cs#L17

src/coreclr/tools/Common/TypeSystem/IL/Stubs/AsyncResumptionStub.cs(17,35): error CS0649: (NETCORE_ENGINEERING_TELEMETRY=Build) Field 'AsyncResumptionStub._owningType' is never assigned to, and will always have its default value null

Check failure on line 17 in src/coreclr/tools/Common/TypeSystem/IL/Stubs/AsyncResumptionStub.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux_musl-x64 Debug CoreCLR_Libraries)

src/coreclr/tools/Common/TypeSystem/IL/Stubs/AsyncResumptionStub.cs#L17

src/coreclr/tools/Common/TypeSystem/IL/Stubs/AsyncResumptionStub.cs(17,35): error CS0649: (NETCORE_ENGINEERING_TELEMETRY=Build) Field 'AsyncResumptionStub._owningType' is never assigned to, and will always have its default value null

Check failure on line 17 in src/coreclr/tools/Common/TypeSystem/IL/Stubs/AsyncResumptionStub.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux_musl-x64 Debug AllSubsets_CoreCLR)

src/coreclr/tools/Common/TypeSystem/IL/Stubs/AsyncResumptionStub.cs#L17

src/coreclr/tools/Common/TypeSystem/IL/Stubs/AsyncResumptionStub.cs(17,35): error CS0649: (NETCORE_ENGINEERING_TELEMETRY=Build) Field 'AsyncResumptionStub._owningType' is never assigned to, and will always have its default value null

Check failure on line 17 in src/coreclr/tools/Common/TypeSystem/IL/Stubs/AsyncResumptionStub.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux-x64 Debug CoreCLR_Libraries)

src/coreclr/tools/Common/TypeSystem/IL/Stubs/AsyncResumptionStub.cs#L17

src/coreclr/tools/Common/TypeSystem/IL/Stubs/AsyncResumptionStub.cs(17,35): error CS0649: (NETCORE_ENGINEERING_TELEMETRY=Build) Field 'AsyncResumptionStub._owningType' is never assigned to, and will always have its default value null

Check failure on line 17 in src/coreclr/tools/Common/TypeSystem/IL/Stubs/AsyncResumptionStub.cs

View check run for this annotation

Azure Pipelines / dotnet-linker-tests (Build linux-x64 release Runtime_Release)

src/coreclr/tools/Common/TypeSystem/IL/Stubs/AsyncResumptionStub.cs#L17

src/coreclr/tools/Common/TypeSystem/IL/Stubs/AsyncResumptionStub.cs(17,35): error CS0649: (NETCORE_ENGINEERING_TELEMETRY=Build) Field 'AsyncResumptionStub._owningType' is never assigned to, and will always have its default value null

Check failure on line 17 in src/coreclr/tools/Common/TypeSystem/IL/Stubs/AsyncResumptionStub.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux-arm64 Debug Libraries_CheckedCoreCLR)

src/coreclr/tools/Common/TypeSystem/IL/Stubs/AsyncResumptionStub.cs#L17

src/coreclr/tools/Common/TypeSystem/IL/Stubs/AsyncResumptionStub.cs(17,35): error CS0649: (NETCORE_ENGINEERING_TELEMETRY=Build) Field 'AsyncResumptionStub._owningType' is never assigned to, and will always have its default value null

Check failure on line 17 in src/coreclr/tools/Common/TypeSystem/IL/Stubs/AsyncResumptionStub.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux_musl-arm64 checked CoreCLR_ReleaseLibraries)

src/coreclr/tools/Common/TypeSystem/IL/Stubs/AsyncResumptionStub.cs#L17

src/coreclr/tools/Common/TypeSystem/IL/Stubs/AsyncResumptionStub.cs(17,35): error CS0649: (NETCORE_ENGINEERING_TELEMETRY=Build) Field 'AsyncResumptionStub._owningType' is never assigned to, and will always have its default value null

Check failure on line 17 in src/coreclr/tools/Common/TypeSystem/IL/Stubs/AsyncResumptionStub.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux-x64 checked CoreCLR_ReleaseLibraries)

src/coreclr/tools/Common/TypeSystem/IL/Stubs/AsyncResumptionStub.cs#L17

src/coreclr/tools/Common/TypeSystem/IL/Stubs/AsyncResumptionStub.cs(17,35): error CS0649: (NETCORE_ENGINEERING_TELEMETRY=Build) Field 'AsyncResumptionStub._owningType' is never assigned to, and will always have its default value null

Check failure on line 17 in src/coreclr/tools/Common/TypeSystem/IL/Stubs/AsyncResumptionStub.cs

View check run for this annotation

Azure Pipelines / runtime (Build browser-wasm linux Debug AllSubsets_CoreCLR)

src/coreclr/tools/Common/TypeSystem/IL/Stubs/AsyncResumptionStub.cs#L17

src/coreclr/tools/Common/TypeSystem/IL/Stubs/AsyncResumptionStub.cs(17,35): error CS0649: (NETCORE_ENGINEERING_TELEMETRY=Build) Field 'AsyncResumptionStub._owningType' is never assigned to, and will always have its default value null

Check failure on line 17 in src/coreclr/tools/Common/TypeSystem/IL/Stubs/AsyncResumptionStub.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux-x64 Debug Libraries_CheckedCoreCLR)

src/coreclr/tools/Common/TypeSystem/IL/Stubs/AsyncResumptionStub.cs#L17

src/coreclr/tools/Common/TypeSystem/IL/Stubs/AsyncResumptionStub.cs(17,35): error CS0649: (NETCORE_ENGINEERING_TELEMETRY=Build) Field 'AsyncResumptionStub._owningType' is never assigned to, and will always have its default value null

Check failure on line 17 in src/coreclr/tools/Common/TypeSystem/IL/Stubs/AsyncResumptionStub.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux_musl-x64 Debug Libraries_CheckedCoreCLR)

src/coreclr/tools/Common/TypeSystem/IL/Stubs/AsyncResumptionStub.cs#L17

src/coreclr/tools/Common/TypeSystem/IL/Stubs/AsyncResumptionStub.cs(17,35): error CS0649: (NETCORE_ENGINEERING_TELEMETRY=Build) Field 'AsyncResumptionStub._owningType' is never assigned to, and will always have its default value null

Check failure on line 17 in src/coreclr/tools/Common/TypeSystem/IL/Stubs/AsyncResumptionStub.cs

View check run for this annotation

Azure Pipelines / runtime (Build osx-x64 Debug CoreCLR_Libraries)

src/coreclr/tools/Common/TypeSystem/IL/Stubs/AsyncResumptionStub.cs#L17

src/coreclr/tools/Common/TypeSystem/IL/Stubs/AsyncResumptionStub.cs(17,35): error CS0649: (NETCORE_ENGINEERING_TELEMETRY=Build) Field 'AsyncResumptionStub._owningType' is never assigned to, and will always have its default value null

Check failure on line 17 in src/coreclr/tools/Common/TypeSystem/IL/Stubs/AsyncResumptionStub.cs

View check run for this annotation

Azure Pipelines / runtime-dev-innerloop

src/coreclr/tools/Common/TypeSystem/IL/Stubs/AsyncResumptionStub.cs#L17

src/coreclr/tools/Common/TypeSystem/IL/Stubs/AsyncResumptionStub.cs(17,35): error CS0649: (NETCORE_ENGINEERING_TELEMETRY=Build) Field 'AsyncResumptionStub._owningType' is never assigned to, and will always have its default value null

Check failure on line 17 in src/coreclr/tools/Common/TypeSystem/IL/Stubs/AsyncResumptionStub.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux-riscv64 Debug CoreCLR_Bootstrapped)

src/coreclr/tools/Common/TypeSystem/IL/Stubs/AsyncResumptionStub.cs#L17

src/coreclr/tools/Common/TypeSystem/IL/Stubs/AsyncResumptionStub.cs(17,35): error CS0649: (NETCORE_ENGINEERING_TELEMETRY=Build) Field 'AsyncResumptionStub._owningType' is never assigned to, and will always have its default value null

Check failure on line 17 in src/coreclr/tools/Common/TypeSystem/IL/Stubs/AsyncResumptionStub.cs

View check run for this annotation

Azure Pipelines / runtime (Build tvos-arm64 Release AllSubsets_NativeAOT)

src/coreclr/tools/Common/TypeSystem/IL/Stubs/AsyncResumptionStub.cs#L17

src/coreclr/tools/Common/TypeSystem/IL/Stubs/AsyncResumptionStub.cs(17,35): error CS0649: (NETCORE_ENGINEERING_TELEMETRY=Build) Field 'AsyncResumptionStub._owningType' is never assigned to, and will always have its default value null

Check failure on line 17 in src/coreclr/tools/Common/TypeSystem/IL/Stubs/AsyncResumptionStub.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux-loongarch64 Debug CoreCLR_Bootstrapped)

src/coreclr/tools/Common/TypeSystem/IL/Stubs/AsyncResumptionStub.cs#L17

src/coreclr/tools/Common/TypeSystem/IL/Stubs/AsyncResumptionStub.cs(17,35): error CS0649: (NETCORE_ENGINEERING_TELEMETRY=Build) Field 'AsyncResumptionStub._owningType' is never assigned to, and will always have its default value null

Check failure on line 17 in src/coreclr/tools/Common/TypeSystem/IL/Stubs/AsyncResumptionStub.cs

View check run for this annotation

Azure Pipelines / runtime (Build osx-x64 Debug Libraries_CheckedCoreCLR)

src/coreclr/tools/Common/TypeSystem/IL/Stubs/AsyncResumptionStub.cs#L17

src/coreclr/tools/Common/TypeSystem/IL/Stubs/AsyncResumptionStub.cs(17,35): error CS0649: (NETCORE_ENGINEERING_TELEMETRY=Build) Field 'AsyncResumptionStub._owningType' is never assigned to, and will always have its default value null

Check failure on line 17 in src/coreclr/tools/Common/TypeSystem/IL/Stubs/AsyncResumptionStub.cs

View check run for this annotation

Azure Pipelines / dotnet-linker-tests (Build osx-x64 release Runtime_Release)

src/coreclr/tools/Common/TypeSystem/IL/Stubs/AsyncResumptionStub.cs#L17

src/coreclr/tools/Common/TypeSystem/IL/Stubs/AsyncResumptionStub.cs(17,35): error CS0649: (NETCORE_ENGINEERING_TELEMETRY=Build) Field 'AsyncResumptionStub._owningType' is never assigned to, and will always have its default value null

Check failure on line 17 in src/coreclr/tools/Common/TypeSystem/IL/Stubs/AsyncResumptionStub.cs

View check run for this annotation

Azure Pipelines / dotnet-linker-tests

src/coreclr/tools/Common/TypeSystem/IL/Stubs/AsyncResumptionStub.cs#L17

src/coreclr/tools/Common/TypeSystem/IL/Stubs/AsyncResumptionStub.cs(17,35): error CS0649: (NETCORE_ENGINEERING_TELEMETRY=Build) Field 'AsyncResumptionStub._owningType' is never assigned to, and will always have its default value null

Check failure on line 17 in src/coreclr/tools/Common/TypeSystem/IL/Stubs/AsyncResumptionStub.cs

View check run for this annotation

Azure Pipelines / dotnet-linker-tests

src/coreclr/tools/Common/TypeSystem/IL/Stubs/AsyncResumptionStub.cs#L17

src/coreclr/tools/Common/TypeSystem/IL/Stubs/AsyncResumptionStub.cs(17,35): error CS0649: (NETCORE_ENGINEERING_TELEMETRY=Build) Field 'AsyncResumptionStub._owningType' is never assigned to, and will always have its default value null

Check failure on line 17 in src/coreclr/tools/Common/TypeSystem/IL/Stubs/AsyncResumptionStub.cs

View check run for this annotation

Azure Pipelines / runtime (Build ios-arm64 Release AllSubsets_CoreCLR)

src/coreclr/tools/Common/TypeSystem/IL/Stubs/AsyncResumptionStub.cs#L17

src/coreclr/tools/Common/TypeSystem/IL/Stubs/AsyncResumptionStub.cs(17,35): error CS0649: (NETCORE_ENGINEERING_TELEMETRY=Build) Field 'AsyncResumptionStub._owningType' is never assigned to, and will always have its default value null

Check failure on line 17 in src/coreclr/tools/Common/TypeSystem/IL/Stubs/AsyncResumptionStub.cs

View check run for this annotation

Azure Pipelines / runtime (Build freebsd-x64 Debug CoreCLR_Bootstrapped)

src/coreclr/tools/Common/TypeSystem/IL/Stubs/AsyncResumptionStub.cs#L17

src/coreclr/tools/Common/TypeSystem/IL/Stubs/AsyncResumptionStub.cs(17,35): error CS0649: (NETCORE_ENGINEERING_TELEMETRY=Build) Field 'AsyncResumptionStub._owningType' is never assigned to, and will always have its default value null

Check failure on line 17 in src/coreclr/tools/Common/TypeSystem/IL/Stubs/AsyncResumptionStub.cs

View check run for this annotation

Azure Pipelines / runtime (Build osx-arm64 release CoreCLR_Libraries)

src/coreclr/tools/Common/TypeSystem/IL/Stubs/AsyncResumptionStub.cs#L17

src/coreclr/tools/Common/TypeSystem/IL/Stubs/AsyncResumptionStub.cs(17,35): error CS0649: (NETCORE_ENGINEERING_TELEMETRY=Build) Field 'AsyncResumptionStub._owningType' is never assigned to, and will always have its default value null

Check failure on line 17 in src/coreclr/tools/Common/TypeSystem/IL/Stubs/AsyncResumptionStub.cs

View check run for this annotation

Azure Pipelines / runtime

src/coreclr/tools/Common/TypeSystem/IL/Stubs/AsyncResumptionStub.cs#L17

src/coreclr/tools/Common/TypeSystem/IL/Stubs/AsyncResumptionStub.cs(17,35): error CS0649: (NETCORE_ENGINEERING_TELEMETRY=Build) Field 'AsyncResumptionStub._owningType' is never assigned to, and will always have its default value null

Check failure on line 17 in src/coreclr/tools/Common/TypeSystem/IL/Stubs/AsyncResumptionStub.cs

View check run for this annotation

Azure Pipelines / runtime

src/coreclr/tools/Common/TypeSystem/IL/Stubs/AsyncResumptionStub.cs#L17

src/coreclr/tools/Common/TypeSystem/IL/Stubs/AsyncResumptionStub.cs(17,35): error CS0649: (NETCORE_ENGINEERING_TELEMETRY=Build) Field 'AsyncResumptionStub._owningType' is never assigned to, and will always have its default value null

Check failure on line 17 in src/coreclr/tools/Common/TypeSystem/IL/Stubs/AsyncResumptionStub.cs

View check run for this annotation

Azure Pipelines / runtime

src/coreclr/tools/Common/TypeSystem/IL/Stubs/AsyncResumptionStub.cs#L17

src/coreclr/tools/Common/TypeSystem/IL/Stubs/AsyncResumptionStub.cs(17,35): error CS0649: (NETCORE_ENGINEERING_TELEMETRY=Build) Field 'AsyncResumptionStub._owningType' is never assigned to, and will always have its default value null
private MethodSignature _signature;

public AsyncResumptionStub(MethodDesc targetMethod, TypeDesc owningType)
{
Debug.Assert(targetMethod.IsAsyncCall());
_targetMethod = targetMethod;
_owningType = owningType;
}

public override ReadOnlySpan<byte> Name => _targetMethod.Name;
Expand All @@ -42,13 +41,163 @@

public override MethodIL EmitIL()
{
var emitter = new ILEmitter();
ILCodeStream codeStream = emitter.NewCodeStream();
ILEmitter ilEmitter = new ILEmitter();
ILCodeStream ilStream = ilEmitter.NewCodeStream();

// TODO: match getAsyncResumptionStub from CoreCLR VM
codeStream.EmitCallThrowHelper(emitter, Context.GetHelperEntryPoint("ThrowHelpers"u8, "ThrowNotSupportedException"u8));
// Ported from jitinterface.cpp CEEJitInfo::getAsyncResumptionStub
if (!_targetMethod.Signature.IsStatic)
{
if (_targetMethod.OwningType.IsValueType)
{
ilStream.EmitLdc(0);
ilStream.Emit(ILOpcode.conv_u);
}
else
{
ilStream.Emit(ILOpcode.ldnull);
}
}

return emitter.Link(this);
if (Context.Target.Architecture != TargetArchitecture.X86)
{
ilStream.EmitLdArg(0);
Comment thread
jtschuster marked this conversation as resolved.
}

foreach (var param in _targetMethod.Signature)
{
var local = ilEmitter.NewLocal(param);
ilStream.EmitLdLoca(local);
ilStream.Emit(ILOpcode.initobj, ilEmitter.NewToken(param));
ilStream.EmitLdLoc(local);
}

if (Context.Target.Architecture == TargetArchitecture.X86)
{
ilStream.EmitLdArg(0);
Comment thread
jtschuster marked this conversation as resolved.
}

MethodDesc resumingMethod = new ExplicitContinuationAsyncMethod(_targetMethod);
ilStream.Emit(ILOpcode.call, ilEmitter.NewToken(resumingMethod));

bool returnsVoid = resumingMethod.Signature.ReturnType.IsWellKnownType(WellKnownType.Void);
Comment thread
jtschuster marked this conversation as resolved.
Outdated
Internal.IL.Stubs.ILLocalVariable resultLocal = default;
Comment thread
MichalStrehovsky marked this conversation as resolved.
Outdated
if (!returnsVoid)
{
resultLocal = ilEmitter.NewLocal(resumingMethod.Signature.ReturnType);
ilStream.EmitStLoc(resultLocal);
}

MethodDesc asyncCallContinuation = Context.SystemModule.GetKnownType("System.Runtime.CompilerServices"u8, "AsyncHelpers"u8)
.GetKnownMethod("AsyncCallContinuation"u8, null);
Comment thread
jkotas marked this conversation as resolved.
TypeDesc continuation = Context.SystemModule.GetKnownType("System.Runtime.CompilerServices"u8, "Continuation"u8);
var newContinuationLocal = ilEmitter.NewLocal(continuation);
ilStream.Emit(ILOpcode.call, ilEmitter.NewToken(asyncCallContinuation));
ilStream.EmitStLoc(newContinuationLocal);

if (!returnsVoid)
{
var doneResult = ilEmitter.NewCodeLabel();
ilStream.EmitLdLoc(newContinuationLocal);
ilStream.Emit(ILOpcode.brtrue, doneResult);
ilStream.EmitLdArg(1);
ilStream.EmitLdLoc(resultLocal);
ilStream.Emit(ILOpcode.stobj, ilEmitter.NewToken(resumingMethod.Signature.ReturnType));
ilStream.EmitLabel(doneResult);
}
ilStream.EmitLdLoc(newContinuationLocal);
ilStream.Emit(ILOpcode.ret);

return ilEmitter.Link(this);
}
}

internal sealed partial class ExplicitContinuationAsyncMethod : MethodDesc

Copilot AI Nov 18, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The ExplicitContinuationAsyncMethod class lacks a mangling partial class file. Based on the codebase pattern (AsyncResumptionStub, AsyncMethodVariant, etc.), internal call methods that can be referenced should implement IPrefixMangledMethod. Consider adding an AsyncResumptionStub.Mangling.cs partial class for ExplicitContinuationAsyncMethod to provide proper name mangling support.

Copilot uses AI. Check for mistakes.
{
private MethodSignature _signature;
private MethodDesc _wrappedMethod;

public ExplicitContinuationAsyncMethod(MethodDesc target)
{
_wrappedMethod = target;
}

public MethodDesc Target => _wrappedMethod;

private MethodSignature InitializeSignature()
{
var _methodRepresented = _wrappedMethod;
Comment thread
jtschuster marked this conversation as resolved.
Outdated

// Async methods have an implicit Continuation parameter
// The order of parameters depends on the architecture
// non-x86: this?, genericCtx?, continuation, params...
// x86: this?, params, continuation, genericCtx?
// To make the jit pass arguments in this order, we can add the continuation parameter
// at the end for x86 and at the beginning for other architectures.
// The 'this' parameter and generic context parameter (if any) can be handled by the jit.

var signature = new MethodSignatureBuilder(_wrappedMethod.Signature)
Comment thread
jtschuster marked this conversation as resolved.
Outdated
{
Length = _wrappedMethod.Signature.Length + 1,
};

TypeDesc continuation = Context.SystemModule.GetKnownType("System.Runtime.CompilerServices"u8, "Continuation"u8);
if (Context.Target.Architecture == TargetArchitecture.X86)
{
for (int i = 0; i < _methodRepresented.Signature.Length; i++)
signature[i] = _methodRepresented.Signature[i];
signature[_methodRepresented.Signature.Length] = continuation;
}
else
{
signature[0] = continuation;
for (int i = 0; i < _methodRepresented.Signature.Length; i++)
signature[i + 1] = _methodRepresented.Signature[i];
}
// Get the return type from the Task-returning variant
if (_wrappedMethod is AsyncMethodVariant variant
&& variant.Target.Signature.ReturnType is {HasInstantiation: true } returnType)
{
signature.ReturnType = returnType.Instantiation[0];
}
else
{
signature.ReturnType = Context.GetWellKnownType(WellKnownType.Void);
}
Comment thread
jtschuster marked this conversation as resolved.

return _signature = signature.ToSignature();
}

public override bool HasCustomAttribute(string attributeNamespace, string attributeName) => throw new NotImplementedException();

public override MethodSignature Signature
{
get
{
if (_signature is null)
return InitializeSignature();

return _signature;
Comment on lines +220 to +223

Copilot AI Nov 18, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Signature property should follow the null-coalescing pattern like other properties in the codebase. Use return _signature ??= InitializeSignature(); instead of explicit null check and separate assignment.

Suggested change
if (_signature is null)
return InitializeSignature();
return _signature;
return _signature ??= InitializeSignature();

Copilot uses AI. Check for mistakes.
}
}
Comment thread
jtschuster marked this conversation as resolved.

public override string DiagnosticName => $"ExplicitContinuationAsyncMethod({_wrappedMethod.DiagnosticName})";

public override TypeDesc OwningType => _wrappedMethod.OwningType;

public override TypeSystemContext Context => _wrappedMethod.Context;

public override bool IsInternalCall => true;
}

public static class AsyncResumptionStubExtensions
{
public static bool IsExplicitContinuationAsyncMethod(this MethodDesc method)
{
return method is ExplicitContinuationAsyncMethod;
}
public static MethodDesc GetExplicitContinuationAsyncMethodTarget(this MethodDesc method)
{
return ((ExplicitContinuationAsyncMethod)method).Target;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ protected override IMethodNode CreateMethodEntrypointNode(MethodDesc method)
{
return MethodEntrypoint(TypeSystemContext.GetRealDefaultInterfaceMethodImplementationThunkTargetMethod(method));
}
else if (method.IsExplicitContinuationAsyncMethod())
{
return MethodEntrypoint(method.GetExplicitContinuationAsyncMethodTarget());
}
else if (method.IsArrayAddressMethod())
{
return new ScannedMethodNode(((ArrayType)method.OwningType).GetArrayMethod(ArrayMethodKind.AddressWithHiddenArg));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@
<Compile Include="..\..\Common\System\FormattingHelpers.cs" Link="Common\FormattingHelpers.cs" />
<Compile Include="..\..\Common\TypeSystem\IL\ILProvider.cs" Link="IL\ILProvider.cs" />
<Compile Include="..\..\Common\TypeSystem\IL\ILReader.cs" Link="IL\ILReader.cs" />
<Compile Include="..\..\Common\TypeSystem\IL\Stubs\AsyncResumptionStub.cs" Link="IL\Stubs\AsyncResumptionStub.cs" />
<Compile Include="..\..\Common\TypeSystem\IL\Stubs\AsyncResumptionStub.Sorting.cs" Link="IL\Stubs\AsyncResumptionStub.Sorting.cs" />
<Compile Include="..\..\Common\TypeSystem\IL\Stubs\AsyncResumptionStub.Mangling.cs" Link="IL\Stubs\AsyncResumptionStub.Mangling.cs" />
<Compile Include="..\..\Common\TypeSystem\IL\Stubs\ComparerIntrinsics.cs" Link="IL\Stubs\ComparerIntrinsics.cs" />
<Compile Include="..\..\Common\TypeSystem\IL\Stubs\InterlockedIntrinsics.cs" Link="IL\Stubs\InterlockedIntrinsics.cs" />
<Compile Include="..\..\Common\TypeSystem\IL\Stubs\RuntimeHelpersIntrinsics.cs" Link="IL\Stubs\RuntimeHelpersIntrinsics.cs" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ protected override IMethodNode CreateMethodEntrypointNode(MethodDesc method)
{
return MethodEntrypoint(TypeSystemContext.GetRealDefaultInterfaceMethodImplementationThunkTargetMethod(method));
}
else if (method.IsExplicitContinuationAsyncMethod())
{
return MethodEntrypoint(method.GetExplicitContinuationAsyncMethodTarget());
}
else if (method.IsArrayAddressMethod())
{
return MethodEntrypoint(((ArrayType)method.OwningType).GetArrayMethod(ArrayMethodKind.AddressWithHiddenArg));
Expand Down
Loading