summaryrefslogtreecommitdiff
path: root/src/jit
diff options
context:
space:
mode:
authorAndy Ayers <andya@microsoft.com>2018-08-08 13:05:47 -0700
committerGitHub <noreply@github.com>2018-08-08 13:05:47 -0700
commit585cd3685fdad34e8a1ab76b3c98265b26b7aa24 (patch)
tree4e67718e9f6455f5d1404aeb705411b82cb62c62 /src/jit
parent0a84a4d68a2059d03f2f1baa348979e244da4f4d (diff)
downloadcoreclr-585cd3685fdad34e8a1ab76b3c98265b26b7aa24.tar.gz
coreclr-585cd3685fdad34e8a1ab76b3c98265b26b7aa24.tar.bz2
coreclr-585cd3685fdad34e8a1ab76b3c98265b26b7aa24.zip
JIT: update lvaGrabTemp for new minopts/debug ref counting approach (#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.
Diffstat (limited to 'src/jit')
-rw-r--r--src/jit/compiler.hpp19
1 files changed, 14 insertions, 5 deletions
diff --git a/src/jit/compiler.hpp b/src/jit/compiler.hpp
index 545f311ab3..c1b050cc4f 100644
--- a/src/jit/compiler.hpp
+++ b/src/jit/compiler.hpp
@@ -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)