Skip to content

Commit

Permalink
Revert "JIT: Account for mixed-enregistered locals when zeroing witho…
Browse files Browse the repository at this point in the history
…ut block-init (dotnet#104593)"

This reverts commit d586986.
  • Loading branch information
matouskozak committed Jul 11, 2024
1 parent 6b4fb84 commit b029d06
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions src/coreclr/jit/codegencommon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4055,15 +4055,9 @@ void CodeGen::genZeroInitFrame(int untrLclHi, int untrLclLo, regNumber initReg,
continue;
}

// Locals that are (only) in registers to begin with do not need
// their stack home zeroed. Their register will be zeroed later in
// the prolog.
if (varDsc->lvIsInReg() && !varDsc->lvLiveInOutOfHndlr)
{
continue;
}

noway_assert(varDsc->lvOnFrame);
// TODO-Review: I'm not sure that we're correctly handling the mustInit case for
// partially-enregistered vars in the case where we don't use a block init.
noway_assert(varDsc->lvIsInReg() || varDsc->lvOnFrame);

// lvMustInit can only be set for GC types or TYP_STRUCT types
// or when compInitMem is true
Expand All @@ -4072,6 +4066,11 @@ void CodeGen::genZeroInitFrame(int untrLclHi, int untrLclLo, regNumber initReg,
noway_assert(varTypeIsGC(varDsc->TypeGet()) || (varDsc->TypeGet() == TYP_STRUCT) ||
compiler->info.compInitMem || compiler->opts.compDbgCode);

if (!varDsc->lvOnFrame)
{
continue;
}

if ((varDsc->TypeGet() == TYP_STRUCT) && !compiler->info.compInitMem &&
(varDsc->lvExactSize() >= TARGET_POINTER_SIZE))
{
Expand Down

0 comments on commit b029d06

Please sign in to comment.