Skip to content

[RuntimeAsync] Make runtime async tests to build and pass locally. #115499

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

Merged
merged 4 commits into from
May 13, 2025
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
2 changes: 1 addition & 1 deletion src/coreclr/jit/importer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6041,7 +6041,7 @@ bool Compiler::impMatchAwaitPattern(const BYTE* codeAddr, const BYTE* codeEndp,

// check if it is an Await intrinsic
if (eeIsIntrinsic(nextCallTok.hMethod) &&
lookupNamedIntrinsic(nextCallTok.hMethod) == NI_System_Runtime_CompilerServices_RuntimeHelpers_Await)
lookupNamedIntrinsic(nextCallTok.hMethod) == NI_System_Runtime_CompilerServices_AsyncHelpers_Await)
{
// yes, this is an Await
return true;
Expand Down
15 changes: 9 additions & 6 deletions src/coreclr/jit/importercalls.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3342,15 +3342,15 @@ GenTree* Compiler::impIntrinsic(CORINFO_CLASS_HANDLE clsHnd,
return node;
}

if (ni == NI_System_Runtime_CompilerServices_RuntimeHelpers_AsyncSuspend)
if (ni == NI_System_Runtime_CompilerServices_AsyncHelpers_AsyncSuspend)
{
GenTree* node = gtNewOperNode(GT_RETURN_SUSPEND, TYP_VOID, impPopStack().val);
node->SetHasOrderingSideEffect();
node->gtFlags |= GTF_CALL | GTF_GLOB_REF;
return node;
}

if (ni == NI_System_Runtime_CompilerServices_RuntimeHelpers_Await)
if (ni == NI_System_Runtime_CompilerServices_AsyncHelpers_Await)
{
// These are marked intrinsics simply to match them by name in
// the Await pattern optimization. Make sure we keep pIntrinsicName assigned
Expand Down Expand Up @@ -11068,13 +11068,16 @@ NamedIntrinsic Compiler::lookupNamedIntrinsic(CORINFO_METHOD_HANDLE method)
{
result = NI_System_Runtime_CompilerServices_RuntimeHelpers_GetMethodTable;
}
else if (strcmp(methodName, "Await") == 0)
}
else if (strcmp(className, "AsyncHelpers") == 0)
{
if (strcmp(methodName, "AsyncSuspend") == 0)
{
result = NI_System_Runtime_CompilerServices_RuntimeHelpers_Await;
result = NI_System_Runtime_CompilerServices_AsyncHelpers_AsyncSuspend;
}
else if (strcmp(methodName, "AsyncSuspend") == 0)
else if (strcmp(methodName, "Await") == 0)
{
result = NI_System_Runtime_CompilerServices_RuntimeHelpers_AsyncSuspend;
result = NI_System_Runtime_CompilerServices_AsyncHelpers_Await;
}
}
else if (strcmp(className, "StaticsHelpers") == 0)
Expand Down
5 changes: 3 additions & 2 deletions src/coreclr/jit/namedintrinsiclist.h
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,9 @@ enum NamedIntrinsic : unsigned short
NI_System_Runtime_CompilerServices_RuntimeHelpers_IsKnownConstant,
NI_System_Runtime_CompilerServices_RuntimeHelpers_IsReferenceOrContainsReferences,
NI_System_Runtime_CompilerServices_RuntimeHelpers_GetMethodTable,
NI_System_Runtime_CompilerServices_RuntimeHelpers_Await,
NI_System_Runtime_CompilerServices_RuntimeHelpers_AsyncSuspend,

NI_System_Runtime_CompilerServices_AsyncHelpers_AsyncSuspend,
NI_System_Runtime_CompilerServices_AsyncHelpers_Await,

NI_System_Runtime_CompilerServices_StaticsHelpers_VolatileReadAsByref,

Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/vm/arm64/stubs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -772,7 +772,7 @@ void HijackFrame::UpdateRegDisplay_Impl(const PREGDISPLAY pRD, bool updateFloats

pRD->volatileCurrContextPointers.X0 = &m_Args->X0;
pRD->volatileCurrContextPointers.X1 = &m_Args->X1;
pRD->volatileCurrContextPointers.X1 = &m_Args->X2;
pRD->volatileCurrContextPointers.X2 = &m_Args->X2;

pRD->pCurrentContext->X19 = m_Args->X19;
pRD->pCurrentContext->X20 = m_Args->X20;
Expand Down
11 changes: 11 additions & 0 deletions src/tests/async/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$([MSBuild]::GetPathOfFileAbove('Directory.Merged.props', $(MSBuildThisFileDirectory)..))" />
<Import Project="$([MSBuild]::GetPathOfFileAbove('Directory.Build.props', $(MSBuildThisFileDirectory)..))" />

<PropertyGroup>
<RunAnalyzers>true</RunAnalyzers>
<NoWarn>$(NoWarn);xUnit1013</NoWarn>
<EnableNETAnalyzers>false</EnableNETAnalyzers>
</PropertyGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<ItemGroup>
<MergedWrapperProjectReference Include="*/**/*.??proj" />
<MergedWrapperProjectReference Include="*.??proj" />
<MergedWrapperProjectReference Remove="$(MSBuildProjectName).csproj" />

<!-- Remove manual benchmarks from the test wrapper -->
<MergedWrapperProjectReference Remove="eh-microbench.csproj" />
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading