Skip to content

Commit 740f10f

Browse files
committed
[GR-50194] Disable MethodHandle inlining blocking.
PullRequest: graal/16235
2 parents 55803c7 + d2b31cc commit 740f10f

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

substratevm/src/com.oracle.svm.driver/src/com/oracle/svm/driver/NativeImage.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1117,6 +1117,14 @@ private int completeImageBuild() {
11171117
// The following two are for backwards compatibility reasons. They should be removed.
11181118
imageBuilderJavaArgs.add("-Djdk.internal.lambda.eagerlyInitialize=false");
11191119
imageBuilderJavaArgs.add("-Djava.lang.invoke.InnerClassLambdaMetafactory.initializeLambdas=false");
1120+
/*
1121+
* DONT_INLINE_THRESHOLD is used to set a profiling threshold for certain method handles and
1122+
* only allow inlining after n invocations. This is used for example in the implementation
1123+
* of record equals methods. We disable this behavior in the image builder because it can
1124+
* prevent optimizing the method handles for AOT compilation if the threshold is not
1125+
* reached.
1126+
*/
1127+
imageBuilderJavaArgs.add("-Djava.lang.invoke.MethodHandle.DONT_INLINE_THRESHOLD=-1");
11201128

11211129
/* After JavaArgs consolidation add the user provided JavaArgs */
11221130
boolean afterOption = false;

0 commit comments

Comments
 (0)