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

Reduce size of j.u.Formatter.Conversion#isValid

XMLWordPrintable

    • b05

      Currently, the java.util.Formatter$Conversion::isValid method is implemented based on switch, which cannot be inlined because codeSize > 325. This problem can be avoided by implementing it with ImmutableBitSetPredicate.

      use -XX:+UnlockDiagnosticVMOptions -XX:+PrintInlining to see the master branch:

      @ 109 java.util.Formatter$Conversion::isValid (358 bytes) failed to inline: hot method too big
      current version

      @ 109 java.util.Formatter$Conversion::isValid (10 bytes) inline (hot)
        @ 4 jdk.internal.util.ImmutableBitSetPredicate$SmallImmutableBitSetPredicate::test (50 bytes) inline (hot)

            swen Shaojin Wen
            swen Shaojin Wen
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: