10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 /*
26 * @test
27 * @bug 8150669
28 * @summary C1 intrinsic for Class.isPrimitive
29 * @modules java.base/jdk.internal.misc
30 * @run main/othervm -ea -Diters=200 -Xint TestClassIsPrimitive
31 * @run main/othervm -ea -Diters=30000 -XX:TieredStopAtLevel=1 TestClassIsPrimitive
32 * @run main/othervm -ea -Diters=30000 -XX:TieredStopAtLevel=4 TestClassIsPrimitive
33 */
34 import java.lang.reflect.Field;
35 import java.lang.reflect.Array;
36 import java.util.concurrent.Callable;
37
38 public class TestClassIsPrimitive {
39 static final int ITERS = Integer.getInteger("iters", 1);
40
41 public static void main(String... args) throws Exception {
42 testOK(true, InlineConstants::testBoolean);
43 testOK(true, InlineConstants::testByte);
44 testOK(true, InlineConstants::testShort);
45 testOK(true, InlineConstants::testChar);
46 testOK(true, InlineConstants::testInt);
47 testOK(true, InlineConstants::testFloat);
48 testOK(true, InlineConstants::testLong);
49 testOK(true, InlineConstants::testDouble);
50 testOK(false, InlineConstants::testObject);
51 testOK(false, InlineConstants::testArray);
52
53 testOK(true, StaticConstants::testBoolean);
54 testOK(true, StaticConstants::testByte);
55 testOK(true, StaticConstants::testShort);
56 testOK(true, StaticConstants::testChar);
57 testOK(true, StaticConstants::testInt);
58 testOK(true, StaticConstants::testFloat);
|
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 /*
26 * @test
27 * @bug 8150669
28 * @summary C1 intrinsic for Class.isPrimitive
29 * @modules java.base/jdk.internal.misc
30 *
31 * @run main/othervm -ea -Diters=200 -Xint
32 * compiler.intrinsics.klass.TestIsPrimitive
33 * @run main/othervm -ea -Diters=30000 -XX:TieredStopAtLevel=1
34 * compiler.intrinsics.klass.TestIsPrimitive
35 * @run main/othervm -ea -Diters=30000 -XX:TieredStopAtLevel=4
36 * compiler.intrinsics.klass.TestIsPrimitive
37 */
38
39 package compiler.intrinsics.klass;
40
41 import java.util.concurrent.Callable;
42
43 public class TestIsPrimitive {
44 static final int ITERS = Integer.getInteger("iters", 1);
45
46 public static void main(String... args) throws Exception {
47 testOK(true, InlineConstants::testBoolean);
48 testOK(true, InlineConstants::testByte);
49 testOK(true, InlineConstants::testShort);
50 testOK(true, InlineConstants::testChar);
51 testOK(true, InlineConstants::testInt);
52 testOK(true, InlineConstants::testFloat);
53 testOK(true, InlineConstants::testLong);
54 testOK(true, InlineConstants::testDouble);
55 testOK(false, InlineConstants::testObject);
56 testOK(false, InlineConstants::testArray);
57
58 testOK(true, StaticConstants::testBoolean);
59 testOK(true, StaticConstants::testByte);
60 testOK(true, StaticConstants::testShort);
61 testOK(true, StaticConstants::testChar);
62 testOK(true, StaticConstants::testInt);
63 testOK(true, StaticConstants::testFloat);
|