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

Opportunistic optimizations in translating lambdas

    XMLWordPrintable

    Details

      Description

      Some lambdas can be entirely represented by method handles, such as :

        (args...) -> staticMethod(args)
        (first, rest...) -> first.instanceMethod(args)
        t -> t.a
        (t, v) -> { t.a = v; }
        () -> ClassName.staticField;

      Rather than desugaring the lambda body to a method, and putting a method reference to that in the constant pool, we can just compute the appropriate method handle that is equivalent to the lambda body instead, and put that in the static bootstrap argument list.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              dlsmith Dan Smith
              Reporter:
              briangoetz Brian Goetz
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated: