Skip to content

Commit 7734d02

Browse files
Limit native AOT to CORINFO_HELP_ALLOC_CONTINUATION
Native AOT doesn't have a `MethodDesc` at runtime. But that's fine, we don't have a loader to keep alive either.
1 parent 4459d20 commit 7734d02

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/coreclr/jit/async.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1507,7 +1507,7 @@ GenTreeCall* AsyncTransformation::CreateAllocContinuationCall(AsyncLiveness&
15071507
// If VM requests that we report the method handle, or if we have a shared generic context method handle
15081508
// that is live here, then we need to call a different helper to keep the loader alive.
15091509
if (((m_comp->info.compMethodInfo->options & CORINFO_GENERICS_CTXT_FROM_METHODDESC) != 0) &&
1510-
life.IsLive(m_comp->info.compTypeCtxtArg))
1510+
life.IsLive(m_comp->info.compTypeCtxtArg) && !m_comp->IsTargetAbi(CORINFO_NATIVEAOT_ABI))
15111511
{
15121512
assert(layout.KeepAliveOffset != UINT_MAX);
15131513
GenTree* methodHandleArg = m_comp->gtNewLclvNode(m_comp->info.compTypeCtxtArg, TYP_I_IMPL);
@@ -1518,7 +1518,7 @@ GenTreeCall* AsyncTransformation::CreateAllocContinuationCall(AsyncLiveness&
15181518
contClassHndNode, keepAliveOffsetNode, methodHandleArg);
15191519
}
15201520
else if (((m_comp->info.compMethodInfo->options & CORINFO_GENERICS_CTXT_FROM_METHODTABLE) != 0) &&
1521-
life.IsLive(m_comp->info.compTypeCtxtArg))
1521+
life.IsLive(m_comp->info.compTypeCtxtArg) && !m_comp->IsTargetAbi(CORINFO_NATIVEAOT_ABI))
15221522
{
15231523
assert(layout.KeepAliveOffset != UINT_MAX);
15241524
GenTree* classHandleArg = m_comp->gtNewLclvNode(m_comp->info.compTypeCtxtArg, TYP_I_IMPL);

0 commit comments

Comments
 (0)