8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
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 * @test
26 * @bug 8067247
27 * @modules java.base/jdk.internal.misc
28 * @library /test/lib /
29 * @run main/bootclasspath/othervm -Xcomp -Xbatch
30 * -XX:CompileCommand=compileonly,InvokerGC::test
31 * -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
32 * InvokerGC
33 */
34
35 import java.lang.invoke.*;
36 import sun.hotspot.WhiteBox;
37
38 public class InvokerGC {
39 static final WhiteBox WB = WhiteBox.getWhiteBox();
40
41 static MethodHandle mh;
42 static {
43 try {
44 mh = MethodHandles.lookup().findStatic(InvokerGC.class, "dummy", MethodType.methodType(void.class));
45 } catch (Exception e) {
46 throw new Error(e);
47 }
48 }
49
50 static void dummy() {}
51
52 static void test() {
53 try {
54 mh.invoke();
55 } catch (Throwable e) {
56 throw new Error(e);
57 }
|
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
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 * @test
26 * @bug 8067247
27 * @modules java.base/jdk.internal.misc
28 * @library /test/lib
29 *
30 * @run main/bootclasspath/othervm -Xcomp -Xbatch
31 * -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
32 * -XX:CompileCommand=compileonly,compiler.jsr292.InvokerGC::test
33 * compiler.jsr292.InvokerGC
34 */
35
36 package compiler.jsr292;
37
38 import sun.hotspot.WhiteBox;
39
40 import java.lang.invoke.MethodHandle;
41 import java.lang.invoke.MethodHandles;
42 import java.lang.invoke.MethodType;
43
44 public class InvokerGC {
45 static final WhiteBox WB = WhiteBox.getWhiteBox();
46
47 static MethodHandle mh;
48 static {
49 try {
50 mh = MethodHandles.lookup().findStatic(InvokerGC.class, "dummy", MethodType.methodType(void.class));
51 } catch (Exception e) {
52 throw new Error(e);
53 }
54 }
55
56 static void dummy() {}
57
58 static void test() {
59 try {
60 mh.invoke();
61 } catch (Throwable e) {
62 throw new Error(e);
63 }
|