diff --git a/src/coreclr/jit/gentree.cpp b/src/coreclr/jit/gentree.cpp index a49f98a296427a..24c85a77a0ae05 100644 --- a/src/coreclr/jit/gentree.cpp +++ b/src/coreclr/jit/gentree.cpp @@ -12975,6 +12975,11 @@ void Compiler::gtDispTree(GenTree* tree, disp(); } + if (call->IsAsync()) + { + printf(" (async)"); + } + if ((call->gtFlags & GTF_CALL_UNMANAGED) && (call->gtCallMoreFlags & GTF_CALL_M_FRAME_VAR_DEATH)) { printf(" (FramesRoot last use)"); diff --git a/src/coreclr/jit/importer.cpp b/src/coreclr/jit/importer.cpp index af6fa9769a4551..8d9d6ef7fc0ced 100644 --- a/src/coreclr/jit/importer.cpp +++ b/src/coreclr/jit/importer.cpp @@ -9592,8 +9592,8 @@ void Compiler::impImportBlockCode(BasicBlock* block) { bool isHoistable = info.compCompHnd->getClassAttribs(resolvedToken.hClass) & CORINFO_FLG_BEFOREFIELDINIT; - unsigned check_spill = isHoistable ? CHECK_SPILL_NONE : CHECK_SPILL_ALL; - impAppendTree(helperNode, check_spill, impCurStmtDI); + unsigned checkSpill = isHoistable ? CHECK_SPILL_NONE : CHECK_SPILL_ALL; + impAppendTree(helperNode, checkSpill, impCurStmtDI); } } @@ -9627,6 +9627,12 @@ void Compiler::impImportBlockCode(BasicBlock* block) { impSpillSideEffects(true, CHECK_SPILL_ALL DEBUGARG("value for stsfld with typeinit")); } + else if (compIsAsync() && op1->TypeIs(TYP_BYREF)) + { + // TODO-Async: We really only need to spill if + // there is a possibility of an async call in op2. + impSpillSideEffects(true, CHECK_SPILL_ALL DEBUGARG("byref address in async method")); + } break; default: