Package org.ow2.asm

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


        MethodVisitor mv = new CheckMethodAdapter(new EmptyVisitor());
        mv.visitCode();
        Label m = new Label();
        Label n = new Label();
        mv.visitLabel(n);
        mv.visitInsn(NOP);
        mv.visitLabel(m);
        try {
            mv.visitLocalVariable("i", "I", null, m, n, 0);
            fail();
        } catch (Exception e) {
View Full Code Here


        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);
        mv.visitInsn(RETURN);
View Full Code Here

    public void testIllegalInsnVisitAfterEnd() {
        MethodVisitor mv = new CheckMethodAdapter(new EmptyVisitor());
        mv.visitCode();
        mv.visitMaxs(0, 0);
        try {
            mv.visitInsn(NOP);
            fail();
        } catch (Exception e) {
        }
    }
}
View Full Code Here

        mv.visitInsn(ICONST_0);
        mv.visitJumpInsn(IFEQ, l1);
        mv.visitJumpInsn(GOTO, l1);
        mv.visitLabel(l1);
        mv.visitLineNumber(3, l1);
        mv.visitInsn(RETURN);
        mv.visitLabel(l2);
        mv.visitLocalVariable("this", "Lpkg/Debug;", "Lpkg/Debug;", l0, l2, 0);
        mv.visitMaxs(0, 0);
        mv.visitEnd();
View Full Code Here

        mv.visitLabel(l3);
        mv.visitVarInsn(ALOAD, 2);
        mv.visitInsn(ATHROW);
        mv.visitLabel(l4);
        mv.visitVarInsn(ASTORE, 3);
        mv.visitInsn(DCONST_0);
        mv.visitVarInsn(DSTORE, 4);
        mv.visitVarInsn(RET, 3);
        mv.visitLabel(l5);
        mv.visitInsn(RETURN);
        mv.visitMaxs(0, 0);
View Full Code Here

        mv.visitVarInsn(ASTORE, 3);
        mv.visitInsn(DCONST_0);
        mv.visitVarInsn(DSTORE, 4);
        mv.visitVarInsn(RET, 3);
        mv.visitLabel(l5);
        mv.visitInsn(RETURN);
        mv.visitMaxs(0, 0);
        mv.visitEnd();

        cw.visitEnd();
View Full Code Here

        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);
        mv.visitCode();
View Full Code Here

        Label l4 = new Label();
        Label l5 = new Label();
        Label l6 = new Label();
        mv.visitTryCatchBlock(l0, l1, l2, null);
        mv.visitTryCatchBlock(l2, l3, l2, null);
        mv.visitInsn(ICONST_0);
        mv.visitVarInsn(ISTORE, 4);
        mv.visitJumpInsn(GOTO, l0);
        mv.visitLabel(l4);
        mv.visitVarInsn(ASTORE, 3);
        mv.visitIincInsn(4, 1);
View Full Code Here

        mv.visitIincInsn(4, 1);
        mv.visitVarInsn(RET, 3);

        /* extra instructions only used to trigger method resizing */
        mv.visitLabel(l0);
        mv.visitInsn(ACONST_NULL);
        mv.visitJumpInsn(IFNULL, l6); // will give wide IFNULL
        // many NOPs will be introduced here by the method resizing test
        mv.visitJumpInsn(GOTO, l6);
        mv.visitLabel(l6);

View Full Code Here

        mv.visitLabel(l2);
        mv.visitVarInsn(ASTORE, 2);
        mv.visitJumpInsn(JSR, l4);
        mv.visitLabel(l3);
        mv.visitVarInsn(ALOAD, 2);
        mv.visitInsn(ATHROW);
        mv.visitLabel(l5);
        mv.visitInsn(RETURN);
        mv.visitMaxs(0, 0);
        mv.visitEnd();
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.