Skip to content

Commit

Permalink
Call genHomeStackParams(true) in prolog generation for RISC-V to avoi…
Browse files Browse the repository at this point in the history
…d garbage GC pointers
  • Loading branch information
tomeksowi committed Apr 25, 2024
1 parent 5a0aede commit 4806478
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions src/coreclr/jit/codegencommon.cpp
Expand Up @@ -5555,6 +5555,13 @@ void CodeGen::genFnProlog()
genEnregisterIncomingStackArgs();
}

#ifdef TARGET_RISCV64
if (compiler->fgFirstBBisScratch() && compiler->lvaHasAnyStackParamToReassemble())
{
genHomeStackParams(/* handleStack */ true);
}
#endif

/* Initialize any must-init registers variables now */

if (initRegs)
Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/jit/codegenlinear.cpp
Expand Up @@ -386,7 +386,7 @@ void CodeGen::genCodeForBBlist()
compiler->compCurStmt = nullptr;
compiler->compCurLifeTree = nullptr;

#if defined(SWIFT_SUPPORT) || defined(TARGET_RISCV64)
#ifdef SWIFT_SUPPORT
// Reassemble split struct parameters on the local stack frame in the
// scratch BB right after the prolog. There can be arbitrary amounts of
// codegen related to doing this, so it cannot be done in the prolog.
Expand Down

0 comments on commit 4806478

Please sign in to comment.