Examples of loadMethodParameters()


Examples of org.jboss.classfilewriter.code.CodeAttribute.loadMethodParameters()

            ca.aload(0);
            ca.getfield(getClassName(), CONSTRUCTED_GUARD, "Z");
            // if the object has not been constructed yet invoke the superclass version of the method
            BranchEnd end = ca.ifne();
            ca.aload(0);
            ca.loadMethodParameters();
            ca.invokespecial(getSuperClassName(), method.getName(), method.getDescriptor());
            ca.returnInstruction();
            // normal invocation path begins here
            ca.branchEnd(end);
            ca.aload(0);
View Full Code Here

Examples of org.jboss.classfilewriter.code.CodeAttribute.loadMethodParameters()

            CodeAttribute ca = method.getCodeAttribute();
            ca.aload(0);
            ca.iconst(0);
            ca.putfield(getClassName(), CONSTRUCTED_GUARD, "Z");
            ca.aload(0);
            ca.loadMethodParameters();
            ca.invokespecial(constructor);
            ca.aload(0);
            ca.iconst(1);
            ca.putfield(getClassName(), CONSTRUCTED_GUARD, "Z");
            ca.returnInstruction();
View Full Code Here

Examples of org.jboss.classfilewriter.code.CodeAttribute.loadMethodParameters()

    private void createDelegateToSuper(ClassMethod classMethod, MethodInformation method) {
        CodeAttribute b = classMethod.getCodeAttribute();
        // first generate the invokespecial call to the super class method
        b.aload(0);
        b.loadMethodParameters();
        b.invokespecial(classMethod.getClassFile().getSuperclass(), method.getName(), method.getDescriptor());
        b.returnInstruction();
    }

    /**
 
View Full Code Here

Examples of org.jboss.classfilewriter.code.CodeAttribute.loadMethodParameters()

            b.iconst(0);
            BranchEnd invokeSuperDirectly = b.ifIcmpeq();
            // now build the bytecode that invokes the super class method
            b.aload(0);
            // create the method invocation
            b.loadMethodParameters();
            b.invokespecial(methodInfo.getDeclaringClass(), methodInfo.getName(), methodInfo.getDescriptor());
            b.returnInstruction();
            b.branchEnd(invokeSuperDirectly);
        }
        b.aload(0);
View Full Code Here

Examples of org.jboss.classfilewriter.code.CodeAttribute.loadMethodParameters()

            final CodeAttribute b = classMethod.getCodeAttribute();
            // load the delegate field
            b.aload(0);
            b.getfield(classMethod.getClassFile().getName(), delegateField.getName(), DescriptorUtils.classToStringRepresentation(delegateField.getType()));
            // load the parameters
            b.loadMethodParameters();
            // invoke the delegate method
            b.invokeinterface(delegateField.getType().getName(), method.getName(), method.getDescriptor());
            // return the value if applicable
            b.returnInstruction();
        } else {
View Full Code Here

Examples of org.jboss.classfilewriter.code.CodeAttribute.loadMethodParameters()

            // to the super constructor
            // to do this we need to push all the arguments on the stack first
            // local variables is the number of parameters +1 for this
            // if some of the parameters are wide this may go up.
            b.aload(0);
            b.loadMethodParameters();
            // now we have the parameters on the stack
            b.invokespecial(file.getSuperclass(), initMethodName, DescriptorUtils.getMethodDescriptor(params, returnType));
            if(!useUnsafeInstantiators) {
                // now set constructed to true
                b.aload(0);
View Full Code Here

Examples of org.jboss.classfilewriter.code.CodeAttribute.loadMethodParameters()

        // jump if the proxy constructor has finished
        BranchEnd jumpMarker = cond.ifne();
        // generate the invokespecial call to the super class method
        // this is run when the proxy is being constructed
        cond.aload(0);
        cond.loadMethodParameters();
        cond.invokespecial(classMethod.getClassFile().getSuperclass(), classMethod.getName(), classMethod.getDescriptor());
        cond.returnInstruction();
        cond.branchEnd(jumpMarker);
    }
View Full Code Here

Examples of org.jboss.classfilewriter.code.CodeAttribute.loadMethodParameters()

        // we need to dup it so we still have it to compare to the return value
        b.dup();

        //lets create the method invocation
        String methodDescriptor = methodInfo.getDescriptor();
        b.loadMethodParameters();
        if (method.getDeclaringClass().isInterface()) {
            b.invokeinterface(methodInfo.getDeclaringClass(), methodInfo.getName(), methodDescriptor);
        } else {
            b.invokevirtual(methodInfo.getDeclaringClass(), methodInfo.getName(), methodDescriptor);
        }
View Full Code Here

Examples of org.jboss.classfilewriter.code.CodeAttribute.loadMethodParameters()

    /** {@inheritDoc} */
    @Override
    public void overrideConstructor(ClassMethod method, Constructor<?> constructor) {
        CodeAttribute ca = method.getCodeAttribute();
        ca.aload(0);
        ca.loadMethodParameters();
        ca.invokespecial(constructor);
        ca.returnInstruction();
    }

}
View Full Code Here

Examples of org.jboss.classfilewriter.code.CodeAttribute.loadMethodParameters()

            ca.aload(0);
            ca.getfield(getClassName(), CONSTRUCTED_GUARD, "Z");
            // if the object has not been constructed yet invoke the superclass version of the method
            BranchEnd end = ca.ifne();
            ca.aload(0);
            ca.loadMethodParameters();
            ca.invokespecial(getSuperClassName(), method.getName(), method.getDescriptor());
            ca.returnInstruction();
            // normal invocation path begins here
            ca.branchEnd(end);
            ca.aload(0);
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.