Skip to content

Commit 55e9410

Browse files
jakobbotschdavidwrighton
authored andcommitted
Skip post-async2 functions for GC stress
1 parent 00da10f commit 55e9410

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

src/coreclr/vm/gccover.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,8 @@ void SetupGcCoverage(NativeCodeVersion nativeCodeVersion, BYTE* methodStartPtr)
261261
SetupAndSprinkleBreakpointsForJittedMethod(nativeCodeVersion, codeStart);
262262
}
263263

264+
bool IsSpecialCaseAsyncRet(MethodDesc* pMD);
265+
264266
void ReplaceInstrAfterCall(PBYTE instrToReplace, MethodDesc* callMD)
265267
{
266268
ReturnKind returnKind = callMD->GetReturnKind(true);
@@ -275,6 +277,15 @@ void ReplaceInstrAfterCall(PBYTE instrToReplace, MethodDesc* callMD)
275277
}
276278
_ASSERTE(IsValidReturnKind(returnKind));
277279

280+
if (g_pConfig->RuntimeAsyncViaJitGeneratedStateMachines())
281+
{
282+
if (callMD->IsAsync2Method() || (callMD->IsIntrinsic() && IsSpecialCaseAsyncRet(callMD)))
283+
{
284+
// Cannot encode requirement to protect async ret after call.
285+
return;
286+
}
287+
}
288+
278289
bool ispointerKind = IsPointerReturnKind(returnKind);
279290
#ifdef TARGET_ARM
280291
size_t instrLen = GetARMInstructionLength(instrToReplace);

src/coreclr/vm/threadsuspend.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5110,7 +5110,7 @@ void STDCALL OnHijackWorker(HijackArgs * pArgs)
51105110
#endif // HIJACK_NONINTERRUPTIBLE_THREADS
51115111
}
51125112

5113-
static bool IsSpecialCaseAsyncRet(MethodDesc* pMD)
5113+
bool IsSpecialCaseAsyncRet(MethodDesc* pMD)
51145114
{
51155115
// TODO: What's the right way to do this through CoreLibBinder without
51165116
// causing loading to happen? Also, can we just mark them as async2 in SPC,

0 commit comments

Comments
 (0)