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

Bytecodes should be shared between similar lambda forms.

XMLWordPrintable

      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.

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

              Created:
              Updated:
              Resolved: