Reduce size of bytecode for large switch statements

XMLWordPrintable

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

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

                Created:
                Updated:
                Resolved: