Skip to content

Commit d2b31cc

Browse files
committed
Disable MethodHandle inlining blocking.
1 parent 81a97e3 commit d2b31cc

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
@@ -1115,6 +1115,14 @@ private int completeImageBuild() {
11151115
// The following two are for backwards compatibility reasons. They should be removed.
11161116
imageBuilderJavaArgs.add("-Djdk.internal.lambda.eagerlyInitialize=false");
11171117
imageBuilderJavaArgs.add("-Djava.lang.invoke.InnerClassLambdaMetafactory.initializeLambdas=false");
1118+
/*
1119+
* DONT_INLINE_THRESHOLD is used to set a profiling threshold for certain method handles and
1120+
* only allow inlining after n invocations. This is used for example in the implementation
1121+
* of record equals methods. We disable this behavior in the image builder because it can
1122+
* prevent optimizing the method handles for AOT compilation if the threshold is not
1123+
* reached.
1124+
*/
1125+
imageBuilderJavaArgs.add("-Djava.lang.invoke.MethodHandle.DONT_INLINE_THRESHOLD=-1");
11181126

11191127
/* After JavaArgs consolidation add the user provided JavaArgs */
11201128
boolean afterOption = false;

0 commit comments

Comments
 (0)