Package org.objectweb.asm.commons

Examples of org.objectweb.asm.commons.GeneratorAdapter.endMethod()


      GeneratorAdapter ga = new GeneratorAdapter(ACC_PUBLIC, m, mv);
      ga.visitCode();
      ga.loadThis();
      ga.invokeConstructor(Type.getType("Ljava/lang/Object;"), m);
      ga.returnValue();
      ga.endMethod();
    }
    mv = cv.visitMethod(ACC_PUBLIC, "getF", "()I", null, null);
    if (mv != null) {
      Type bean = Type.getType("Lpkg/Bean;");
      Method m = Method.getMethod("int getF()");
View Full Code Here


      GeneratorAdapter ga = new GeneratorAdapter(ACC_PUBLIC, m, mv);
      ga.visitCode();
      ga.loadThis();
      ga.getField(bean, "f", Type.INT_TYPE);
      ga.returnValue();
      ga.endMethod();
    }
    mv = cv.visitMethod(ACC_PUBLIC, "setF", "(I)V", null, null);
    if (mv != null) {
      Type bean = Type.getType("Lpkg/Bean;");
      Method m = Method.getMethod("void setF(int)");
View Full Code Here

      ga.visitCode();
      ga.loadThis();
      ga.loadArg(0);
      ga.putField(bean, "f", Type.INT_TYPE);
      ga.returnValue();
      ga.endMethod();
    }
    mv = cv.visitMethod(ACC_PUBLIC, "checkAndSetF", "(I)V", null, null);
    if (mv != null) {
      Type bean = Type.getType("Lpkg/Bean;");
      Method m = Method.getMethod("void checkAndSetF(int)");
View Full Code Here

      ga.mark(label);
      ga.throwException(Type.getType(IllegalArgumentException.class),
          "f");
      ga.mark(end);
      ga.returnValue();
      ga.endMethod();
    }
    cv.visitEnd();
    byte[] b = cw.toByteArray();
    return b;
  }
View Full Code Here

      init.visitCode();
      init.loadThis();
      init.loadArg(0);
      init.invokeConstructor(PROXY, INIT);
      init.returnValue();
      init.endMethod();
    }

    GeneratorAdapter clinit = null;
    mv = cv.visitMethod(ACC_STATIC, CLINIT.getName(), CLINIT
        .getDescriptor(), null, null);
View Full Code Here

        ga.invokeInterface(HANDLER, INVOKE);
        if (m.getReturnType() != Type.VOID_TYPE) {
          ga.unbox(m.getReturnType());
        }
        ga.returnValue();
        ga.endMethod();
      }
    }

    if (clinit != null) {
      clinit.returnValue();
View Full Code Here

        generateProxyMethods(superClass, methods, selfType, cw, clazzInit);

        // finish class initializer
        clazzInit.returnValue();
        clazzInit.endMethod();

        // end class
        cw.visitEnd();

        byte[] data = cw.toByteArray();
View Full Code Here

        gh.loadThis();
        gh.getField(selfType, INVOCATION_HANDLER_FIELD_NAME,
                INVOCATION_HANDLER_TYPE);
        gh.returnValue();
        gh.endMethod();
    }

    private static void generateGetProxyClass(Type selfType, ClassVisitor cw) {
        // make getter for proxy class
        GeneratorAdapter gpc = new GeneratorAdapter(Opcodes.ACC_PUBLIC,
View Full Code Here

                new org.objectweb.asm.commons.Method("___getProxyClass",
                        PROXY_CLASS_TYPE, EMPTY_TYPE_ARR), null,
                EMPTY_TYPE_ARR, cw);
        gpc.getStatic(selfType, PROXY_CLASS_FIELD_NAME, PROXY_CLASS_TYPE);
        gpc.returnValue();
        gpc.endMethod();
    }

    private static void generateConstructors(Class superClass, Type selfType,
            ClassVisitor cw) {
        Constructor[] cons = superClass.getDeclaredConstructors();
View Full Code Here

                .getMethod("void <init>(java.lang.Throwable)"));
        ga.throwException();

        ga.visitTryCatchBlock(before, after, handler, "java/lang/Throwable");

        ga.endMethod();

        //
        // construct the super-proxy method
        //
        if (md.isImplemented()) {
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.