RicochetTest.java revision 5452
4279N/A * @ignore The following test creates an unreasonable number of adapters in -Xcomp mode (7049122)
4183N/Apublic class RicochetTest {
4183N/A private static final int MAX_ARITY = Integer.getInteger(CLASS.getSimpleName()+".MAX_ARITY", 40);
4183N/A if (test.testOnlyTests == null) throw new RuntimeException("no matching test: "+test.testOnly);
4183N/A int testRepetition;
4183N/A Object res = list8ints.invokeExact(ints[0], ints[1], ints[2], ints[3], ints[4], ints[5], ints[6], ints[7]);
4183N/A res = idreturn.invokeExact(ints[0], ints[1], ints[2], ints[3], ints[4], ints[5], ints[6], ints[7]);
4183N/A case 5: args2 = (int[]) coll.invokeExact(args[0], args[1], args[2], args[3], args[4]); break;
4183N/A case 5: args2 = (byte[]) coll.invokeExact(args[0], args[1], args[2], args[3], args[4]); break;
4183N/A final int MAX = (MAX_ARITY - 2) / 2; // 253/2+1 would cause parameter overflow with 'this' added
4183N/A case 5: args2 = (long[]) coll.invokeExact(args[0], args[1], args[2], args[3], args[4]); break;
4183N/A for (int collects = 0; collects <= Math.min(outputs, INT_COLLECTORS.length-1); collects++) {
4183N/A //System.out.println("testIntCollects "+Arrays.asList(lister, pos, collector)+" on "+Arrays.toString(args));
4183N/A private static MethodHandle collectArguments(MethodHandle lister, int pos, MethodHandle collector) {
5452N/A case 0: fns[i] = filterArguments(fns[i - 5], 0, insertArguments(fns[i - 4], 1, ".")); break;
5452N/A case 1: fns[i] = filterArguments(fns[i - 5], 1, insertArguments(fns[i - 3], 1, ".")); break;
4183N/A assertEqualFunctionAt(i, x, y);
4183N/A assertEqualFunctionAt(i, x, y);
4183N/A private static void assertEqualFunctionAt(Object v, MethodHandle x, MethodHandle y) throws Throwable {
4183N/A private static long opJ3(long x, long y, long z) { return (long) opI3((int)x, (int)y, (int)z); }
4183N/A private static final MethodHandle opI, opI2, opI3, opI4, opI_L, opJ, opJ2, opJ3, opL2, opL, opL2_I, opL_I, opL_J;
4183N/A private static Object list8longs(long a, long b, long c, long d, long e, long f, long g, long h) {