@@ -52,6 +52,9 @@ const float TR_J9EstimateCodeSize::CONST_ARG_IN_CALLEE_ADJUSTMENT_FACTOR = 0.75f
52
52
53
53
#define DEFAULT_KNOWN_OBJ_WEIGHT 10
54
54
55
+ #define DEFAULT_FREQ_CUTOFF 40
56
+
57
+
55
58
/*
56
59
DEFINEs are ugly in general, but putting
57
60
if (tracer)
@@ -1294,7 +1297,11 @@ TR_J9EstimateCodeSize::realEstimateCodeSize(TR_CallTarget *calltarget, TR_CallSt
1294
1297
return returnCleanup (ECS_VISITED_COUNT_THRESHOLD_EXCEEDED);
1295
1298
}
1296
1299
1297
- if (_recursionDepth > MAX_ECS_RECURSION_DEPTH)
1300
+
1301
+ static const char *mrd = feGetEnv (" TR_MaxRecursionDepth" );
1302
+ static const int32_t maxRecDepth = mrd ? atoi (mrd) : MAX_ECS_RECURSION_DEPTH;
1303
+
1304
+ if (_recursionDepth > maxRecDepth)
1298
1305
{
1299
1306
calltarget->_isPartialInliningCandidate = false ;
1300
1307
heuristicTrace (tracer (), " *** Depth %d: ECS end for target %p signature %s. Exceeded Recursion Depth" , _recursionDepth, calltarget, callerName);
@@ -1669,7 +1676,9 @@ TR_J9EstimateCodeSize::realEstimateCodeSize(TR_CallTarget *calltarget, TR_CallSt
1669
1676
}
1670
1677
else
1671
1678
{
1672
- int32_t freqCutoff = 40 ;
1679
+ static const char *fc = feGetEnv (" TR_FrequencyCutoff" );
1680
+ static const int32_t freqCutoff = fc ? atoi (fc) : DEFAULT_FREQ_CUTOFF;
1681
+
1673
1682
bool isColdCall = (((comp ()->getMethodHotness () <= warm) && profileManager->isColdCall (targetCallee->_calleeMethod ->getPersistentIdentifier (), calltarget->_calleeMethod ->getPersistentIdentifier (), i, comp ())) || (currentBlock->getFrequency () < freqCutoff)) && !_inliner->alwaysWorthInlining (targetCallee->_calleeMethod , NULL );
1674
1683
1675
1684
if (coldCallInfoIsReliable && isColdCall)
@@ -1802,6 +1811,7 @@ TR_J9EstimateCodeSize::realEstimateCodeSize(TR_CallTarget *calltarget, TR_CallSt
1802
1811
calltarget->addDeadCallee (callSites[i]);
1803
1812
j--;
1804
1813
_numOfEstimatedCalls--;
1814
+ heuristicTrace (tracer ()," Depth %d: estimateCodeSize skipping estimated call and resetting _optimisticSize to %d and _realSize to %d" , _recursionDepth, _optimisticSize, _realSize);
1805
1815
}
1806
1816
1807
1817
if (comp ()->getVisitCount () > HIGH_VISIT_COUNT)
@@ -1823,6 +1833,8 @@ TR_J9EstimateCodeSize::realEstimateCodeSize(TR_CallTarget *calltarget, TR_CallSt
1823
1833
calltarget->addDeadCallee (callSites[i]);
1824
1834
j--;
1825
1835
_numOfEstimatedCalls--;
1836
+
1837
+ heuristicTrace (tracer ()," Depth %d: estimateCodeSize skipping too big estimated call and resetting _optimisticSize to %d and _realSize to %d" , _recursionDepth, _optimisticSize, _realSize);
1826
1838
}
1827
1839
1828
1840
if (comp ()->getVisitCount () > HIGH_VISIT_COUNT)
@@ -1836,7 +1848,7 @@ TR_J9EstimateCodeSize::realEstimateCodeSize(TR_CallTarget *calltarget, TR_CallSt
1836
1848
}
1837
1849
else
1838
1850
{
1839
- heuristicTrace (tracer ()," Depth %d: estimateCodeSize aborting due to _optimisticSize: %d > sizeThreshold: %d" ,_optimisticSize,sizeThreshold);
1851
+ heuristicTrace (tracer ()," Depth %d: estimateCodeSize aborting due to _optimisticSize: %d > sizeThreshold: %d" , _recursionDepth, _optimisticSize,sizeThreshold);
1840
1852
break ;
1841
1853
}
1842
1854
}
0 commit comments