-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Support dynamically creating tailored continuation layouts #120411
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
base: main
Are you sure you want to change the base?
Changes from 26 commits
7d27090
6743534
0f8cd9c
a642f42
03a640d
a99ce96
fa1820a
e4a75f1
82995d5
38bdf11
97de35e
fb296e3
a3e223f
71b47b0
7df6464
badee7d
56c403a
ca7ef69
9d6d275
04cd9f4
2c30029
21ab2fc
a45427b
37fd434
15f205a
d48bcd5
8a6564e
a92ca94
4d99c5b
cd4fbd5
3bde22a
c1d737f
11033f6
83bcde7
b6ad42e
5e4fb40
a21a7a8
84b205c
7b5f8a7
df38ceb
91158a1
98917c0
ec99d53
9b3eea9
21698ea
69f8eb6
f5bb499
ee717bd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1700,27 +1700,20 @@ struct CORINFO_EE_INFO | |
|
||
enum CorInfoContinuationFlags | ||
{ | ||
// Whether or not the continuation expects the result to be boxed and | ||
// placed in the GCData array at index 0. Not set if the callee is void. | ||
CORINFO_CONTINUATION_RESULT_IN_GCDATA = 1, | ||
// If this bit is set the continuation resumes inside a try block and thus | ||
jkotas marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
// if an exception is being propagated, needs to be resumed. The exception | ||
// should be placed at index 0 or 1 depending on whether the continuation | ||
// also expects a result. | ||
CORINFO_CONTINUATION_NEEDS_EXCEPTION = 2, | ||
// If this bit is set the continuation has the IL offset that inspired the | ||
// OSR method saved in the beginning of 'Data', or -1 if the continuation | ||
// belongs to a tier 0 method. | ||
CORINFO_CONTINUATION_OSR_IL_OFFSET_IN_DATA = 4, | ||
CORINFO_CONTINUATION_NEEDS_EXCEPTION = 1, | ||
// If this bit is set the continuation should continue on the thread | ||
// pool. | ||
CORINFO_CONTINUATION_CONTINUE_ON_THREAD_POOL = 8, | ||
CORINFO_CONTINUATION_CONTINUE_ON_THREAD_POOL = 2, | ||
// If this bit is set the continuation has a SynchronizationContext | ||
// that we should continue on. | ||
CORINFO_CONTINUATION_CONTINUE_ON_CAPTURED_SYNCHRONIZATION_CONTEXT = 16, | ||
CORINFO_CONTINUATION_CONTINUE_ON_CAPTURED_SYNCHRONIZATION_CONTEXT = 4, | ||
// If this bit is set the continuation has a TaskScheduler | ||
// that we should continue on. | ||
CORINFO_CONTINUATION_CONTINUE_ON_CAPTURED_TASK_SCHEDULER = 32, | ||
CORINFO_CONTINUATION_CONTINUE_ON_CAPTURED_TASK_SCHEDULER = 8, | ||
}; | ||
|
||
struct CORINFO_ASYNC_INFO | ||
|
@@ -1735,10 +1728,6 @@ struct CORINFO_ASYNC_INFO | |
CORINFO_FIELD_HANDLE continuationStateFldHnd; | ||
// 'Flags' field | ||
CORINFO_FIELD_HANDLE continuationFlagsFldHnd; | ||
// 'Data' field | ||
CORINFO_FIELD_HANDLE continuationDataFldHnd; | ||
// 'GCData' field | ||
CORINFO_FIELD_HANDLE continuationGCDataFldHnd; | ||
// Whether or not the continuation needs to be allocated through the | ||
// helper that also takes a method handle | ||
bool continuationsNeedMethodHandle; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
(The shared generic handling done on the JIT side right before |
||
|
@@ -1751,6 +1740,15 @@ struct CORINFO_ASYNC_INFO | |
CORINFO_METHOD_HANDLE restoreContextsMethHnd; | ||
}; | ||
|
||
// Offsets for continuation data layout | ||
struct CORINFO_CONTINUATION_DATA_OFFSETS | ||
{ | ||
uint32_t Result; | ||
uint32_t Exception; | ||
uint32_t ContinuationContext; | ||
uint32_t KeepAlive; | ||
}; | ||
|
||
// Flags passed from JIT to runtime. | ||
enum CORINFO_GET_TAILCALL_HELPERS_FLAGS | ||
{ | ||
|
@@ -1960,6 +1958,8 @@ struct CORINFO_FPSTRUCT_LOWERING | |
#define OFFSETOF__CORINFO_Span__reference 0 | ||
#define OFFSETOF__CORINFO_Span__length TARGET_POINTER_SIZE | ||
|
||
#define OFFSETOF__CORINFO_Continuation__data (SIZEOF__CORINFO_Object + TARGET_POINTER_SIZE /* Next */ + TARGET_POINTER_SIZE /* Resume */ + TARGET_POINTER_SIZE /* Flags + maybe padding */) | ||
|
||
|
||
/* data to optimize delegate construction */ | ||
struct DelegateCtorArgs | ||
|
@@ -3342,6 +3342,12 @@ class ICorDynamicInfo : public ICorStaticInfo | |
|
||
virtual CORINFO_METHOD_HANDLE getAsyncResumptionStub() = 0; | ||
|
||
virtual CORINFO_CLASS_HANDLE getContinuationType( | ||
size_t dataSize, | ||
bool* objRefs, | ||
const CORINFO_CONTINUATION_DATA_OFFSETS& dataOffsets | ||
) = 0; | ||
|
||
// Optionally, convert calli to regular method call. This is for PInvoke argument marshalling. | ||
virtual bool convertPInvokeCalliToCall( | ||
CORINFO_RESOLVED_TOKEN * pResolvedToken, | ||
|
Uh oh!
There was an error while loading. Please reload this page.