diff options
author | Andy Ayers <andya@microsoft.com> | 2018-07-18 14:35:08 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-18 14:35:08 -0700 |
commit | b2842bbef5162383f7bf67de2976f2c21dbfdb1d (patch) | |
tree | 3b03b3f0a166eb8518804b99913ef0311322fa2f /src/jit/liveness.cpp | |
parent | 4037baf5675ec275c624395ef2b0337cf58836cd (diff) | |
download | coreclr-b2842bbef5162383f7bf67de2976f2c21dbfdb1d.tar.gz coreclr-b2842bbef5162383f7bf67de2976f2c21dbfdb1d.tar.bz2 coreclr-b2842bbef5162383f7bf67de2976f2c21dbfdb1d.zip |
JIT: force all local var ref counts to be accessed via API (#18979)
This is a preparatory change for auditing and controlling how local
variable ref counts are observed and manipulated.
See #18969 for context.
No diffs seen locally. No TP impact expected.
There is a small chance we may see some asserts in broader testing
as there were places in original code where local ref counts were
incremented without checking for possible overflows. The new APIs
will assert for overflow cases.
Diffstat (limited to 'src/jit/liveness.cpp')
-rw-r--r-- | src/jit/liveness.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/jit/liveness.cpp b/src/jit/liveness.cpp index c99df5cc70..3c34681daa 100644 --- a/src/jit/liveness.cpp +++ b/src/jit/liveness.cpp @@ -31,11 +31,11 @@ void Compiler::fgMarkUseDef(GenTreeLclVarCommon* tree) LclVarDsc* const varDsc = &lvaTable[lclNum]; // We should never encounter a reference to a lclVar that has a zero refCnt. - if (varDsc->lvRefCnt == 0 && (!varTypeIsPromotable(varDsc) || !varDsc->lvPromoted)) + if (varDsc->lvRefCnt() == 0 && (!varTypeIsPromotable(varDsc) || !varDsc->lvPromoted)) { JITDUMP("Found reference to V%02u with zero refCnt.\n", lclNum); assert(!"We should never encounter a reference to a lclVar that has a zero refCnt."); - varDsc->lvRefCnt = 1; + varDsc->setLvRefCnt(1); } const bool isDef = (tree->gtFlags & GTF_VAR_DEF) != 0; @@ -1047,9 +1047,9 @@ void Compiler::fgExtendDbgLifetimes() unsigned lclNum = 0; for (LclVarDsc *varDsc = lvaTable; lclNum < lvaCount; lclNum++, varDsc++) { - if (varDsc->lvRefCnt == 0 && varDsc->lvIsRegArg) + if (varDsc->lvRefCnt() == 0 && varDsc->lvIsRegArg) { - varDsc->lvRefCnt = 1; + varDsc->setLvRefCnt(1); } } |