Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.

JIT: update lvaGrabTemp for new minopts/debug ref counting approach #19351

Merged
merged 1 commit into from
Aug 8, 2018
Merged
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
19 changes: 14 additions & 5 deletions src/jit/compiler.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1682,13 +1682,22 @@ inline unsigned Compiler::lvaGrabTemp(bool shortLifetime DEBUGARG(const char* re
lvaTable = newLvaTable;
}

lvaTable[lvaCount].lvType = TYP_UNDEF; // Initialize lvType, lvIsTemp and lvOnFrame
lvaTable[lvaCount].lvIsTemp = shortLifetime;
lvaTable[lvaCount].lvOnFrame = true;
const unsigned tempNum = lvaCount;
lvaCount++;

unsigned tempNum = lvaCount;
lvaTable[tempNum].lvType = TYP_UNDEF; // Initialize lvType, lvIsTemp and lvOnFrame

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: I think a comment that applies to multiple lines should be above the first line (though I realize this was already here).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll fix this as part of #19345.

lvaTable[tempNum].lvIsTemp = shortLifetime;
lvaTable[tempNum].lvOnFrame = true;

lvaCount++;
// If we've started normal ref counting and are in minopts or debug
// mark this variable as implictly referenced.
if (lvaLocalVarRefCounted())
{
if (opts.MinOpts() || opts.compDbgCode)
{
lvaTable[tempNum].lvImplicitlyReferenced = 1;
}
}

#ifdef DEBUG
if (verbose)
Expand Down