2424/*
2525 * @test
2626 * @bug 8150669
27+ * @bug 8233019
2728 * @summary C1 intrinsic for Class.isPrimitive
2829 *
2930 * @run main/othervm -ea -Diters=200 -Xint TestIsPrimitive
30- * @run main/othervm -ea -Diters=30000 -XX:TieredStopAtLevel=1 TestIsPrimitive
31+ * @run main/othervm -ea -Diters=30000 -XX:-UseSharedSpaces
32+ -XX:TieredStopAtLevel=1 TestIsPrimitive
3133 * @run main/othervm -ea -Diters=30000 -XX:TieredStopAtLevel=4 TestIsPrimitive
3234 */
3335import java .lang .reflect .Field ;
@@ -48,6 +50,7 @@ public static void main(String... args) throws Exception {
4850 testOK (true , InlineConstants ::testDouble );
4951 testOK (false , InlineConstants ::testObject );
5052 testOK (false , InlineConstants ::testArray );
53+ testOK (false , InlineConstants ::testBooleanArray );
5154
5255 testOK (true , StaticConstants ::testBoolean );
5356 testOK (true , StaticConstants ::testByte );
@@ -59,6 +62,7 @@ public static void main(String... args) throws Exception {
5962 testOK (true , StaticConstants ::testDouble );
6063 testOK (false , StaticConstants ::testObject );
6164 testOK (false , StaticConstants ::testArray );
65+ testOK (false , StaticConstants ::testBooleanArray );
6266 testNPE ( StaticConstants ::testNull );
6367
6468 testOK (true , NoConstants ::testBoolean );
@@ -71,6 +75,7 @@ public static void main(String... args) throws Exception {
7175 testOK (true , NoConstants ::testDouble );
7276 testOK (false , NoConstants ::testObject );
7377 testOK (false , NoConstants ::testArray );
78+ testOK (false , NoConstants ::testBooleanArray );
7479 testNPE ( NoConstants ::testNull );
7580 }
7681
@@ -107,6 +112,7 @@ public static void testNPE(Callable<Object> test) throws Exception {
107112 static volatile Class <?> classObject = Object .class ;
108113 static volatile Class <?> classArray = Object [].class ;
109114 static volatile Class <?> classNull = null ;
115+ static volatile Class <?> classBooleanArray = boolean [].class ;
110116
111117 static final Class <?> staticClassBoolean = boolean .class ;
112118 static final Class <?> staticClassByte = byte .class ;
@@ -119,6 +125,7 @@ public static void testNPE(Callable<Object> test) throws Exception {
119125 static final Class <?> staticClassObject = Object .class ;
120126 static final Class <?> staticClassArray = Object [].class ;
121127 static final Class <?> staticClassNull = null ;
128+ static final Class <?> staticClassBooleanArray = boolean [].class ;
122129
123130 static class InlineConstants {
124131 static boolean testBoolean () { return boolean .class .isPrimitive (); }
@@ -131,6 +138,7 @@ static class InlineConstants {
131138 static boolean testDouble () { return double .class .isPrimitive (); }
132139 static boolean testObject () { return Object .class .isPrimitive (); }
133140 static boolean testArray () { return Object [].class .isPrimitive (); }
141+ static boolean testBooleanArray () { return boolean [].class .isPrimitive (); }
134142 }
135143
136144 static class StaticConstants {
@@ -145,6 +153,7 @@ static class StaticConstants {
145153 static boolean testObject () { return staticClassObject .isPrimitive (); }
146154 static boolean testArray () { return staticClassArray .isPrimitive (); }
147155 static boolean testNull () { return staticClassNull .isPrimitive (); }
156+ static boolean testBooleanArray () { return staticClassBooleanArray .isPrimitive (); }
148157 }
149158
150159 static class NoConstants {
@@ -159,6 +168,7 @@ static class NoConstants {
159168 static boolean testObject () { return classObject .isPrimitive (); }
160169 static boolean testArray () { return classArray .isPrimitive (); }
161170 static boolean testNull () { return classNull .isPrimitive (); }
171+ static boolean testBooleanArray () { return classBooleanArray .isPrimitive (); }
162172 }
163173
164174}
0 commit comments