Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8351550

[lworld] Some bootstrap methods/lambda factories fail with -XX:+UseNullableValueFlattening

XMLWordPrintable

      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.

            fparain Frederic Parain
            fparain Frederic Parain
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: