1 /* |
1 /* |
2 * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2009, 2015, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. |
7 * published by the Free Software Foundation. |
23 |
23 |
24 /** |
24 /** |
25 * @test |
25 * @test |
26 * @bug 6823354 |
26 * @bug 6823354 |
27 * @summary These methods can be instrinsified by using bit scan, bit test, and population count instructions. |
27 * @summary These methods can be instrinsified by using bit scan, bit test, and population count instructions. |
28 * |
28 * @library /testlibrary |
29 * @run main/othervm -Xcomp -XX:CompileOnly=Test6823354.lzcomp,Test6823354.tzcomp,.dolzcomp,.dotzcomp Test6823354 |
29 * @run main/othervm -Xcomp -XX:CompileOnly=Test6823354.lzcomp,Test6823354.tzcomp,.dolzcomp,.dotzcomp Test6823354 |
30 */ |
30 */ |
31 |
31 |
32 import java.net.URLClassLoader; |
32 import jdk.test.lib.Utils; |
33 |
33 |
34 public class Test6823354 { |
34 public class Test6823354 { |
35 // Arrays of corner case values. |
35 // Arrays of corner case values. |
36 static final int[] ia = new int[] { 0, 1, -1, Integer.MIN_VALUE, Integer.MAX_VALUE }; |
36 static final int[] ia = new int[] { 0, 1, -1, Integer.MIN_VALUE, Integer.MAX_VALUE }; |
37 static final long[] la = new long[] { 0L, 1L, -1L, Long.MIN_VALUE, Long.MAX_VALUE }; |
37 static final long[] la = new long[] { 0L, 1L, -1L, Long.MIN_VALUE, Long.MAX_VALUE }; |
195 loadandrunclass(classname); |
195 loadandrunclass(classname); |
196 } |
196 } |
197 |
197 |
198 static void loadandrunclass(String classname) throws Exception { |
198 static void loadandrunclass(String classname) throws Exception { |
199 Class cl = Class.forName(classname); |
199 Class cl = Class.forName(classname); |
200 URLClassLoader apploader = (URLClassLoader) cl.getClassLoader(); |
200 ClassLoader apploader = cl.getClassLoader(); |
201 ClassLoader loader = new URLClassLoader(apploader.getURLs(), apploader.getParent()); |
201 ClassLoader loader |
|
202 = Utils.getTestClassPathURLClassLoader(apploader.getParent()); |
202 Class c = loader.loadClass(classname); |
203 Class c = loader.loadClass(classname); |
203 Runnable r = (Runnable) c.newInstance(); |
204 Runnable r = (Runnable) c.newInstance(); |
204 r.run(); |
205 r.run(); |
205 } |
206 } |
206 |
207 |