Examples of visitCode()


Examples of org.jacoco.core.internal.flow.MethodProbesVisitor.visitCode()

  @Test
  public void testMethodFilter_NonSynthetic() {
    final MethodProbesVisitor mv = analyzer.visitMethod(0, "foo", "()V",
        null, null);
    mv.visitCode();
    mv.visitInsn(Opcodes.RETURN);
    mv.visitEnd();
    Collection<IMethodCoverage> methods = analyzer.getCoverage()
        .getMethods();
    assertEquals(1, methods.size());
View Full Code Here

Examples of org.jruby.compiler.impl.SkinnyMethodAdapter.visitCode()

    }

    private SkinnyMethodAdapter startBlockCall(ClassWriter cw) {
        SkinnyMethodAdapter mv = new SkinnyMethodAdapter(cw.visitMethod(ACC_PUBLIC | ACC_SYNTHETIC | ACC_FINAL, "call", BLOCK_CALL_SIG, null, null));
       
        mv.visitCode();
        Label line = new Label();
        mv.visitLineNumber(0, line);
        return mv;
    }
View Full Code Here

Examples of org.kohsuke.asm3.MethodVisitor.visitCode()

            for (int i = 0; i < et.length; i++)
                exceptions[i] = Type.getInternalName(et[i]);

            String methodDescriptor = getMethodDescriptor(c);
            MethodVisitor m = cw.visitMethod(c.getModifiers(), "<init>", methodDescriptor, null, exceptions);
            m.visitCode();

            int index=1;
            m.visitVarInsn(ALOAD,0);
            for (Class param : c.getParameterTypes()) {
                Type t = Type.getType(param);
View Full Code Here

Examples of org.more.asm.MethodVisitor.visitCode()

        String findDesc = name + desc.substring(0, desc.lastIndexOf(")") + 1);
        this.validMethod.add(findDesc);
        //2.忽略构造方法,aop包装不会考虑构造方法。
        if (name.equals("<init>") == true) {
            MethodVisitor mv = super.visitMethod(access, name, desc, signature, exceptions);
            mv.visitCode();
            this.visitConstruction(mv, name, desc);
            mv.visitEnd();
            return null;
        }
        return null;
View Full Code Here

Examples of org.mvel2.asm.MethodVisitor.visitCode()

    protected void buildCommonMethods( ClassWriter cw, String proxy ) {
        MethodVisitor mv;
        {
            mv = cw.visitMethod( ACC_PUBLIC, "toString", "()" + Type.getDescriptor( String.class ), null, null );
            mv.visitCode();
            mv.visitTypeInsn( NEW, Type.getInternalName( StringBuilder.class ) );
            mv.visitInsn( DUP );
            mv.visitMethodInsn( INVOKESPECIAL, Type.getInternalName( StringBuilder.class ), "<init>", "()V" );
            mv.visitLdcInsn( "(@" + proxy + ") : " );
            mv.visitMethodInsn( INVOKEVIRTUAL, Type.getInternalName( StringBuilder.class ), "append", "(" + Type.getDescriptor( String.class ) + ")" + Type.getDescriptor( StringBuilder.class ) );
View Full Code Here

Examples of org.nutz.repo.org.objectweb.asm.MethodVisitor.visitCode()

            MethodVisitor mv = cw.visitMethod(ACC_PUBLIC,
                                              "<init>",
                                              "()V",
                                              null,
                                              null);
            mv.visitCode();
            mv.visitVarInsn(ALOAD, 0);
            mv.visitMethodInsn(INVOKESPECIAL,
                               "org/nutz/lang/reflect/AbstractFastClass",
                               "<init>",
                               "()V");
View Full Code Here

Examples of org.objectweb.asm.MethodVisitor.visitCode()

        String methodDescriptor = Type.getMethodDescriptor(Type.VOID_TYPE,
                new Type[]{superclassType, scriptSourceType, integerType});
        MethodVisitor methodVisitor = visitor.visitMethod(Opcodes.ACC_PUBLIC, "<init>", methodDescriptor, null,
                new String[0]);
        methodVisitor.visitCode();

        boolean noArgsConstructor;
        try {
            type.getConstructor(type);
            noArgsConstructor = false;
View Full Code Here

Examples of org.objectweb.asm.MethodVisitor.visitCode()

        for (Method method : ExceptionHelper.class.getDeclaredMethods()) {
            // GENERATE public <type> <method>() { return helper.<method>(); }
            methodDescriptor = Type.getMethodDescriptor(Type.getType(method.getReturnType()), new Type[0]);
            methodVisitor = visitor.visitMethod(Opcodes.ACC_PUBLIC, method.getName(), methodDescriptor, null,
                    new String[0]);
            methodVisitor.visitCode();

            methodVisitor.visitVarInsn(Opcodes.ALOAD, 0);
            methodVisitor.visitFieldInsn(Opcodes.GETFIELD, generatedType.getInternalName(), "helper",
                    helperType.getDescriptor());
            methodVisitor.visitMethodInsn(Opcodes.INVOKEVIRTUAL, helperType.getInternalName(), method.getName(),
View Full Code Here

Examples of org.objectweb.asm.MethodVisitor.visitCode()

        // Constructor

        String constructorDescriptor = Type.getMethodDescriptor(Type.VOID_TYPE, new Type[0]);
        MethodVisitor methodVisitor = visitor.visitMethod(Opcodes.ACC_PUBLIC, "<init>", constructorDescriptor, null,
                new String[0]);
        methodVisitor.visitCode();

        // super()
        methodVisitor.visitVarInsn(Opcodes.ALOAD, 0);
        methodVisitor.visitMethodInsn(Opcodes.INVOKESPECIAL, superclassType.getInternalName(), "<init>",
                constructorDescriptor);
View Full Code Here

Examples of org.objectweb.asm.MethodVisitor.visitCode()

        // run() method

        String runDesciptor = Type.getMethodDescriptor(Type.getType(Object.class), new Type[0]);
        methodVisitor = visitor.visitMethod(Opcodes.ACC_PUBLIC, "run", runDesciptor, null, new String[0]);
        methodVisitor.visitCode();

        // return null
        methodVisitor.visitInsn(Opcodes.ACONST_NULL);

        methodVisitor.visitInsn(Opcodes.ARETURN);
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.