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
2 changes: 0 additions & 2 deletions src/coreclr/clrdefinitions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,6 @@ if(FEATURE_OBJCMARSHAL)
add_compile_definitions(FEATURE_OBJCMARSHAL)
endif()

# add_compile_definitions(FEATURE_RUNTIME_ASYNC)

add_compile_definitions($<${FEATURE_JAVAMARSHAL}:FEATURE_JAVAMARSHAL>)

add_compile_definitions($<$<NOT:$<BOOL:$<TARGET_PROPERTY:DAC_COMPONENT>>>:FEATURE_PROFAPI_ATTACH_DETACH>)
Expand Down
3 changes: 3 additions & 0 deletions src/coreclr/inc/clrconfigvalues.h
Original file line number Diff line number Diff line change
Expand Up @@ -708,6 +708,9 @@ RETAIL_CONFIG_DWORD_INFO(EXTERNAL_EnableRiscV64Zba, W("EnableRiscV64
RETAIL_CONFIG_DWORD_INFO(EXTERNAL_EnableRiscV64Zbb, W("EnableRiscV64Zbb"), 1, "Allows RiscV64 Zbb hardware intrinsics to be disabled")
#endif

// Runtime-async
RETAIL_CONFIG_DWORD_INFO(UNSUPPORTED_RuntimeAsync, W("RuntimeAsync"), 0, "Enables runtime async method support")

///
/// Uncategorized
///
Expand Down
4 changes: 4 additions & 0 deletions src/coreclr/vm/eeconfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,8 @@ HRESULT EEConfig::Init()
fGDBJitEmitDebugFrame = false;
#endif

runtimeAsync = false;

return S_OK;
}

Expand Down Expand Up @@ -763,6 +765,8 @@ HRESULT EEConfig::sync()
fUseCachedInterfaceDispatch = CLRConfig::GetConfigValue(CLRConfig::INTERNAL_UseCachedInterfaceDispatch) != 0;
#endif // defined(FEATURE_CACHED_INTERFACE_DISPATCH) && defined(FEATURE_VIRTUAL_STUB_DISPATCH)

runtimeAsync = CLRConfig::GetConfigValue(CLRConfig::UNSUPPORTED_RuntimeAsync) != 0;

return hr;
}

Expand Down
4 changes: 4 additions & 0 deletions src/coreclr/vm/eeconfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,8 @@ class EEConfig

#endif

bool RuntimeAsync() const { LIMITED_METHOD_CONTRACT; return runtimeAsync; }

private: //----------------------------------------------------------------

bool fInited; // have we synced to the registry at least once?
Expand Down Expand Up @@ -634,6 +636,8 @@ class EEConfig
bool fUseCachedInterfaceDispatch;
#endif // defined(FEATURE_CACHED_INTERFACE_DISPATCH) && defined(FEATURE_VIRTUAL_STUB_DISPATCH)

bool runtimeAsync; // True if the runtime supports async methods

public:

enum BitForMask {
Expand Down
9 changes: 6 additions & 3 deletions src/coreclr/vm/method.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2316,9 +2316,13 @@ bool IsTypeDefOrRefImplementedInSystemModule(Module* pModule, mdToken tk)

MethodReturnKind ClassifyMethodReturnKind(SigPointer sig, Module* pModule, ULONG* offsetOfAsyncDetails, bool *isValueTask)
{
// Without FEATURE_RUNTIME_ASYNC every declared method is classified as a NormalMethod.
// Without RUNTIME_ASYNC every declared method is classified as a NormalMethod.
// Thus code that handles runtime async scenarios becomes unreachable.
#ifdef FEATURE_RUNTIME_ASYNC
if (!g_pConfig->RuntimeAsync())
{
return MethodReturnKind::NormalMethod;
}

PCCOR_SIGNATURE initialSig = sig.GetPtr();
uint32_t data;
IfFailThrow(sig.GetCallingConvInfo(&data));
Expand Down Expand Up @@ -2376,7 +2380,6 @@ MethodReturnKind ClassifyMethodReturnKind(SigPointer sig, Module* pModule, ULONG
return MethodReturnKind::NonGenericTaskReturningMethod;
}
}
#endif // FEATURE_RUNTIME_ASYNC

return MethodReturnKind::NormalMethod;
}
Expand Down
11 changes: 7 additions & 4 deletions src/coreclr/vm/methodtablebuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2682,10 +2682,13 @@ MethodTableBuilder::EnumerateClassMethods()
BuildMethodTableThrowException(IDS_CLASSLOAD_TOO_MANY_METHODS);

bmtMethod->m_cMaxDeclaredMethods = (SLOT_INDEX)cMethAndGaps;
#ifdef FEATURE_RUNTIME_ASYNC
// TODO: (async) the index is uint16 and can potentially overflow. This needs to be more robust.
bmtMethod->m_cMaxDeclaredMethods *= 2;
#endif

if (g_pConfig->RuntimeAsync())
{
// TODO: (async) the index is uint16 and can potentially overflow. This needs to be more robust.
bmtMethod->m_cMaxDeclaredMethods *= 2;
}

bmtMethod->m_cDeclaredMethods = 0;
bmtMethod->m_rgDeclaredMethods = new (GetStackingAllocator())
bmtMDMethod *[bmtMethod->m_cMaxDeclaredMethods];
Expand Down
Loading