summaryrefslogtreecommitdiff
path: root/src/vm/prestub.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/vm/prestub.cpp')
-rw-r--r--src/vm/prestub.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/vm/prestub.cpp b/src/vm/prestub.cpp
index 5f37ff9f44..507f8d3d00 100644
--- a/src/vm/prestub.cpp
+++ b/src/vm/prestub.cpp
@@ -1736,15 +1736,20 @@ PCODE MethodDesc::DoPrestub(MethodTable *pDispatchingMT)
// When the TieredCompilationManager has received enough call notifications
// for this method only then do we back-patch it.
BOOL fCanBackpatchPrestub = TRUE;
+ BOOL fEligibleForCallCounting = FALSE;
#ifdef FEATURE_TIERED_COMPILATION
TieredCompilationManager* pTieredCompilationManager = nullptr;
BOOL fEligibleForTieredCompilation = IsEligibleForTieredCompilation();
BOOL fWasPromotedToTier1 = FALSE;
if (fEligibleForTieredCompilation)
{
- pTieredCompilationManager = GetAppDomain()->GetTieredCompilationManager();
- CallCounter * pCallCounter = GetCallCounter();
- pCallCounter->OnMethodCalled(this, pTieredCompilationManager, &fCanBackpatchPrestub, &fWasPromotedToTier1);
+ fEligibleForCallCounting = g_pConfig->TieredCompilation_CallCounting();
+ if (fEligibleForCallCounting)
+ {
+ pTieredCompilationManager = GetAppDomain()->GetTieredCompilationManager();
+ CallCounter * pCallCounter = GetCallCounter();
+ pCallCounter->OnMethodCalled(this, pTieredCompilationManager, &fCanBackpatchPrestub, &fWasPromotedToTier1);
+ }
}
#endif
@@ -1757,7 +1762,7 @@ PCODE MethodDesc::DoPrestub(MethodTable *pDispatchingMT)
{
pCode = GetCodeVersionManager()->PublishVersionableCodeIfNecessary(this, fCanBackpatchPrestub);
- if (pTieredCompilationManager != nullptr && fCanBackpatchPrestub && pCode != NULL && !fWasPromotedToTier1)
+ if (pTieredCompilationManager != nullptr && fEligibleForCallCounting && fCanBackpatchPrestub && pCode != NULL && !fWasPromotedToTier1)
{
pTieredCompilationManager->OnMethodCallCountingStoppedWithoutTier1Promotion(this);
}