Skip to content

Commit 51f0d4b

Browse files
authored
Merge pull request #22290 from nbhuiyan/guard-nph-mhinvoke-0.54
(0.54) Guard peeking behaviour for invokedynamic/handle with an env option
2 parents f6940e2 + e838fe7 commit 51f0d4b

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

runtime/compiler/optimizer/J9EstimateCodeSize.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -982,8 +982,14 @@ TR_J9EstimateCodeSize::processBytecodeAndGenerateCFG(TR_CallTarget *calltarget,
982982
break;
983983
case J9BCinvokedynamic:
984984
case J9BCinvokehandle:
985-
nph.setNeedsPeekingToTrue();
986-
heuristicTrace(tracer(), "Depth %d: Enabled peeking ILGen for method %s due to invokedynamic/invokehandle bytecode at bc index %d.", _recursionDepth, callerName, i);
985+
{
986+
const static bool enablePeekingForMHInvokes = feGetEnv("TR_enablePeekingForMHInvokes") ? true : false;
987+
if (enablePeekingForMHInvokes)
988+
{
989+
nph.setNeedsPeekingToTrue();
990+
heuristicTrace(tracer(), "Depth %d: Enabled peeking ILGen for method %s due to invokedynamic/invokehandle bytecode at bc index %d.", _recursionDepth, callerName, i);
991+
}
992+
}
987993
// intentional fallthrough
988994
case J9BCinvokehandlegeneric:
989995
// TODO:JSR292: Use getResolvedHandleMethod

0 commit comments

Comments
 (0)