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

Bytecodes should be shared between similar lambda forms.

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P3
    • Resolution: Duplicate
    • Affects Version/s: 8u40, 9
    • Fix Version/s: 9
    • Component/s: core-libs

      Description

      Many method handle transforms, such as MethodHandles.filterReturnValue, create a new LambdaForm code block for each transformed method handle. This leads to excessive loading of tiny methods.

      The solution is to generate the bytecodes so that they can be reused.

      This can be done partly by using the BoundMethodHandle mechanism more vigorously, for performance-critical cases such as MethodHandle.bindTo.

      As a more general backup, bytecodes should be generated to pick constants out of the method handle's LambdaForm itself. Currently, they inline constants as "ldc" constants. This is the single greatest reason for bytecodes to be regenerated. In order for such methods to be optimized, we need a @Stable array mechanism, which is the subject of a different bug report.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                vlivanov Vladimir Ivanov
                Reporter:
                jrose John Rose
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: