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

method handle combinators should be much less specialized

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: P4 P4
    • tbd
    • 9
    • core-libs
    • None

      Method handle combinator lambda forms are specialized to basic type (I J F D Object) and arity.
      Even with sharing and caching, this creates order of 10k lambda forms.
      With enhanced box/autobox elimination, we can erase all types to Object, probably decreasing lambda form count by 5x or more.
      Additionally, with array explosion and copy elimination, we can consolidate multiple arities into single lambda forms per combinator, another count reduction of 3x or more.

      To avoid performance problems, these reductions require robust optimizations like the following:

      for all int x; assert_static(Integer.valueOf(x).intValue() == x);
      for all Integer y; assert_static(Integer.valueOf(y.intValue) == y usually);

      and similarly for arrays
      for all Object[] a; assert_static(a[i] == a.clone()[i]);
      etc.

      Also, to avoid profile pollution (and bad performance) bytecode-driven profiling (into Java-visible counters) is needed.

            Unassigned Unassigned
            jrose John Rose
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated: