< prev index next >

test/hotspot/jtreg/compiler/c2/irTests/stringopts/TestArrayCopySelect.java

Print this page

 44 
 45     public static String output_strU;
 46     public static char[] output_arrU;
 47 
 48     public static void main(String[] args) {
 49         TestFramework.runWithFlags("-XX:-UseCompactObjectHeaders",
 50                                    "-XX:-CompactStrings",
 51                                    "-XX:CompileCommand=inline,java.lang.StringBuilder::toString",
 52                                    "-XX:CompileCommand=inline,java.lang.StringUTF16::getChars",
 53                                    "-XX:CompileCommand=inline,java.lang.StringUTF16::toBytes");
 54 
 55         TestFramework.runWithFlags("-XX:+UseCompactObjectHeaders",
 56                                    "-XX:-CompactStrings",
 57                                    "-XX:CompileCommand=inline,java.lang.StringBuilder::toString",
 58                                    "-XX:CompileCommand=inline,java.lang.StringUTF16::getChars",
 59                                    "-XX:CompileCommand=inline,java.lang.StringUTF16::toBytes");
 60     }
 61 
 62     @Test
 63     @Warmup(10000)
 64     @IR(applyIf = {"UseCompactObjectHeaders", "false"},
 65         counts = {IRNode.CALL_OF, "arrayof_jshort_disjoint_arraycopy", ">0"})
 66     static void testSBToStringAligned() {
 67         // Exercise the StringBuilder.toString API
 68         StringBuilder sb = new StringBuilder(input_strU);
 69         output_strU = sb.append(input_strU).toString();
 70     }
 71 
 72     @Test
 73     @Warmup(10000)
 74     @IR(applyIf = {"UseCompactObjectHeaders", "true"},
 75         counts = {IRNode.CALL_OF, "arrayof_jshort_disjoint_arraycopy", "0"})
 76     static void testSBToStringUnAligned() {
 77         // Exercise the StringBuilder.toString API
 78         StringBuilder sb = new StringBuilder(input_strU);
 79         output_strU = sb.append(input_strU).toString();
 80     }
 81 
 82     @Test
 83     @Warmup(10000)
 84     @IR(applyIf = {"UseCompactObjectHeaders", "false"},
 85         counts = {IRNode.CALL_OF, "arrayof_jshort_disjoint_arraycopy", ">0"})
 86     static void testStrUGetCharsAligned() {
 87         // Exercise the StringUTF16.getChars API
 88         output_arrU = input_strU.toCharArray();
 89     }
 90 
 91     @Test
 92     @Warmup(10000)
 93     @IR(applyIf = {"UseCompactObjectHeaders", "true"},
 94         counts = {IRNode.CALL_OF, "arrayof_jshort_disjoint_arraycopy", "0"})
 95     static void testStrUGetCharsUnAligned() {
 96         // Exercise the StringUTF16.getChars API
 97         output_arrU = input_strU.toCharArray();
 98     }
 99 
100     @Test
101     @Warmup(10000)
102     @IR(applyIf = {"UseCompactObjectHeaders", "false"},
103         counts = {IRNode.CALL_OF, "arrayof_jshort_disjoint_arraycopy", ">0"})
104     static void testStrUtoBytesAligned() {
105         // Exercise the StringUTF16.toBytes API
106         output_strU = String.valueOf(input_arrU);
107     }
108 
109     @Test
110     @Warmup(10000)
111     @IR(applyIf = {"UseCompactObjectHeaders", "true"},
112         counts = {IRNode.CALL_OF, "arrayof_jshort_disjoint_arraycopy", "0"})
113     static void testStrUtoBytesUnAligned() {
114         // Exercise the StringUTF16.toBytes API
115         output_strU = String.valueOf(input_arrU);
116     }
117 
118 }

 44 
 45     public static String output_strU;
 46     public static char[] output_arrU;
 47 
 48     public static void main(String[] args) {
 49         TestFramework.runWithFlags("-XX:-UseCompactObjectHeaders",
 50                                    "-XX:-CompactStrings",
 51                                    "-XX:CompileCommand=inline,java.lang.StringBuilder::toString",
 52                                    "-XX:CompileCommand=inline,java.lang.StringUTF16::getChars",
 53                                    "-XX:CompileCommand=inline,java.lang.StringUTF16::toBytes");
 54 
 55         TestFramework.runWithFlags("-XX:+UseCompactObjectHeaders",
 56                                    "-XX:-CompactStrings",
 57                                    "-XX:CompileCommand=inline,java.lang.StringBuilder::toString",
 58                                    "-XX:CompileCommand=inline,java.lang.StringUTF16::getChars",
 59                                    "-XX:CompileCommand=inline,java.lang.StringUTF16::toBytes");
 60     }
 61 
 62     @Test
 63     @Warmup(10000)
 64     @IR(counts = {IRNode.CALL_OF, "arrayof_jshort_disjoint_arraycopy", ">0"})

 65     static void testSBToStringAligned() {
 66         // Exercise the StringBuilder.toString API
 67         StringBuilder sb = new StringBuilder(input_strU);
 68         output_strU = sb.append(input_strU).toString();
 69     }
 70 
 71     @Test
 72     @Warmup(10000)
 73     @IR(counts = {IRNode.CALL_OF, "arrayof_jshort_disjoint_arraycopy", ">0"})











 74     static void testStrUGetCharsAligned() {
 75         // Exercise the StringUTF16.getChars API
 76         output_arrU = input_strU.toCharArray();
 77     }
 78 
 79     @Test
 80     @Warmup(10000)
 81     @IR(counts = {IRNode.CALL_OF, "arrayof_jshort_disjoint_arraycopy", ">0"})










 82     static void testStrUtoBytesAligned() {
 83         // Exercise the StringUTF16.toBytes API
 84         output_strU = String.valueOf(input_arrU);
 85     }
 86 









 87 }
< prev index next >