Details
-
Bug
-
Resolution: Fixed
-
P3
-
8
-
b81
-
Verified
Backports
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8142230 | emb-9 | Maurizio Cimadamore | P3 | Resolved | Fixed | team |
JDK-8149315 | 8u101 | Aleksej Efimov | P3 | Resolved | Fixed | b01 |
JDK-8143815 | 8u92 | Aleksej Efimov | P3 | Resolved | Fixed | b04 |
JDK-8155500 | emb-8u101 | Aleksej Efimov | P3 | Resolved | Fixed | b01 |
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).
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
- backported by
-
JDK-8142230 Improve string folding
- Resolved
-
JDK-8143815 Improve string folding
- Resolved
-
JDK-8149315 Improve string folding
- Resolved
-
JDK-8155500 Improve string folding
- Resolved
- relates to
-
JDK-8142440 String folding stops when a non-constant object is reached
- Open