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

Constant fold URI constants

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 10
    • 10
    • core-libs
    • b22

      java.net.URI and sun.net.www.ParseUtil create invariant mask constants at static initialization time. Since these call out to static methods, the value evaluation is not constant folded at javac compile time leading to unnecessary code execution during bootstrap.

      Additionally the dependency on java.util.BitSet in ParseUtil can be replaced by a low+high mask, which actually shows as a small (<5%) throughput improvement on microbenchmarks for inputs where this path is taken.

      Manually calculating the constant values reduces bytecode executed by almost 15.000 and avoids loading java.util.BitSet early in bootstrap.

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

              Created:
              Updated:
              Resolved: