Lines Matching defs:mh

152     static void test(String name, MethodHandle mh) throws Throwable {
154 System.out.println("mh = "+name+" : "+mh+" { "
155 +Arrays.toString(junkArgs(mh.type().parameterArray())));
157 if (!mh.isVarargsCollector()) {
159 testPermutations(mh);
162 MethodType mt = mh.type();
168 mh1 = adjustArity(mh, arity);
170 System.out.println("*** mh = "+name+" : "+mh+"; arity = "+arity+" => "+ex);
182 static MethodHandle adjustArity(MethodHandle mh, int arity) {
183 MethodType mt = mh.type();
195 return mh.asType(mt1);
197 throw new IllegalArgumentException("cannot convert to type "+mt1+" from "+mh, ex);
206 MethodHandle mh = lookup.unreflect(m);
207 int mhArity = mh.type().parameterCount();
208 if (mh.isVarargsCollector()) {
210 return adjustArity(mh, arity);
212 return mh;
219 static void testPermutations(MethodHandle mh) throws Throwable {
221 MethodType mt = mh.type();
236 testPermutations(mh, perm, start, end, done);
254 static void testPermutations(MethodHandle mh, int[] perm, int start, int end, Set<String> done) throws Throwable {
257 testRotations(mh, perm, start, end, done);
272 testPermutations(mh, perm, start2, end2, done);
278 static void testRotations(MethodHandle mh, int[] perm, int start, int end, Set<String> done) throws Throwable {
279 Object[] args = junkArgs(mh.type().parameterArray());
282 testOnePermutation(mh, perm, args);
287 static void testOnePermutation(MethodHandle mh, int[] perm, Object[] args) throws Throwable {
288 MethodType mt = mh.type();
295 Object res = permuteArguments(mh, pmt, perm).invokeWithArguments(unpermuteArgs(perm, args));
319 MethodHandle mh = findTestMH(mhName, perm);
320 System.out.println("mh = "+mhName+" : "+mh+" { "
321 +Arrays.toString(junkArgs(mh.type().parameterArray())));
322 Object[] args = junkArgs(mh.type().parameterArray());
323 testOnePermutation(mh, perm, args);