jdk/test/java/lang/String/concat/ImplicitStringConcatManyLongs.java
author shade
Tue, 02 Feb 2016 18:15:15 +0300
changeset 35639 f34e7e8b4eac
parent 35388 a33a232cf7b7
permissions -rw-r--r--
8148787: StringConcatFactory exactness check produces bad bytecode when a non-arg concat is requested Reviewed-by: vlivanov, psandoz
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
35388
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
     1
/*
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
     2
 * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
     4
 *
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
     7
 * published by the Free Software Foundation.
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
     8
 *
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
    13
 * accompanied this code).
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
    14
 *
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
    18
 *
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
    21
 * questions.
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
    22
 */
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
    23
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
    24
/**
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
    25
 * @test
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
    26
 * @summary Test implicit String concatenations with lots of arguments (two-slot version)
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
    27
 *
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
    28
 * @compile ImplicitStringConcatManyLongs.java
35639
f34e7e8b4eac 8148787: StringConcatFactory exactness check produces bad bytecode when a non-arg concat is requested
shade
parents: 35388
diff changeset
    29
 * @run main/othervm -Xverify:all ImplicitStringConcatManyLongs
35388
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
    30
 *
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
    31
 * @compile -XDstringConcat=inline ImplicitStringConcatManyLongs.java
35639
f34e7e8b4eac 8148787: StringConcatFactory exactness check produces bad bytecode when a non-arg concat is requested
shade
parents: 35388
diff changeset
    32
 * @run main/othervm -Xverify:all ImplicitStringConcatManyLongs
35388
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
    33
 *
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
    34
 * @compile -XDstringConcat=indy -source 1.9 -target 1.9 ImplicitStringConcatManyLongs.java
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
    35
 *
35639
f34e7e8b4eac 8148787: StringConcatFactory exactness check produces bad bytecode when a non-arg concat is requested
shade
parents: 35388
diff changeset
    36
 * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB                                                              ImplicitStringConcatManyLongs
f34e7e8b4eac 8148787: StringConcatFactory exactness check produces bad bytecode when a non-arg concat is requested
shade
parents: 35388
diff changeset
    37
 * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED                                                        ImplicitStringConcatManyLongs
f34e7e8b4eac 8148787: StringConcatFactory exactness check produces bad bytecode when a non-arg concat is requested
shade
parents: 35388
diff changeset
    38
 * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED                                                        ImplicitStringConcatManyLongs
f34e7e8b4eac 8148787: StringConcatFactory exactness check produces bad bytecode when a non-arg concat is requested
shade
parents: 35388
diff changeset
    39
 * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT                                                  ImplicitStringConcatManyLongs
f34e7e8b4eac 8148787: StringConcatFactory exactness check produces bad bytecode when a non-arg concat is requested
shade
parents: 35388
diff changeset
    40
 * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT                                                  ImplicitStringConcatManyLongs
f34e7e8b4eac 8148787: StringConcatFactory exactness check produces bad bytecode when a non-arg concat is requested
shade
parents: 35388
diff changeset
    41
 * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT                                              ImplicitStringConcatManyLongs
35388
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
    42
 *
35639
f34e7e8b4eac 8148787: StringConcatFactory exactness check produces bad bytecode when a non-arg concat is requested
shade
parents: 35388
diff changeset
    43
 * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB                  -Djava.lang.invoke.stringConcat.debug=true  ImplicitStringConcatManyLongs
f34e7e8b4eac 8148787: StringConcatFactory exactness check produces bad bytecode when a non-arg concat is requested
shade
parents: 35388
diff changeset
    44
 * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED            -Djava.lang.invoke.stringConcat.debug=true  ImplicitStringConcatManyLongs
f34e7e8b4eac 8148787: StringConcatFactory exactness check produces bad bytecode when a non-arg concat is requested
shade
parents: 35388
diff changeset
    45
 * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED            -Djava.lang.invoke.stringConcat.debug=true  ImplicitStringConcatManyLongs
f34e7e8b4eac 8148787: StringConcatFactory exactness check produces bad bytecode when a non-arg concat is requested
shade
parents: 35388
diff changeset
    46
 * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT      -Djava.lang.invoke.stringConcat.debug=true  ImplicitStringConcatManyLongs
f34e7e8b4eac 8148787: StringConcatFactory exactness check produces bad bytecode when a non-arg concat is requested
shade
parents: 35388
diff changeset
    47
 * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT      -Djava.lang.invoke.stringConcat.debug=true  ImplicitStringConcatManyLongs
f34e7e8b4eac 8148787: StringConcatFactory exactness check produces bad bytecode when a non-arg concat is requested
shade
parents: 35388
diff changeset
    48
 * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT  -Djava.lang.invoke.stringConcat.debug=true  ImplicitStringConcatManyLongs
35388
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
    49
 *
35639
f34e7e8b4eac 8148787: StringConcatFactory exactness check produces bad bytecode when a non-arg concat is requested
shade
parents: 35388
diff changeset
    50
 * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB                                                              -Djava.lang.invoke.stringConcat.cache=true  ImplicitStringConcatManyLongs
f34e7e8b4eac 8148787: StringConcatFactory exactness check produces bad bytecode when a non-arg concat is requested
shade
parents: 35388
diff changeset
    51
 * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED                                                        -Djava.lang.invoke.stringConcat.cache=true  ImplicitStringConcatManyLongs
f34e7e8b4eac 8148787: StringConcatFactory exactness check produces bad bytecode when a non-arg concat is requested
shade
parents: 35388
diff changeset
    52
 * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED                                                        -Djava.lang.invoke.stringConcat.cache=true  ImplicitStringConcatManyLongs
f34e7e8b4eac 8148787: StringConcatFactory exactness check produces bad bytecode when a non-arg concat is requested
shade
parents: 35388
diff changeset
    53
 * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT                                                  -Djava.lang.invoke.stringConcat.cache=true  ImplicitStringConcatManyLongs
f34e7e8b4eac 8148787: StringConcatFactory exactness check produces bad bytecode when a non-arg concat is requested
shade
parents: 35388
diff changeset
    54
 * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT                                                  -Djava.lang.invoke.stringConcat.cache=true  ImplicitStringConcatManyLongs
f34e7e8b4eac 8148787: StringConcatFactory exactness check produces bad bytecode when a non-arg concat is requested
shade
parents: 35388
diff changeset
    55
 * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT                                              -Djava.lang.invoke.stringConcat.cache=true  ImplicitStringConcatManyLongs
35388
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
    56
35639
f34e7e8b4eac 8148787: StringConcatFactory exactness check produces bad bytecode when a non-arg concat is requested
shade
parents: 35388
diff changeset
    57
 * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB                  -Djava.lang.invoke.stringConcat.debug=true  -Djava.lang.invoke.stringConcat.cache=true  ImplicitStringConcatManyLongs
f34e7e8b4eac 8148787: StringConcatFactory exactness check produces bad bytecode when a non-arg concat is requested
shade
parents: 35388
diff changeset
    58
 * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED            -Djava.lang.invoke.stringConcat.debug=true  -Djava.lang.invoke.stringConcat.cache=true  ImplicitStringConcatManyLongs
f34e7e8b4eac 8148787: StringConcatFactory exactness check produces bad bytecode when a non-arg concat is requested
shade
parents: 35388
diff changeset
    59
 * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED            -Djava.lang.invoke.stringConcat.debug=true  -Djava.lang.invoke.stringConcat.cache=true  ImplicitStringConcatManyLongs
f34e7e8b4eac 8148787: StringConcatFactory exactness check produces bad bytecode when a non-arg concat is requested
shade
parents: 35388
diff changeset
    60
 * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT      -Djava.lang.invoke.stringConcat.debug=true  -Djava.lang.invoke.stringConcat.cache=true  ImplicitStringConcatManyLongs
f34e7e8b4eac 8148787: StringConcatFactory exactness check produces bad bytecode when a non-arg concat is requested
shade
parents: 35388
diff changeset
    61
 * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT      -Djava.lang.invoke.stringConcat.debug=true  -Djava.lang.invoke.stringConcat.cache=true  ImplicitStringConcatManyLongs
f34e7e8b4eac 8148787: StringConcatFactory exactness check produces bad bytecode when a non-arg concat is requested
shade
parents: 35388
diff changeset
    62
 * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT  -Djava.lang.invoke.stringConcat.debug=true  -Djava.lang.invoke.stringConcat.cache=true  ImplicitStringConcatManyLongs
35388
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
    63
 *
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
    64
 * @compile -XDstringConcat=indyWithConstants -source 1.9 -target 1.9 ImplicitStringConcatManyLongs.java
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
    65
 *
35639
f34e7e8b4eac 8148787: StringConcatFactory exactness check produces bad bytecode when a non-arg concat is requested
shade
parents: 35388
diff changeset
    66
 * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB                                                              ImplicitStringConcatManyLongs
f34e7e8b4eac 8148787: StringConcatFactory exactness check produces bad bytecode when a non-arg concat is requested
shade
parents: 35388
diff changeset
    67
 * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED                                                        ImplicitStringConcatManyLongs
f34e7e8b4eac 8148787: StringConcatFactory exactness check produces bad bytecode when a non-arg concat is requested
shade
parents: 35388
diff changeset
    68
 * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED                                                        ImplicitStringConcatManyLongs
f34e7e8b4eac 8148787: StringConcatFactory exactness check produces bad bytecode when a non-arg concat is requested
shade
parents: 35388
diff changeset
    69
 * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT                                                  ImplicitStringConcatManyLongs
f34e7e8b4eac 8148787: StringConcatFactory exactness check produces bad bytecode when a non-arg concat is requested
shade
parents: 35388
diff changeset
    70
 * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT                                                  ImplicitStringConcatManyLongs
f34e7e8b4eac 8148787: StringConcatFactory exactness check produces bad bytecode when a non-arg concat is requested
shade
parents: 35388
diff changeset
    71
 * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT                                              ImplicitStringConcatManyLongs
35388
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
    72
 *
35639
f34e7e8b4eac 8148787: StringConcatFactory exactness check produces bad bytecode when a non-arg concat is requested
shade
parents: 35388
diff changeset
    73
 * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB                  -Djava.lang.invoke.stringConcat.debug=true  ImplicitStringConcatManyLongs
f34e7e8b4eac 8148787: StringConcatFactory exactness check produces bad bytecode when a non-arg concat is requested
shade
parents: 35388
diff changeset
    74
 * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED            -Djava.lang.invoke.stringConcat.debug=true  ImplicitStringConcatManyLongs
f34e7e8b4eac 8148787: StringConcatFactory exactness check produces bad bytecode when a non-arg concat is requested
shade
parents: 35388
diff changeset
    75
 * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED            -Djava.lang.invoke.stringConcat.debug=true  ImplicitStringConcatManyLongs
f34e7e8b4eac 8148787: StringConcatFactory exactness check produces bad bytecode when a non-arg concat is requested
shade
parents: 35388
diff changeset
    76
 * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT      -Djava.lang.invoke.stringConcat.debug=true  ImplicitStringConcatManyLongs
f34e7e8b4eac 8148787: StringConcatFactory exactness check produces bad bytecode when a non-arg concat is requested
shade
parents: 35388
diff changeset
    77
 * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT      -Djava.lang.invoke.stringConcat.debug=true  ImplicitStringConcatManyLongs
f34e7e8b4eac 8148787: StringConcatFactory exactness check produces bad bytecode when a non-arg concat is requested
shade
parents: 35388
diff changeset
    78
 * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT  -Djava.lang.invoke.stringConcat.debug=true  ImplicitStringConcatManyLongs
35388
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
    79
 *
35639
f34e7e8b4eac 8148787: StringConcatFactory exactness check produces bad bytecode when a non-arg concat is requested
shade
parents: 35388
diff changeset
    80
 * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB                                                              -Djava.lang.invoke.stringConcat.cache=true  ImplicitStringConcatManyLongs
f34e7e8b4eac 8148787: StringConcatFactory exactness check produces bad bytecode when a non-arg concat is requested
shade
parents: 35388
diff changeset
    81
 * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED                                                        -Djava.lang.invoke.stringConcat.cache=true  ImplicitStringConcatManyLongs
f34e7e8b4eac 8148787: StringConcatFactory exactness check produces bad bytecode when a non-arg concat is requested
shade
parents: 35388
diff changeset
    82
 * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED                                                        -Djava.lang.invoke.stringConcat.cache=true  ImplicitStringConcatManyLongs
f34e7e8b4eac 8148787: StringConcatFactory exactness check produces bad bytecode when a non-arg concat is requested
shade
parents: 35388
diff changeset
    83
 * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT                                                  -Djava.lang.invoke.stringConcat.cache=true  ImplicitStringConcatManyLongs
f34e7e8b4eac 8148787: StringConcatFactory exactness check produces bad bytecode when a non-arg concat is requested
shade
parents: 35388
diff changeset
    84
 * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT                                                  -Djava.lang.invoke.stringConcat.cache=true  ImplicitStringConcatManyLongs
f34e7e8b4eac 8148787: StringConcatFactory exactness check produces bad bytecode when a non-arg concat is requested
shade
parents: 35388
diff changeset
    85
 * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT                                              -Djava.lang.invoke.stringConcat.cache=true  ImplicitStringConcatManyLongs
35388
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
    86
 *
35639
f34e7e8b4eac 8148787: StringConcatFactory exactness check produces bad bytecode when a non-arg concat is requested
shade
parents: 35388
diff changeset
    87
 * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB                  -Djava.lang.invoke.stringConcat.debug=true  -Djava.lang.invoke.stringConcat.cache=true  ImplicitStringConcatManyLongs
f34e7e8b4eac 8148787: StringConcatFactory exactness check produces bad bytecode when a non-arg concat is requested
shade
parents: 35388
diff changeset
    88
 * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED            -Djava.lang.invoke.stringConcat.debug=true  -Djava.lang.invoke.stringConcat.cache=true  ImplicitStringConcatManyLongs
f34e7e8b4eac 8148787: StringConcatFactory exactness check produces bad bytecode when a non-arg concat is requested
shade
parents: 35388
diff changeset
    89
 * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED            -Djava.lang.invoke.stringConcat.debug=true  -Djava.lang.invoke.stringConcat.cache=true  ImplicitStringConcatManyLongs
f34e7e8b4eac 8148787: StringConcatFactory exactness check produces bad bytecode when a non-arg concat is requested
shade
parents: 35388
diff changeset
    90
 * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT      -Djava.lang.invoke.stringConcat.debug=true  -Djava.lang.invoke.stringConcat.cache=true  ImplicitStringConcatManyLongs
f34e7e8b4eac 8148787: StringConcatFactory exactness check produces bad bytecode when a non-arg concat is requested
shade
parents: 35388
diff changeset
    91
 * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT      -Djava.lang.invoke.stringConcat.debug=true  -Djava.lang.invoke.stringConcat.cache=true  ImplicitStringConcatManyLongs
f34e7e8b4eac 8148787: StringConcatFactory exactness check produces bad bytecode when a non-arg concat is requested
shade
parents: 35388
diff changeset
    92
 * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT  -Djava.lang.invoke.stringConcat.debug=true  -Djava.lang.invoke.stringConcat.cache=true  ImplicitStringConcatManyLongs
35388
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
    93
*/
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
    94
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
    95
import java.lang.reflect.Field;
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
    96
import java.lang.reflect.Modifier;
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
    97
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
    98
public class ImplicitStringConcatManyLongs {
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
    99
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
   100
    static long s000, s001, s002, s003, s004, s005, s006, s007, s008, s009;
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
   101
    static long s010, s011, s012, s013, s014, s015, s016, s017, s018, s019;
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
   102
    static long s020, s021, s022, s023, s024, s025, s026, s027, s028, s029;
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
   103
    static long s030, s031, s032, s033, s034, s035, s036, s037, s038, s039;
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
   104
    static long s040, s041, s042, s043, s044, s045, s046, s047, s048, s049;
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
   105
    static long s050, s051, s052, s053, s054, s055, s056, s057, s058, s059;
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
   106
    static long s060, s061, s062, s063, s064, s065, s066, s067, s068, s069;
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
   107
    static long s070, s071, s072, s073, s074, s075, s076, s077, s078, s079;
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
   108
    static long s080, s081, s082, s083, s084, s085, s086, s087, s088, s089;
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
   109
    static long s090, s091, s092, s093, s094, s095, s096, s097, s098, s099;
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
   110
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
   111
    static long s100, s101, s102, s103, s104, s105, s106, s107, s108, s109;
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
   112
    static long s110, s111, s112, s113, s114, s115, s116, s117, s118, s119;
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
   113
    static long s120, s121, s122, s123, s124, s125, s126, s127, s128, s129;
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
   114
    static long s130, s131, s132, s133, s134, s135, s136, s137, s138, s139;
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
   115
    static long s140, s141, s142, s143, s144, s145, s146, s147, s148, s149;
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
   116
    static long s150, s151, s152, s153, s154, s155, s156, s157, s158, s159;
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
   117
    static long s160, s161, s162, s163, s164, s165, s166, s167, s168, s169;
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
   118
    static long s170, s171, s172, s173, s174, s175, s176, s177, s178, s179;
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
   119
    static long s180, s181, s182, s183, s184, s185, s186, s187, s188, s189;
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
   120
    static long s190, s191, s192, s193, s194, s195, s196, s197, s198, s199;
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
   121
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
   122
    static long s200, s201, s202, s203, s204, s205, s206, s207, s208, s209;
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
   123
    static long s210, s211, s212, s213, s214, s215, s216, s217, s218, s219;
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
   124
    static long s220, s221, s222, s223, s224, s225, s226, s227, s228, s229;
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
   125
    static long s230, s231, s232, s233, s234, s235, s236, s237, s238, s239;
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
   126
    static long s240, s241, s242, s243, s244, s245, s246, s247, s248, s249;
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
   127
    static long s250, s251, s252, s253, s254, s255, s256, s257, s258, s259;
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
   128
    static long s260, s261, s262, s263, s264, s265, s266, s267, s268, s269;
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
   129
    static long s270, s271, s272, s273, s274, s275, s276, s277, s278, s279;
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
   130
    static long s280, s281, s282, s283, s284, s285, s286, s287, s288, s289;
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
   131
    static long s290, s291, s292, s293, s294, s295, s296, s297, s298, s299;
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
   132
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
   133
    static {
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
   134
        for (Field f : ImplicitStringConcatManyLongs.class.getDeclaredFields()) {
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
   135
            if (Modifier.isStatic(f.getModifiers())) {
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
   136
                String name = f.getName();
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
   137
                try {
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
   138
                    f.set(null, Long.valueOf(name.substring(1)));
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
   139
                } catch (IllegalAccessException e) {
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
   140
                    throw new IllegalStateException(e);
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
   141
                }
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
   142
            }
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
   143
        }
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
   144
    }
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
   145
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
   146
    public static void main(String[] args) throws Exception {
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
   147
        String res = "" +
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
   148
            s000 + s001 + s002 + s003 + s004 + s005 + s006 + s007 + s008 + s009 +
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
   149
            s010 + s011 + s012 + s013 + s014 + s015 + s016 + s017 + s018 + s019 +
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
   150
            s020 + s021 + s022 + s023 + s024 + s025 + s026 + s027 + s028 + s029 +
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
   151
            s030 + s031 + s032 + s033 + s034 + s035 + s036 + s037 + s038 + s039 +
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
   152
            s040 + s041 + s042 + s043 + s044 + s045 + s046 + s047 + s048 + s049 +
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
   153
            s050 + s051 + s052 + s053 + s054 + s055 + s056 + s057 + s058 + s059 +
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
   154
            s060 + s061 + s062 + s063 + s064 + s065 + s066 + s067 + s068 + s069 +
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
   155
            s070 + s071 + s072 + s073 + s074 + s075 + s076 + s077 + s078 + s079 +
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
   156
            s080 + s081 + s082 + s083 + s084 + s085 + s086 + s087 + s088 + s089 +
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
   157
            s090 + s091 + s092 + s093 + s094 + s095 + s096 + s097 + s098 + s099 +
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
   158
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
   159
            s100 + s101 + s102 + s103 + s104 + s105 + s106 + s107 + s108 + s109 +
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
   160
            s110 + s111 + s112 + s113 + s114 + s115 + s116 + s117 + s118 + s119 +
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
   161
            s120 + s121 + s122 + s123 + s124 + s125 + s126 + s127 + s128 + s129 +
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
   162
            s130 + s131 + s132 + s133 + s134 + s135 + s136 + s137 + s138 + s139 +
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
   163
            s140 + s141 + s142 + s143 + s144 + s145 + s146 + s147 + s148 + s149 +
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
   164
            s150 + s151 + s152 + s153 + s154 + s155 + s156 + s157 + s158 + s159 +
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
   165
            s160 + s161 + s162 + s163 + s164 + s165 + s166 + s167 + s168 + s169 +
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
   166
            s170 + s171 + s172 + s173 + s174 + s175 + s176 + s177 + s178 + s179 +
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
   167
            s180 + s181 + s182 + s183 + s184 + s185 + s186 + s187 + s188 + s189 +
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
   168
            s190 + s191 + s192 + s193 + s194 + s195 + s196 + s197 + s198 + s199 +
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
   169
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
   170
            s200 + s201 + s202 + s203 + s204 + s205 + s206 + s207 + s208 + s209 +
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
   171
            s210 + s211 + s212 + s213 + s214 + s215 + s216 + s217 + s218 + s219 +
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
   172
            s220 + s221 + s222 + s223 + s224 + s225 + s226 + s227 + s228 + s229 +
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
   173
            s230 + s231 + s232 + s233 + s234 + s235 + s236 + s237 + s238 + s239 +
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
   174
            s240 + s241 + s242 + s243 + s244 + s245 + s246 + s247 + s248 + s249 +
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
   175
            s250 + s251 + s252 + s253 + s254 + s255 + s256 + s257 + s258 + s259 +
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
   176
            s260 + s261 + s262 + s263 + s264 + s265 + s266 + s267 + s268 + s269 +
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
   177
            s270 + s271 + s272 + s273 + s274 + s275 + s276 + s277 + s278 + s279 +
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
   178
            s280 + s281 + s282 + s283 + s284 + s285 + s286 + s287 + s288 + s289 +
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
   179
            s290 + s291 + s292 + s293 + s294 + s295 + s296 + s297 + s298 + s299;
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
   180
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
   181
       StringBuilder sb = new StringBuilder();
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
   182
       for (int c = 0; c < 300; c++) {
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
   183
            sb.append(c);
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
   184
       }
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
   185
       test(sb.toString(), res);
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
   186
    }
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
   187
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
   188
    public static void test(String expected, String actual) {
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
   189
       // Fingers crossed: String concat should work.
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
   190
       if (!expected.equals(actual)) {
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
   191
          throw new IllegalStateException("Expected = " + expected + ", actual = " + actual);
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
   192
       }
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
   193
    }
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
   194
}
a33a232cf7b7 8148483: JEP 280: Indify String Concatenation
shade
parents:
diff changeset
   195