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

Improve string folding

    XMLWordPrintable

Details

    • b81
    • Verified

    Backports

      Description

        Javac string folding implemented in the parser could use some improvements. Currently, given a concat of the kind:

        String1 + String2 + String3 ..... + StringN

        This is either left untouched (if there's an X such that StringX is not a literal) or it is all folded into a single StringRes.

        A better implementation would be to generalize this to have folding to return:

        StringRes1 + StringRes2 + .... StringResM

        Where some of the expressions in the result are the concatenation of some of the original input strings, while some other expressions are left alone (i.e. the ones that are not ident). In chronic cases like the one in this bug, this should allow for quite a big boost (as the identifiers are only used once and in close proximity).

        Attachments

          Issue Links

            Activity

              People

                mcimadamore Maurizio Cimadamore
                shadowbug Shadow Bug
                Votes:
                0 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved: