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

Use ldc + condy instead of invokedynamic for constant lambdas

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: In Progress
    • Priority: P4
    • Resolution: Unresolved
    • Affects Version/s: 12
    • Fix Version/s: tbd
    • Component/s: tools
    • Labels:
    • Subcomponent:
    • Understanding:
      Fix Understood

      Description

      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.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                vromero Vicente Arturo Romero Zaldivar
                Reporter:
                psandoz Paul Sandoz (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated: