Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8161210 slowdown in MHs.iteratedLoop handles
  3. JDK-8166840

Synthetic bridge constructor in ArrayList$Itr blocks inlining

XMLWordPrintable

    • Icon: Sub-task Sub-task
    • Resolution: Fixed
    • Icon: P4 P4
    • 9
    • None
    • core-libs

        As discussed recently on hotspot-compiler-dev[1], having a private class with no default constructor can lead to C2 failing to inline, due to the synthetic bridge constructor using a dummy argument of an uninitialized class. This is really a problem in C2, as well as something which could ultimately be resolved by nestmates...

        However, there is an easy workaround in adding an empty package-private constructor. In the most recently found case - a microbenchmark stressing MethodHandles.iteratedLoop - adding this to ArrayList$Itr lead to a 2.5-3x speedup. It thus makes sense to do this simple change in this particular case as a quick fix and solve the larger C2 issue separately.

        [1] http://mail.openjdk.java.net/pipermail/hotspot-compiler-dev/2016-September/024407.html

              redestad Claes Redestad
              redestad Claes Redestad
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: