summaryrefslogtreecommitdiff
path: root/src/jit/optcse.cpp
diff options
context:
space:
mode:
authorAndy Ayers <andya@microsoft.com>2018-07-18 14:35:08 -0700
committerGitHub <noreply@github.com>2018-07-18 14:35:08 -0700
commitb2842bbef5162383f7bf67de2976f2c21dbfdb1d (patch)
tree3b03b3f0a166eb8518804b99913ef0311322fa2f /src/jit/optcse.cpp
parent4037baf5675ec275c624395ef2b0337cf58836cd (diff)
downloadcoreclr-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/optcse.cpp')
-rw-r--r--src/jit/optcse.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/jit/optcse.cpp b/src/jit/optcse.cpp
index 48aded86fe..f389aa5bee 100644
--- a/src/jit/optcse.cpp
+++ b/src/jit/optcse.cpp
@@ -1327,7 +1327,7 @@ public:
for (lclNum = 0, varDsc = m_pCompiler->lvaTable; lclNum < m_pCompiler->lvaCount; lclNum++, varDsc++)
{
- if (varDsc->lvRefCnt == 0)
+ if (varDsc->lvRefCnt() == 0)
{
continue;
}
@@ -1368,7 +1368,7 @@ public:
// will consider this LclVar as being enregistered.
// Now we reduce the remaining regAvailEstimate by
// an appropriate amount.
- if (varDsc->lvRefCnt <= 2)
+ if (varDsc->lvRefCnt() <= 2)
{
// a single use single def LclVar only uses 1
regAvailEstimate -= 1;
@@ -1435,22 +1435,22 @@ public:
{
if (CodeOptKind() == Compiler::SMALL_CODE)
{
- aggressiveRefCnt = varDsc->lvRefCnt + BB_UNITY_WEIGHT;
+ aggressiveRefCnt = varDsc->lvRefCnt() + BB_UNITY_WEIGHT;
}
else
{
- aggressiveRefCnt = varDsc->lvRefCntWtd + BB_UNITY_WEIGHT;
+ aggressiveRefCnt = varDsc->lvRefCntWtd() + BB_UNITY_WEIGHT;
}
}
if ((moderateRefCnt == 0) && (enregCount > ((CNT_CALLEE_ENREG * 3) + (CNT_CALLEE_TRASH * 2))))
{
if (CodeOptKind() == Compiler::SMALL_CODE)
{
- moderateRefCnt = varDsc->lvRefCnt;
+ moderateRefCnt = varDsc->lvRefCnt();
}
else
{
- moderateRefCnt = varDsc->lvRefCntWtd;
+ moderateRefCnt = varDsc->lvRefCntWtd();
}
}
}