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

Use ldc + condy instead of invokedynamic for constant lambdas

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: P4 P4
    • tbd
    • 12
    • tools
    • Fix Understood

      Certain lambda expressions are constant, since they don't capture values, and thus the associated invokedynamic instruction performing the linking returns a constant call site. Instead an ldc could be used that refers to a constant dynamic BSM that performs the linking returning a method handle to be invoked (which would be the target of the constant call site if indy was used).

      Using an ldc will have less "ceremony" than using an invokedynamic and may improve linkage time, an assumption of which should be validated with performance measurements.

        1. metafactory.patch
          13 kB
          Vicente Arturo Romero Zaldivar
        2. 8186216
          45 kB
          Vicente Arturo Romero Zaldivar

            vromero Vicente Arturo Romero Zaldivar
            psandoz Paul Sandoz
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated: