Package org.jboss.classfilewriter.code

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


            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);
            ca.getfield(getClassName(), INVOCATION_HANDLER_FIELD, InvocationHandler.class);
            ca.aload(0);
            loadMethodIdentifier(superclassMethod, method);
            // now we need to stick the parameters into an array, boxing if nessesary
View Full Code Here


            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);
        bytecodeMethodResolver.getDeclaredMethod(method, methodInfo.getDeclaringClass(), methodInfo.getName(), methodInfo.getParameterTypes(), staticConstructor);

        if (addProceed) {
View Full Code Here

        // 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);
    }

    protected void createForwardingMethodBody(ClassMethod classMethod, MethodInformation method, ClassMethod staticConstructor) {
        createInterceptorBody(classMethod, method, staticConstructor);
    }
View Full Code Here

        b.exceptionHandlerStart(start);
        b.invokestatic(INTERCEPTION_DECORATION_CONTEXT_CLASS_NAME, END_INTERCEPTOR_CONTEXT_METHOD_NAME, EMPTY_PARENTHESES + DescriptorUtils.VOID_CLASS_DESCRIPTOR);
        b.athrow();

        // update the correct address to jump over the catch block
        b.branchEnd(gotoEnd);

        // if this method returns a primitive we just return
        if (method.getReturnType().isPrimitive()) {
            b.returnInstruction();
        } else {
View Full Code Here

            // first we need to build up the inner conditional that just returns
            // the
            // result
            final BranchEnd returnInstruction = b.ifAcmpeq();
            b.returnInstruction();
            b.branchEnd(returnInstruction);

            // now add the case where the proxy returns 'this';
            b.aload(0);
            b.checkcast(methodInfo.getMethod().getReturnType().getName());
            b.returnInstruction();
View Full Code Here

            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);
            ca.getfield(getClassName(), INVOCATION_HANDLER_FIELD, InvocationHandler.class);
            ca.aload(0);
            loadMethodIdentifier(superclassMethod, method);
            // now we need to stick the parameters into an array, boxing if nessesary
View Full Code Here

            BranchEnd gotoEnd = ca.gotoInstruction(); // we have found the method, goto the pointwhere we write it to a static
                                                      // field

            // throw runtime exception as we could not find the method.
            // this will only happen if the proxy isloaded into the wrong classloader
            ca.branchEnd(loopEnd);
            ca.newInstruction("java.lang.RuntimeException");
            ca.dup();
            ca.ldc("Could not find method " + methodToLoad);
            ca.invokespecial("java.lang.RuntimeException", "<init>", "(Ljava/lang/String;)V");
            ca.athrow();
View Full Code Here

            ca.newInstruction("java.lang.RuntimeException");
            ca.dup();
            ca.ldc("Could not find method " + methodToLoad);
            ca.invokespecial("java.lang.RuntimeException", "<init>", "(Ljava/lang/String;)V");
            ca.athrow();
            ca.branchEnd(gotoEnd);
            ca.pop();
            ca.aload(2);
            ca.checkcast("java.lang.reflect.Method");
            ca.putstatic(getClassName(), fieldName, METHOD_FIELD_DESCRIPTOR);
View Full Code Here

            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);
            ca.getfield(getClassName(), INVOCATION_HANDLER_FIELD, InvocationHandler.class);
            ca.aload(0);
            loadMethodIdentifier(superclassMethod, method);
            // now we need to stick the parameters into an array, boxing if nessesary
View Full Code Here

            BranchEnd gotoEnd = ca.gotoInstruction(); // we have found the method, goto the pointwhere we write it to a static
                                                      // field

            // throw runtime exception as we could not find the method.
            // this will only happen if the proxy isloaded into the wrong classloader
            ca.branchEnd(loopEnd);
            ca.newInstruction("java.lang.RuntimeException");
            ca.dup();
            ca.ldc("Could not find method " + methodToLoad);
            ca.invokespecial("java.lang.RuntimeException", "<init>", "(Ljava/lang/String;)V");
            ca.athrow();
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.