Synthetic bridge constructor in ArrayList$Itr blocks inlining

XMLWordPrintable

    • Type: Sub-task
    • Resolution: Fixed
    • Priority: P4
    • 9
    • Affects Version/s: None
    • Component/s: 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

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

                Created:
                Updated:
                Resolved: