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

Commit

Permalink
JIT: update lvaGrabTemp for new minopts/debug ref counting approach (#…
Browse files Browse the repository at this point in the history
…19351)

If the jit has started normal ref counting and is in minopts or debug,
set all new temps to be implicitly referenced by default.

Closes #19346.
  • Loading branch information
AndyAyersMS authored Aug 8, 2018
1 parent 0a84a4d commit 585cd36
Showing 1 changed file with 14 additions and 5 deletions.
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
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

0 comments on commit 585cd36

Please sign in to comment.