Skip to content
Merged
Changes from all commits
Commits
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 @@ -111,6 +111,7 @@ internal unsafe class Continuation

// See note in ContinuationFlags above for the computation of these offsets.

[MethodImpl(MethodImplOptions.AggressiveInlining)]
public unsafe object GetContinuationContext()
{
const uint mask = (1u << (int)ContinuationFlags.ContinuationContextIndexNumBits) - 1;
Expand All @@ -120,12 +121,14 @@ public unsafe object GetContinuationContext()
return Unsafe.As<byte, object>(ref Unsafe.Add(ref data, (DataOffset - PointerSize) + index * PointerSize));
}

[MethodImpl(MethodImplOptions.AggressiveInlining)]
public bool HasException()
{
const uint mask = (1u << (int)ContinuationFlags.ExceptionIndexNumBits) - 1;
return ((uint)Flags & (mask << (int)ContinuationFlags.ExceptionIndexFirstBit)) != 0;
}

[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void SetException(Exception ex)
{
const uint mask = (1u << (int)ContinuationFlags.ExceptionIndexNumBits) - 1;
Expand All @@ -135,6 +138,7 @@ public void SetException(Exception ex)
Unsafe.As<byte, Exception>(ref Unsafe.Add(ref data, (DataOffset - PointerSize) + index * PointerSize)) = ex;
}

[MethodImpl(MethodImplOptions.AggressiveInlining)]
public ref byte GetResultStorageOrNull()
{
const uint mask = (1u << (int)ContinuationFlags.ResultIndexNumBits) - 1;
Expand Down
Loading