File tree Expand file tree Collapse file tree 2 files changed +196
-119
lines changed
src/java.base/share/classes/java/lang Expand file tree Collapse file tree 2 files changed +196
-119
lines changed Original file line number Diff line number Diff line change 2828import jdk .internal .misc .Unsafe ;
2929import jdk .internal .util .DecimalDigits ;
3030import jdk .internal .vm .annotation .ForceInline ;
31+ import jdk .internal .vm .annotation .Stable ;
3132
3233import java .lang .invoke .MethodHandle ;
3334import java .lang .invoke .MethodHandles ;
4041 */
4142final class StringConcatHelper {
4243
44+
45+ static class StringConcatBase {
46+ @ Stable String [] constants ;
47+ @ Stable int length ;
48+ @ Stable byte coder ;
49+ StringConcatBase (String [] constants ) {
50+ int length = 0 ;
51+ byte coder = String .LATIN1 ;
52+ this .constants = constants ;
53+ for (String c : constants ) {
54+ length += c .length ();
55+ coder |= c .coder ();
56+ }
57+ this .length = length ;
58+ this .coder = coder ;
59+ }
60+ }
61+
4362 private StringConcatHelper () {
4463 // no instantiation
4564 }
You can’t perform that action at this time.
0 commit comments