Use ldc + condy instead of invokedynamic for constant lambdas

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Unresolved
    • Priority: P4
    • tbd
    • Affects Version/s: 12
    • Component/s: 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

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

              Created:
              Updated: