Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 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
14 changes: 13 additions & 1 deletion src/coreclr/tools/Common/JitInterface/CorInfoImpl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3358,7 +3358,19 @@ private void getEEInfo(ref CORINFO_EE_INFO pEEInfoOut)

private void getAsyncInfo(ref CORINFO_ASYNC_INFO pAsyncInfoOut)
{
throw new NotImplementedException();
DefType continuation = _compilation.TypeSystemContext.SystemModule.GetKnownType("System.Runtime.CompilerServices"u8, "Continuation"u8);
pAsyncInfoOut.continuationClsHnd = ObjectToHandle(continuation);
pAsyncInfoOut.continuationNextFldHnd = ObjectToHandle(continuation.GetKnownField("Next"u8));
pAsyncInfoOut.continuationResumeFldHnd = ObjectToHandle(continuation.GetKnownField("Resume"u8));
pAsyncInfoOut.continuationStateFldHnd = ObjectToHandle(continuation.GetKnownField("State"u8));
pAsyncInfoOut.continuationFlagsFldHnd = ObjectToHandle(continuation.GetKnownField("Flags"u8));
DefType asyncHelpers = _compilation.TypeSystemContext.SystemModule.GetKnownType("System.Runtime.CompilerServices"u8, "AsyncHelpers"u8);
DefType executionContext = _compilation.TypeSystemContext.SystemModule.GetKnownType("System.Threading"u8, "ExecutionContext"u8);
pAsyncInfoOut.captureExecutionContextMethHnd = ObjectToHandle(asyncHelpers.GetKnownMethod("CaptureExecutionContext"u8, null));
pAsyncInfoOut.restoreExecutionContextMethHnd = ObjectToHandle(asyncHelpers.GetKnownMethod("RestoreExecutionContext"u8, null));
pAsyncInfoOut.captureContinuationContextMethHnd = ObjectToHandle(asyncHelpers.GetKnownMethod("CaptureContinuationContext"u8, null));
pAsyncInfoOut.captureContextsMethHnd = ObjectToHandle(asyncHelpers.GetKnownMethod("CaptureContexts"u8, null));
pAsyncInfoOut.restoreContextsMethHnd = ObjectToHandle(asyncHelpers.GetKnownMethod("RestoreContexts"u8, null));
}

private CORINFO_CLASS_STRUCT_* getContinuationType(nuint dataSize, ref bool objRefs, nuint objRefsSize)
Expand Down
17 changes: 13 additions & 4 deletions src/coreclr/tools/Common/JitInterface/CorInfoTypes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -878,10 +878,19 @@ public unsafe struct CORINFO_ASYNC_INFO
public CORINFO_CLASS_STRUCT_* continuationClsHnd;
// 'Next' field
public CORINFO_FIELD_STRUCT_* continuationNextFldHnd;
// 'Data' field
public CORINFO_FIELD_STRUCT_* continuationDataFldHnd;
// 'GCData' field
public CORINFO_FIELD_STRUCT_* continuationGCDataFldHnd;
// 'Resume' field
public CORINFO_FIELD_STRUCT_* continuationResumeFldHnd;
// 'State' field
public CORINFO_FIELD_STRUCT_* continuationStateFldHnd;
// 'Flags' field
public CORINFO_FIELD_STRUCT_* continuationFlagsFldHnd;
// Method handle for AsyncHelpers.CaptureExecutionContext
public CORINFO_METHOD_STRUCT_* captureExecutionContextMethHnd;
// Method handle for AsyncHelpers.RestoreExecutionContext
public CORINFO_METHOD_STRUCT_* restoreExecutionContextMethHnd;
public CORINFO_METHOD_STRUCT_* captureContinuationContextMethHnd;
public CORINFO_METHOD_STRUCT_* captureContextsMethHnd;
public CORINFO_METHOD_STRUCT_* restoreContextsMethHnd;
}

// Flags passed from JIT to runtime.
Expand Down