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

Forcing eager initialization of CHM$ReservationNode avoids deoptimization

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 11
    • None
    • core-libs

      On bootstrap we always hit a deoptimization of CHM.tabAt (which now gets compiled very early). By eagerly initializing ReservationNode we avoid this and see slightly better startup:

      diff -r a09af8ef8e5c src/java.base/share/classes/java/util/concurrent/ConcurrentHashMap.java
      --- a/src/java.base/share/classes/java/util/concurrent/ConcurrentHashMap.java Thu Apr 26 12:48:35 2018 -0700
      +++ b/src/java.base/share/classes/java/util/concurrent/ConcurrentHashMap.java Fri Apr 27 15:04:58 2018 +0200
      @@ -6388,6 +6388,9 @@
       
               // Reduce the risk of rare disastrous classloading in first call to
               // LockSupport.park: https://bugs.openjdk.java.net/browse/JDK-8074773
      - Class<?> ensureLoaded = LockSupport.class;
      + U.ensureClassInitialized(LockSupport.class);
      + // Eagerly initializing of ReservationNode avoids a few very likely deoptimizations
      + // during bootstrap:
      + U.ensureClassInitialized(ReservationNode.class);
           }
       }

            martin Martin Buchholz
            redestad Claes Redestad
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: