Consolidate MethodHandles::zero into MethodHandles::constant

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Fixed
    • Priority: P4
    • 25
    • Affects Version/s: 25
    • Component/s: core-libs

      Currently, there are two basic method handles - zero and identity. A frequently-used method handle, `MethodHandles::constant`, is derived from a BMH binding a value to identity, which need to go through LambdaFormEditor to spin LF classes, and LFE classes are currently not cached. This is one of the contributor for overheads in Perfstartup-LambdaNoop.

      I propose to change `constant` to be a basic handle, with the lambda form of returning the BMH value; the zero handle can be seen as `constant` bound to zero, or identity for void. This means that we can reuse a pregenerated LF instead of goign through an editor. This can also simplify our implementation by removing the primitive zero handle/form.

            Assignee:
            Chen Liang
            Reporter:
            Chen Liang
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: