Skip to content
Open
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
17 changes: 7 additions & 10 deletions src/coreclr/jit/codegencommon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7069,11 +7069,6 @@ void CodeGen::genReturn(GenTree* treeNode)
}
}

if (treeNode->OperIs(GT_RETURN) && compiler->compIsAsync())
{
instGen_Set_Reg_To_Zero(EA_PTRSIZE, REG_ASYNC_CONTINUATION_RET);
}

#if EMIT_GENERATE_GCINFO
if (treeNode->OperIs(GT_RETURN, GT_SWIFT_ERROR_RET))
{
Expand All @@ -7097,6 +7092,12 @@ void CodeGen::genReturn(GenTree* treeNode)
}
#endif // PROFILING_SUPPORTED

if (treeNode->OperIs(GT_RETURN) && compiler->compIsAsync())
{
instGen_Set_Reg_To_Zero(EA_PTRSIZE, REG_ASYNC_CONTINUATION_RET);
gcInfo.gcMarkRegPtrVal(REG_ASYNC_CONTINUATION_RET, TYP_REF);
}

#if defined(DEBUG) && defined(TARGET_XARCH)
bool doStackPointerCheck = compiler->opts.compStackCheckOnRet;

Expand Down Expand Up @@ -7160,6 +7161,7 @@ void CodeGen::genReturnSuspend(GenTreeUnOp* treeNode)

regNumber reg = genConsumeReg(op);
inst_Mov(TYP_REF, REG_ASYNC_CONTINUATION_RET, reg, /* canSkip */ true);
gcInfo.gcMarkRegPtrVal(REG_ASYNC_CONTINUATION_RET, TYP_REF);

ReturnTypeDesc retTypeDesc = compiler->compRetTypeDesc;
unsigned numRetRegs = retTypeDesc.GetReturnRegCount();
Expand Down Expand Up @@ -7196,11 +7198,6 @@ void CodeGen::genMarkReturnGCInfo()
retTypeDesc.GetReturnRegType(i));
}
}

if (compiler->compIsAsync())
{
gcInfo.gcMarkRegPtrVal(REG_ASYNC_CONTINUATION_RET, TYP_REF);
}
}

//------------------------------------------------------------------------
Expand Down
Loading