Package org.ow2.asm

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


        cw.visit(V1_2, ACC_PUBLIC, "pkg/Wide", null, "java/lang/Object", null);

        mv = cw.visitMethod(ACC_PUBLIC, "<init>", "()V", null, null);
        mv.visitCode();
        mv.visitVarInsn(ALOAD, 0);
        mv.visitMethodInsn(INVOKESPECIAL, "java/lang/Object", "<init>", "()V");
        for (int i = 0; i < 256; ++i) {
            mv.visitLdcInsn(Integer.toString(i)); // wide form
            mv.visitInsn(POP);
        }
        mv.visitInsn(RETURN);
View Full Code Here


    public void testIllegalMethodInsnNullName() {
        MethodVisitor mv = new CheckMethodAdapter(new EmptyVisitor());
        mv.visitCode();
        try {
            mv.visitMethodInsn(INVOKEVIRTUAL, "C", null, "()V");
            fail();
        } catch (Exception e) {
        }
    }
View Full Code Here

    public void testIllegalMethodInsnName() {
        MethodVisitor mv = new CheckMethodAdapter(new EmptyVisitor());
        mv.visitCode();
        try {
            mv.visitMethodInsn(INVOKEVIRTUAL, "C", "-", "()V");
            fail();
        } catch (Exception e) {
        }
    }
View Full Code Here

    public void testIllegalMethodInsnName2() {
        MethodVisitor mv = new CheckMethodAdapter(new EmptyVisitor());
        mv.visitCode();
        try {
            mv.visitMethodInsn(INVOKEVIRTUAL, "C", "a-", "()V");
            fail();
        } catch (Exception e) {
        }
    }
View Full Code Here

    public void testIllegalMethodInsnNullDesc() {
        MethodVisitor mv = new CheckMethodAdapter(new EmptyVisitor());
        mv.visitCode();
        try {
            mv.visitMethodInsn(INVOKEVIRTUAL, "C", "m", null);
            fail();
        } catch (Exception e) {
        }
    }
View Full Code Here

    public void testIllegalMethodInsnDesc() {
        MethodVisitor mv = new CheckMethodAdapter(new EmptyVisitor());
        mv.visitCode();
        try {
            mv.visitMethodInsn(INVOKEVIRTUAL, "C", "m", "I");
            fail();
        } catch (Exception e) {
        }
    }
View Full Code Here

    public void testIllegalMethodInsnParameterDesc() {
        MethodVisitor mv = new CheckMethodAdapter(new EmptyVisitor());
        mv.visitCode();
        try {
            mv.visitMethodInsn(INVOKEVIRTUAL, "C", "m", "(V)V");
            fail();
        } catch (Exception e) {
        }
    }
View Full Code Here

    public void testIllegalMethodInsnReturnDesc() {
        MethodVisitor mv = new CheckMethodAdapter(new EmptyVisitor());
        mv.visitCode();
        try {
            mv.visitMethodInsn(INVOKEVIRTUAL, "C", "m", "()VV");
            fail();
        } catch (Exception e) {
        }
    }
View Full Code Here

        Label l1 = new Label();
        Label l2 = new Label();
        mv.visitLabel(l0);
        mv.visitLineNumber(3, l0);
        mv.visitVarInsn(ALOAD, 0);
        mv.visitMethodInsn(INVOKESPECIAL, "java/lang/Object", "<init>", "()V");
        mv.visitInsn(ICONST_0);
        mv.visitJumpInsn(IFEQ, l1);
        mv.visitJumpInsn(GOTO, l1);
        mv.visitLabel(l1);
        mv.visitLineNumber(3, l1);
View Full Code Here

        cw.visit(V1_1, ACC_PUBLIC, "pkg/JSR2", null, "java/lang/Object", null);

        mv = cw.visitMethod(ACC_PUBLIC, "<init>", "()V", null, null);
        mv.visitCode();
        mv.visitVarInsn(ALOAD, 0);
        mv.visitMethodInsn(INVOKESPECIAL, "java/lang/Object", "<init>", "()V");
        mv.visitInsn(RETURN);
        mv.visitMaxs(0, 0);
        mv.visitEnd();

        mv = cw.visitMethod(ACC_PUBLIC, "backwardJSR", "([I)V", null, null);
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.