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

Reduce size of bytecode for large switch statements

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 9
    • None
    • tools
    • None
    • b36
    • generic
    • generic
    • Not verified

        For switch statements, javac can emit a tableswitch or a lookupswitch bytecode. The estimate of the cost for lookupswitch is overly conservative causing javac to favor larger tableswitch instructions more often than necessary.

        A detailed discussion of the metric can be found on the compiler-dev mailing list here:

        http://mail.openjdk.java.net/pipermail/compiler-dev/2014-September/008987.html

              pgovereau Paul Govereau (Inactive)
              pgovereau Paul Govereau (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: