-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Async continuations for native AOT #121398
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
67df3da
1499754
6cb4870
47b65a9
bf84ab1
efc25d7
1759adb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,6 +12,10 @@ | |
| using System.Threading; | ||
| using System.Threading.Tasks; | ||
|
|
||
| #if NATIVEAOT | ||
| using Internal.Runtime; | ||
| #endif | ||
|
|
||
| namespace System.Runtime.CompilerServices | ||
| { | ||
| internal struct ExecutionAndSyncBlockStore | ||
|
|
@@ -144,11 +148,16 @@ | |
|
|
||
| private static unsafe Continuation AllocContinuation(Continuation prevContinuation, MethodTable* contMT) | ||
| { | ||
| Continuation newContinuation = (Continuation)RuntimeTypeHandle.InternalAllocNoChecks(contMT); | ||
| #if NATIVEAOT | ||
| Continuation newContinuation = (Continuation)RuntimeImports.RhNewObject(contMT); | ||
| #else | ||
| Continuation newContinuation = (Continuation)RuntimeTypeHandle.InternalAllocNoChecks(contMT); | ||
|
Check failure on line 154 in src/coreclr/System.Private.CoreLib/src/System/Runtime/CompilerServices/AsyncHelpers.CoreCLR.cs
|
||
| #endif | ||
| prevContinuation.Next = newContinuation; | ||
| return newContinuation; | ||
| } | ||
|
|
||
| #if !NATIVEAOT | ||
| private static unsafe Continuation AllocContinuationMethod(Continuation prevContinuation, MethodTable* contMT, int keepAliveOffset, MethodDesc* method) | ||
| { | ||
| LoaderAllocator loaderAllocator = RuntimeMethodHandle.GetLoaderAllocator(new RuntimeMethodHandleInternal((IntPtr)method)); | ||
|
|
@@ -170,6 +179,7 @@ | |
| } | ||
| return newContinuation; | ||
| } | ||
| #endif | ||
|
|
||
| [BypassReadyToRun] | ||
| [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.Async)] | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| // Licensed to the .NET Foundation under one or more agreements. | ||
| // The .NET Foundation licenses this file to you under the MIT license. | ||
|
|
||
| using Internal.IL.Stubs; | ||
| using Internal.TypeSystem; | ||
|
|
||
| namespace ILCompiler | ||
| { | ||
| public partial class AsyncResumptionStub : ILStubMethod, IPrefixMangledMethod | ||
| { | ||
| MethodDesc IPrefixMangledMethod.BaseMethod => _owningMethod; | ||
|
|
||
| string IPrefixMangledMethod.Prefix => "Resume"; | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| // Licensed to the .NET Foundation under one or more agreements. | ||
| // The .NET Foundation licenses this file to you under the MIT license. | ||
|
|
||
| using Internal.IL.Stubs; | ||
| using Internal.TypeSystem; | ||
|
|
||
| namespace ILCompiler | ||
| { | ||
| public partial class AsyncResumptionStub : ILStubMethod | ||
| { | ||
| protected override int ClassCode => 0x773ab1; | ||
|
|
||
| protected override int CompareToImpl(MethodDesc other, TypeSystemComparer comparer) | ||
| { | ||
| return comparer.Compare(_owningMethod, ((AsyncResumptionStub)other)._owningMethod); | ||
| } | ||
| } | ||
| } |
Uh oh!
There was an error while loading. Please reload this page.