Skip to content
Merged
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
18 changes: 10 additions & 8 deletions eng/testing/tests.targets
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
<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>
</PropertyGroup>
<PropertyGroup>
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
Original file line number Diff line number Diff line change
Expand Up @@ -569,12 +569,12 @@ private static unsafe void PutRiscV64AuipcCombo(uint* pCode, long offset, bool i
int hi20 = (int)(offset - lo12);
Debug.Assert((long)lo12 + (long)hi20 == offset);

Debug.Assert(GetRiscV64AuipcCombo(pCode, isStype) == 0);
// Debug.Assert(GetRiscV64AuipcCombo(pCode, isStype) == 0);
pCode[0] |= (uint)hi20;
int bottomBitsPos = isStype ? 7 : 20;
pCode[1] |= (uint)((lo12 >> 5) << 25); // top 7 bits are in the same spot
pCode[1] |= (uint)((lo12 & 0x1F) << bottomBitsPos);
Debug.Assert(GetRiscV64AuipcCombo(pCode, isStype) == offset);
// Debug.Assert(GetRiscV64AuipcCombo(pCode, isStype) == offset);
}

public Relocation(RelocType relocType, int offset, ISymbolNode target)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -934,11 +934,8 @@ private unsafe void ResolveRelocations(int sectionIndex, List<SymbolicRelocation
break;
case RelocType.IMAGE_REL_BASED_LOONGARCH64_PC:
{
if (addend != 0)
{
throw new NotSupportedException();
}
long delta = ((long)symbolImageOffset - (long)(relocOffset & ~0xfff) + ((long)(symbolImageOffset & 0x800) << 1));
long targetAddress = symbolImageOffset + addend;
long delta = (targetAddress - (long)(relocOffset & ~0xfff) + ((targetAddress & 0x800) << 1));
Relocation.WriteValue(reloc.Type, pData, delta);
break;
}
Expand All @@ -947,11 +944,8 @@ private unsafe void ResolveRelocations(int sectionIndex, List<SymbolicRelocation
case RelocType.IMAGE_REL_BASED_RISCV64_PCREL_I:
case RelocType.IMAGE_REL_BASED_RISCV64_PCREL_S:
{
if (addend != 0)
{
throw new NotSupportedException();
}
long delta = (long)symbolImageOffset - (long)relocOffset;
long targetAddress = symbolImageOffset + addend;
long delta = targetAddress - (long)relocOffset;
Relocation.WriteValue(reloc.Type, pData, delta);
break;
}
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
18 changes: 15 additions & 3 deletions src/libraries/Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,21 @@
'$(IsGeneratorProject)' != 'true'">true</SkipTargetingPackShimReferences>
</PropertyGroup>

<!-- Enable runtime async for source projects when UseRuntimeAsync is set. -->
<PropertyGroup Condition="'$(UseRuntimeAsync)' == 'true' and '$(IsSourceProject)' == 'true'">
<EnablePreviewFeatures>true</EnablePreviewFeatures>
<!-- Define a shared predicate for platforms that support runtime async. -->
<PropertyGroup Condition="'$(RuntimeAsyncSupported)' == ''">
<RuntimeAsyncSupported Condition="'$(TargetOS)' != 'browser'
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we can enable asyncV2 for browser+coreCLR ?

cc @radekdoulik

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'">
<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