Lines Matching refs:mh
131 MethodHandle mh = cache.get(wrap);
132 if (mh != null) {
133 return mh;
138 mh = IDENTITY; break;
140 mh = IGNORE; break;
142 if (mh != null) {
143 cache.put(wrap, mh);
144 return mh;
150 mh = IMPL_LOOKUP.findStatic(THIS_CLASS, name, type);
152 mh = null;
154 if (mh != null) {
155 mh = MethodHandles.insertArguments(mh, 1, cast);
156 cache.put(wrap, mh);
157 return mh;
274 MethodHandle mh = cache.get(wrap);
275 if (mh != null) {
276 return mh;
281 mh = IDENTITY; break;
283 mh = ZERO_OBJECT;
286 if (mh != null) {
287 cache.put(wrap, mh);
288 return mh;
295 mh = IMPL_LOOKUP.findStatic(THIS_CLASS, name, type);
297 mh = null;
300 mh = box(wrap, !exact).asType(type.erase());
302 if (mh != null) {
303 cache.put(wrap, mh);
304 return mh;
356 MethodHandle mh = cache.get(wrap);
357 if (mh != null) {
358 return mh;
364 mh = EMPTY;
369 mh = IMPL_LOOKUP.findStatic(THIS_CLASS, "zero"+wrap.wrapperSimpleName(), type);
371 mh = null;
375 if (mh != null) {
376 cache.put(wrap, mh);
377 return mh;
382 mh = MethodHandles.explicitCastArguments(zeroConstantFunction(Wrapper.INT), type);
383 cache.put(wrap, mh);
384 return mh;
505 static MethodHandle collectArguments(MethodHandle mh, int pos, MethodHandle collector) {
508 // return MethodHandles.collectArguments(mh, 0, collector);
513 COLLECT_ARGUMENTS.invokeExact(mh, pos, collector);
525 mh = MethodHandles.dropArguments(mh, 1, collector.type().parameterList());
526 mh = MethodHandles.foldArguments(mh, collector);
527 return mh;
531 MethodHandle mh = null;
543 mh = IMPL_LOOKUP.unreflect(m);
547 COLLECT_ARGUMENTS = mh;
558 MethodHandle mh;
564 mh = cache.get(wrap);
565 if (mh != null) return mh;
567 mh = MethodHandles.insertArguments(CAST_REFERENCE, 0, type);
569 cache.put(wrap, mh);
570 return mh;
586 MethodHandle mh = cache.get(wrap);
587 if (mh != null) {
588 return mh;
595 mh = IMPL_LOOKUP.findStatic(THIS_CLASS, "identity", type);
597 mh = null;
599 if (mh == null && wrap == Wrapper.VOID) {
600 mh = EMPTY; // #(){} : #()void
602 if (mh != null) {
603 cache.put(wrap, mh);
604 return mh;
607 if (mh != null) {
608 cache.put(wrap, mh);
609 return mh;
825 MethodHandle mh = cache.get(wdst);
826 if (mh != null) {
827 return mh;
834 mh = identity(src);
836 mh = zeroConstantFunction(wdst);
838 mh = MethodHandles.dropArguments(EMPTY, 0, src); // Defer back to MethodHandles.
840 mh = unboxCast(dst);
842 mh = box(src);
846 mh = IMPL_LOOKUP.findStatic(THIS_CLASS, src.getSimpleName()+"To"+capitalize(dst.getSimpleName()), type);
848 mh = null;
851 if (mh != null) {
852 assert(mh.type() == type) : mh;
853 cache.put(wdst, mh);
854 return mh;
946 MethodHandle mh = findCollector("array", mhs.size(), Object[].class);
947 if (mh == null) break;
948 mhs.add(mh);
1003 MethodHandle mh = findCollector("fillArray", mhs.size(), Object[].class, Integer.class, Object[].class);
1004 if (mh == null) break;
1005 mhs.add(mh);
1025 MethodHandle mh = ARRAYS[nargs];
1026 if (mh != null) return mh;
1027 mh = findCollector("array", nargs, Object[].class);
1028 if (mh != null) return ARRAYS[nargs] = mh;
1029 mh = buildVarargsArray(FILL_NEW_ARRAY, ARRAY_IDENTITY, nargs);
1030 assert(assertCorrectArity(mh, nargs));
1031 return ARRAYS[nargs] = mh;
1034 private static boolean assertCorrectArity(MethodHandle mh, int arity) {
1035 assert(mh.type().parameterCount() == arity) : "arity != "+arity+": "+mh;
1040 // Build up the result mh as a sequence of fills like this:
1047 MethodHandle mh = finisher;
1050 if (mh == ARRAY_IDENTITY)
1051 mh = rightFiller;
1053 mh = collectArguments(mh, 0, rightFiller);
1055 if (mh == ARRAY_IDENTITY)
1056 mh = leftCollector;
1058 mh = collectArguments(mh, 0, leftCollector);
1059 return mh;
1078 // we need room for both mh and a in mh.invoke(a, arg*[nargs])
1138 MethodHandle mh = nargs < cache.length ? cache[nargs] : null;
1139 if (mh != null) return mh;
1143 mh = buildVarargsArray(builder, producer, nargs);
1150 mh = buildVarargsArray(builder, producer, nargs);
1152 mh = mh.asType(MethodType.methodType(arrayType, Collections.<Class<?>>nCopies(nargs, elemType)));
1153 assert(assertCorrectArity(mh, nargs));
1155 cache[nargs] = mh;
1156 return mh;
1203 MethodHandle mh = findCollector("list", mhs.size(), List.class);
1204 if (mh == null) break;
1205 mhs.add(mh);
1216 MethodHandle mh = LISTS[nargs];
1217 if (mh != null) return mh;
1218 mh = findCollector("list", nargs, List.class);
1219 if (mh != null) return LISTS[nargs] = mh;