From e0e22bb7c8106f7df0cb43364342330bf4b3e572 Mon Sep 17 00:00:00 2001 From: Vijay Sundaresan Date: Tue, 7 Jan 2025 13:52:40 -0500 Subject: [PATCH] Adding an env var for inliner max recursion depth --- runtime/compiler/optimizer/J9EstimateCodeSize.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/runtime/compiler/optimizer/J9EstimateCodeSize.cpp b/runtime/compiler/optimizer/J9EstimateCodeSize.cpp index a43d6fa2445..2abbc373994 100644 --- a/runtime/compiler/optimizer/J9EstimateCodeSize.cpp +++ b/runtime/compiler/optimizer/J9EstimateCodeSize.cpp @@ -1294,7 +1294,13 @@ TR_J9EstimateCodeSize::realEstimateCodeSize(TR_CallTarget *calltarget, TR_CallSt return returnCleanup(ECS_VISITED_COUNT_THRESHOLD_EXCEEDED); } - if (_recursionDepth > MAX_ECS_RECURSION_DEPTH) + + int32_t maxRecDepth = MAX_ECS_RECURSION_DEPTH; + static const char *mrd = feGetEnv("TR_MaxRecursionDepth"); + if (mrd) + maxRecDepth = atoi(mrd); + + if (_recursionDepth > maxRecDepth) { calltarget->_isPartialInliningCandidate = false; heuristicTrace(tracer(), "*** Depth %d: ECS end for target %p signature %s. Exceeded Recursion Depth", _recursionDepth, calltarget, callerName);