Skip to content

Commit

Permalink
Skip tier0 jit for PromiseMethodBuilders.
Browse files Browse the repository at this point in the history
  • Loading branch information
timcassell committed Aug 24, 2023
1 parent 3ae81d6 commit e811da5
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions Package/Core/Promises/Internal/AsyncInternal.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@ namespace Proto.Promises
{
partial class Internal
{
#if NETCOREAPP
private const MethodImplOptions AggressiveOptimizationOption = (MethodImplOptions) 512;
#else
private const MethodImplOptions AggressiveOptimizationOption = 0;
#endif

partial class PromiseRefBase
{
[MethodImpl(InlineOption)]
Expand Down Expand Up @@ -142,7 +148,7 @@ internal static void Start<TStateMachine>(ref TStateMachine stateMachine, ref As
}
}

[MethodImpl(InlineOption)]
[MethodImpl(InlineOption | AggressiveOptimizationOption)]
internal static void AwaitOnCompleted<TAwaiter, TStateMachine>(ref TAwaiter awaiter, ref TStateMachine stateMachine, ref AsyncPromiseRef<TResult> _ref)
where TAwaiter : INotifyCompletion
where TStateMachine : IAsyncStateMachine
Expand All @@ -165,7 +171,7 @@ internal static void AwaitOnCompleted<TAwaiter, TStateMachine>(ref TAwaiter awai
}
}

[MethodImpl(InlineOption)]
[MethodImpl(InlineOption | AggressiveOptimizationOption)]
internal static void AwaitUnsafeOnCompleted<TAwaiter, TStateMachine>(ref TAwaiter awaiter, ref TStateMachine stateMachine, ref AsyncPromiseRef<TResult> _ref)
where TAwaiter : ICriticalNotifyCompletion
where TStateMachine : IAsyncStateMachine
Expand Down

0 comments on commit e811da5

Please sign in to comment.