When running Java programs with -XX:+UseNullableValueFlattening, some platform methods, such as Comparator::comparing, fail with this output:
Caused by: java.lang.BootstrapMethodError: bootstrap method initialization exception
at java.base/java.lang.invoke.BootstrapMethodInvoker.invoke(BootstrapMethodInvoker.java:187)
at java.base/java.lang.invoke.CallSite.makeSite(CallSite.java:310)
at java.base/java.lang.invoke.MethodHandleNatives.linkCallSiteImpl(MethodHandleNatives.java:253)
at java.base/java.lang.invoke.MethodHandleNatives.linkCallSite(MethodHandleNatives.java:243)
at java.base/java.util.Comparator.comparing(Comparator.java:472)
Caused by: java.lang.IllegalArgumentException: too many arguments
at java.base/java.lang.invoke.LambdaMetafactory.altMetafactory(LambdaMetafactory.java:521)
at java.base/java.lang.invoke.BootstrapMethodInvoker.invoke(BootstrapMethodInvoker.java:143)
... 4 more
Side experiments showed that the issue reproduces when the nullable flat layouts are generated, even if field flattening is not activated (and current failing tests don't use nullable flat arrays yet).
One main difference the generation of the nullable flat layouts makes is in the layout of Integer and Float instances. This could be an hint for an investigation.
Caused by: java.lang.BootstrapMethodError: bootstrap method initialization exception
at java.base/java.lang.invoke.BootstrapMethodInvoker.invoke(BootstrapMethodInvoker.java:187)
at java.base/java.lang.invoke.CallSite.makeSite(CallSite.java:310)
at java.base/java.lang.invoke.MethodHandleNatives.linkCallSiteImpl(MethodHandleNatives.java:253)
at java.base/java.lang.invoke.MethodHandleNatives.linkCallSite(MethodHandleNatives.java:243)
at java.base/java.util.Comparator.comparing(Comparator.java:472)
Caused by: java.lang.IllegalArgumentException: too many arguments
at java.base/java.lang.invoke.LambdaMetafactory.altMetafactory(LambdaMetafactory.java:521)
at java.base/java.lang.invoke.BootstrapMethodInvoker.invoke(BootstrapMethodInvoker.java:143)
... 4 more
Side experiments showed that the issue reproduces when the nullable flat layouts are generated, even if field flattening is not activated (and current failing tests don't use nullable flat arrays yet).
One main difference the generation of the nullable flat layouts makes is in the layout of Integer and Float instances. This could be an hint for an investigation.
- links to
-
Commit(lworld) openjdk/valhalla/b37178a0
-
Review(lworld) openjdk/valhalla/1396