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
7 changes: 7 additions & 0 deletions src/coreclr/jit/codegenxarch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,13 @@ void CodeGen::genEmitGSCookieCheck(bool pushReg)
// these cannot be a part of any kind of return
regGSCheck = REG_R8;
regNumber regGSCheckAlternative = REG_R9;

// except for swift, where R8 can be used for returns
if (compiler->info.compCallConv == CorInfoCallConvExtension::Swift)
{
regGSCheck = REG_R9;
regGSCheckAlternative = REG_R10;
}
#endif

if (compiler->lvaKeepAliveAndReportThis() && compiler->lvaGetDesc(compiler->info.compThisArg)->lvIsInReg() &&
Expand Down
Loading