Skip to content
Open
Show file tree
Hide file tree
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
17 changes: 10 additions & 7 deletions eng/testing/tests.targets
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
<Project>
<!-- Define a shared predicate for platforms that support runtime async. -->
<PropertyGroup Condition="'$(RuntimeAsyncSupported)' == ''">
<RuntimeAsyncSupported Condition="'$(TargetOS)' != 'browser'
and '$(TargetOS)' != 'wasi'
and '$(TargetOS)' != 'android'
and '$(TargetsAppleMobile)' != 'true'
and '$(RuntimeFlavor)' != 'Mono'">true</RuntimeAsyncSupported>
</PropertyGroup>

<!-- Enable runtime async for all .NET 11+ test projects. -->
<PropertyGroup Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net11.0'))
and '$(TestNativeAot)' != 'true'
and ('$(TestReadyToRun)' != 'true' or '$(UseRuntimeAsync)' == 'true')
and '$(UseNativeAOTRuntime)' != 'true'
and '$(TargetOS)' != 'wasi'
and '$(TargetOS)' != 'android'
and '$(TargetsAppleMobile)' != 'true'
and '$(RuntimeFlavor)' != 'Mono'
and '$(RuntimeAsyncSupported)' == 'true'
and '$(UseRuntimeAsync)' != 'false'">
<EnablePreviewFeatures>true</EnablePreviewFeatures>
<Features>$(Features);runtime-async=on</Features>
Expand Down
3 changes: 0 additions & 3 deletions src/coreclr/inc/clrconfigvalues.h
Original file line number Diff line number Diff line change
Expand Up @@ -715,9 +715,6 @@ RETAIL_CONFIG_DWORD_INFO(EXTERNAL_EnableRiscV64Zbb, W("EnableRiscV64
RETAIL_CONFIG_DWORD_INFO(EXTERNAL_EnableRiscV64Zbs, W("EnableRiscV64Zbs"), 1, "Allows RiscV64 Zbs hardware intrinsics to be disabled")
#endif

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

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

runtimeAsync = false;

return S_OK;
}

Expand Down Expand Up @@ -848,8 +846,6 @@ 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: 0 additions & 4 deletions src/coreclr/vm/eeconfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -449,8 +449,6 @@ class EEConfig

#endif

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

#ifdef FEATURE_INTERPRETER
bool EnableInterpreter() const { LIMITED_METHOD_CONTRACT; return enableInterpreter; }
#endif
Expand Down Expand Up @@ -654,8 +652,6 @@ 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
7 changes: 0 additions & 7 deletions src/coreclr/vm/method.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2392,13 +2392,6 @@ bool IsTypeDefOrRefImplementedInSystemModule(Module* pModule, mdToken tk)

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

PCCOR_SIGNATURE initialSig = sig.GetPtr();
uint32_t data;
IfFailThrow(sig.GetCallingConvInfo(&data));
Expand Down
17 changes: 15 additions & 2 deletions src/libraries/Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,21 @@
'$(IsGeneratorProject)' != 'true'">true</SkipTargetingPackShimReferences>
</PropertyGroup>

<!-- Enable runtime async for source projects when UseRuntimeAsync is set. -->
<PropertyGroup Condition="'$(UseRuntimeAsync)' == 'true' and '$(IsSourceProject)' == 'true'">
<!-- Define a shared predicate for platforms that support runtime async. -->
<PropertyGroup Condition="'$(RuntimeAsyncSupported)' == ''">
<RuntimeAsyncSupported Condition="'$(TargetOS)' != 'browser'
and '$(TargetOS)' != 'wasi'
and '$(TargetOS)' != 'android'
and '$(TargetsAppleMobile)' != 'true'
and '$(RuntimeFlavor)' != 'Mono'">true</RuntimeAsyncSupported>
</PropertyGroup>

<!-- Enable runtime async for netcoreapp source projects, excluding unsupported platforms and OOB packages. -->
<PropertyGroup Condition="'$(IsNETCoreAppSrc)' == 'true'
and '$(IsPackable)' != 'true'
and $([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net11.0'))
and '$(UseRuntimeAsync)' != 'false'
and '$(RuntimeAsyncSupported)' == 'true'">
<EnablePreviewFeatures>true</EnablePreviewFeatures>
<Features>$(Features);runtime-async=on</Features>
</PropertyGroup>
Expand Down
5 changes: 0 additions & 5 deletions src/tests/Interop/COM/RuntimeAsync/RuntimeAsync.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<!-- RequiresProcessIsolation required for CLRTestEnvironmentVariable -->
<RequiresProcessIsolation>true</RequiresProcessIsolation>
<Features>$(Features);runtime-async=on</Features>
</PropertyGroup>
<ItemGroup>
Expand All @@ -13,7 +11,4 @@
<ProjectReference Include="$(TestLibraryProjectPath)" />
<CMakeProjectReference Include="CMakeLists.txt" />
</ItemGroup>
<ItemGroup>
<CLRTestEnvironmentVariable Include="DOTNET_RuntimeAsync" Value="1" />
</ItemGroup>
</Project>
Loading