Examples of insertParameterTypes()


Examples of java.lang.invoke.MethodType.insertParameterTypes()

        String name = "fixnum_boolean_" + opMethod;
        MethodType type = methodType(boolean.class, ThreadContext.class, IRubyObject.class, IRubyObject.class);
        MethodHandle target = null;
       
        if (target == null) {
            type = type.insertParameterTypes(3, long.class);
            target = lookup().findStatic(MathLinker.class, name, type);
            target = insertArguments(target, 3, value);
        }

        MethodHandle fallback = lookup().findStatic(MathLinker.class, "fixnumBooleanFail",
View Full Code Here

Examples of java.lang.invoke.MethodType.insertParameterTypes()

        String name = "float_" + opMethod;
        MethodType type = methodType(IRubyObject.class, ThreadContext.class, IRubyObject.class, IRubyObject.class);
        MethodHandle target = null;
       
        if (target == null) {
            type = type.insertParameterTypes(3, double.class);
            target = lookup().findStatic(MathLinker.class, name, type);
            target = insertArguments(target, 3, value);
        }

        MethodHandle fallback = lookup().findStatic(MathLinker.class, "floatOperatorFail",
View Full Code Here

Examples of java.lang.invoke.MethodType.insertParameterTypes()

                MethodHandle con = BEAN_CONSTRUCTOR_PROPERTY_SETTER.bindTo(mc);
                // inner class case
                MethodType foldTargetType = MethodType.methodType(Object.class);
                if (args.length==3) {
                    con = MethodHandles.dropArguments(con, 1, targetType.parameterType(1));
                    foldTargetType = foldTargetType.insertParameterTypes(0, targetType.parameterType(1));
                }
                handle = MethodHandles.foldArguments(con, handle.asType(foldTargetType));
            }
            if (method instanceof MetaConstructor) {
                handle = MethodHandles.dropArguments(handle, 0, Class.class);
View Full Code Here

Examples of java.lang.invoke.MethodType.insertParameterTypes()

            // pre
            System.arraycopy(argNames, 0, newNames, 0, start);

            // vararg
            newNames[start] = newName;
            newType = newType.insertParameterTypes(start, Array.newInstance(type, 0).getClass());

            // post
            if (newCount + 1 > start) { // args not at end
                System.arraycopy(argNames, start + gatherCount, newNames, start + 1, newCount - start);
            }
View Full Code Here

Examples of java.lang.invoke.MethodType.insertParameterTypes()

                final MethodHandle fallbackFolded;
                if(nextComponent == null) {
                    // Object(AnnotatedDynamicMethod)->R(AnnotatedDynamicMethod, T0, T1); returns constant null
                    fallbackFolded = MethodHandles.dropArguments(CONSTANT_NULL_DROP_ANNOTATED_METHOD, 1,
                            type.parameterList()).asType(type.insertParameterTypes(0, AnnotatedDynamicMethod.class));
                } else {
                    // R(T0, T1)->R(AnnotatedDynamicMethod, T0, T1); adapts the next component's invocation to drop the
                    // extra argument resulting from fold
                    fallbackFolded = MethodHandles.dropArguments(nextComponent.getGuardedInvocation().getInvocation(),
                            0, AnnotatedDynamicMethod.class);
View Full Code Here

Examples of java.lang.invoke.MethodType.insertParameterTypes()

                final MethodHandle typedGetter = linkerServices.asType(getDynamicMethod, type.changeReturnType(
                        DynamicMethod.class));
                // Since it is part of the foldArgument() target, it will have extra args that we need to drop.
                final MethodHandle returnMethodHandle = linkerServices.asType(MethodHandles.dropArguments(
                        DYNAMIC_METHOD_IDENTITY, 1, type.parameterList()), type.insertParameterTypes(0,
                                DynamicMethod.class));
                final MethodHandle nextComponentInvocation = nextComponent.getGuardedInvocation().getInvocation();
                // The assumption is that getGuardedInvocationComponent() already asType()'d it correctly
                assert nextComponentInvocation.type().equals(type);
                // Since it is part of the foldArgument() target, we have to drop an extra arg it receives.
View Full Code Here

Examples of java.lang.invoke.MethodType.insertParameterTypes()

        final boolean isMethod = ao instanceof Method;
        final Class<?> rtype = isMethod ? ((Method)ao).getReturnType() : ((Constructor<?>)ao).getDeclaringClass();
        final Class<?>[] ptypes = isMethod ? ((Method)ao).getParameterTypes() : ((Constructor<?>)ao).getParameterTypes();
        final MethodType type = MethodType.methodType(rtype, ptypes);
        final Member m = (Member)ao;
        return type.insertParameterTypes(0,
                isMethod ?
                        Modifier.isStatic(m.getModifiers()) ?
                                Object.class :
                                m.getDeclaringClass() :
                        StaticClass.class);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.