1 /*
2 * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
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
7 * published by the Free Software Foundation.
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 import java.lang.invoke.MethodHandle;
26 import java.lang.invoke.MethodHandleHelper;
27 import java.lang.invoke.MethodType;
28 import sun.invoke.util.Wrapper;
29 import java.util.Arrays;
30 import java.util.Collections;
31 import com.oracle.testlibrary.jsr292.CodeCacheOverflowProcessor;
32
33 /* @test
34 * @summary unit tests for varargs array methods: MethodHandleInfo.varargsArray(int),
35 * MethodHandleInfo.varargsArray(Class,int) & MethodHandleInfo.varargsList(int)
36 * @modules java.base/sun.invoke.util
37 * @library /lib/testlibrary /lib/testlibrary/jsr292
38 * @compile/module=java.base java/lang/invoke/MethodHandleHelper.java
39 * @run main/bootclasspath VarargsArrayTest
40 * @run main/bootclasspath/othervm -DVarargsArrayTest.MAX_ARITY=255 -DVarargsArrayTest.START_ARITY=250
41 * VarargsArrayTest
42 */
43
44 /* This might take a while and burn lots of metadata:
45 * @run main/bootclasspath -DVarargsArrayTest.MAX_ARITY=255 -DVarargsArrayTest.EXHAUSTIVE=true VarargsArrayTest
46 */
47 public class VarargsArrayTest {
48 private static final Class<?> CLASS = VarargsArrayTest.class;
49 private static final int MAX_ARITY = Integer.getInteger(CLASS.getSimpleName()+".MAX_ARITY", 40);
50 private static final int START_ARITY = Integer.getInteger(CLASS.getSimpleName()+".START_ARITY", 0);
51 private static final boolean EXHAUSTIVE = Boolean.getBoolean(CLASS.getSimpleName()+".EXHAUSTIVE");
52
53 public static void main(String[] args) throws Throwable {
54 CodeCacheOverflowProcessor.runMHTest(VarargsArrayTest::test);
55 }
56
57 public static void test() throws Throwable {
|
1 /*
2 * Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
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
7 * published by the Free Software Foundation.
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 import sun.invoke.util.Wrapper;
25 import test.java.lang.invoke.lib.CodeCacheOverflowProcessor;
26
27 import java.lang.invoke.MethodHandle;
28 import java.lang.invoke.MethodHandleHelper;
29 import java.lang.invoke.MethodType;
30 import java.util.Arrays;
31 import java.util.Collections;
32
33 /* @test
34 * @summary unit tests for varargs array methods: MethodHandleInfo.varargsArray(int),
35 * MethodHandleInfo.varargsArray(Class,int) & MethodHandleInfo.varargsList(int)
36 * @modules java.base/sun.invoke.util
37 * @library /lib/testlibrary /java/lang/invoke/common
38 * @compile/module=java.base java/lang/invoke/MethodHandleHelper.java
39 * @run main/bootclasspath VarargsArrayTest
40 * @run main/bootclasspath/othervm -DVarargsArrayTest.MAX_ARITY=255 -DVarargsArrayTest.START_ARITY=250
41 * VarargsArrayTest
42 */
43
44 /* This might take a while and burn lots of metadata:
45 * @run main/bootclasspath -DVarargsArrayTest.MAX_ARITY=255 -DVarargsArrayTest.EXHAUSTIVE=true VarargsArrayTest
46 */
47 public class VarargsArrayTest {
48 private static final Class<?> CLASS = VarargsArrayTest.class;
49 private static final int MAX_ARITY = Integer.getInteger(CLASS.getSimpleName()+".MAX_ARITY", 40);
50 private static final int START_ARITY = Integer.getInteger(CLASS.getSimpleName()+".START_ARITY", 0);
51 private static final boolean EXHAUSTIVE = Boolean.getBoolean(CLASS.getSimpleName()+".EXHAUSTIVE");
52
53 public static void main(String[] args) throws Throwable {
54 CodeCacheOverflowProcessor.runMHTest(VarargsArrayTest::test);
55 }
56
57 public static void test() throws Throwable {
|