Package org.ow2.asm

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


        fv.visitAttribute(new Comment());
        fv.visitEnd();

        mv = cw.visitMethod(ACC_PUBLIC, "<init>", "()V", null, null);
        mv.visitAttribute(new Comment());
        mv.visitCode();
        mv.visitVarInsn(ALOAD, 0);
        mv.visitMethodInsn(INVOKESPECIAL, "java/lang/Object", "<init>", "()V");

        /*
         * the following instructions are designed so that this method will be
View Full Code Here


        mv = cw.visitMethod(ACC_PUBLIC + ACC_FINAL + ACC_STATIC,
                "values",
                "()[Lpkg/Enum;",
                null,
                null);
        mv.visitCode();
        mv.visitFieldInsn(GETSTATIC, "pkg/Enum", "$VALUES", "[Lpkg/Enum;");
        mv.visitMethodInsn(INVOKEVIRTUAL,
                "[Lpkg/Enum;",
                "clone",
                "()Ljava/lang/Object;");
View Full Code Here

        mv = cw.visitMethod(ACC_PUBLIC + ACC_STATIC,
                "valueOf",
                "(Ljava/lang/String;)Lpkg/Enum;",
                null,
                null);
        mv.visitCode();
        mv.visitLdcInsn(Type.getType("Lpkg/Enum;"));
        mv.visitVarInsn(ALOAD, 0);
        mv.visitMethodInsn(INVOKESTATIC,
                "java/lang/Enum",
                "valueOf",
View Full Code Here

        cv.visitField(0, "i", "I", null, null).visitEnd();
       
        MethodVisitor mv;
       
        mv = cv.visitMethod(0, "foo", "()V", null, null);
        mv.visitCode();
        mv.visitFieldInsn(GETFIELD, "Doo", "boo", "LBoo;");

        mv.visitLdcInsn(Type.getType("LBoo;"));
        mv.visitLdcInsn(Type.getType("[LDoo;"));
        mv.visitLdcInsn(Type.getType("[I"));
View Full Code Here

        mv = cw.visitMethod(ACC_PRIVATE,
                "<init>",
                "(Ljava/lang/String;I)V",
                "()V",
                null);
        mv.visitCode();
        mv.visitVarInsn(ALOAD, 0);
        mv.visitVarInsn(ALOAD, 1);
        mv.visitVarInsn(ILOAD, 2);
        mv.visitMethodInsn(INVOKESPECIAL,
                "java/lang/Enum",
View Full Code Here

        mv.visitInsn(RETURN);
        mv.visitMaxs(0, 0);
        mv.visitEnd();

        mv = cw.visitMethod(ACC_STATIC, "<clinit>", "()V", null, null);
        mv.visitCode();
        mv.visitTypeInsn(NEW, "pkg/Enum");
        mv.visitInsn(DUP);
        mv.visitLdcInsn("V0");
        mv.visitInsn(ICONST_0);
        mv.visitMethodInsn(INVOKESPECIAL,
View Full Code Here

        MethodVisitor mv = cw.visitMethod(ACC_PUBLIC,
                "uninitializedLocalType",
                "(Z)V",
                null,
                null);
        mv.visitCode();
        Label l0 = new Label();
        mv.visitLabel(l0);
        mv.visitTypeInsn(NEW, "java/lang/Long");
        mv.visitVarInsn(ASTORE, 2);
        mv.visitVarInsn(ALOAD, 2);
View Full Code Here

        assertValid();
    }

    public void testSubroutineLocalsAccess() throws AnalyzerException {
        MethodVisitor mv = mn;
        mv.visitCode();
        Label l0 = new Label();
        Label l1 = new Label();
        Label l2 = new Label();
        Label l3 = new Label();
        mv.visitTryCatchBlock(l0, l0, l1, null);
View Full Code Here

        MethodVisitor mv = cw.visitMethod(ACC_PUBLIC,
                "uninitializedStackType",
                "(Z)V",
                null,
                null);
        mv.visitCode();
        Label l0 = new Label();
        mv.visitLabel(l0);
        mv.visitTypeInsn(NEW, "java/lang/Long");
        mv.visitInsn(DUP);
        mv.visitVarInsn(ILOAD, 1);
View Full Code Here

        MethodVisitor mv = cw.visitMethod(ACC_PUBLIC,
                "nullType",
                "(Ljava/lang/String;Ljava/lang/String;)V",
                null,
                null);
        mv.visitCode();
        mv.visitInsn(ACONST_NULL);
        mv.visitVarInsn(ASTORE, 2);
        mv.visitVarInsn(ALOAD, 0);
        mv.visitInsn(ACONST_NULL);
        mv.visitVarInsn(ALOAD, 1);
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.