Package org.objectweb.asm.tree

Examples of org.objectweb.asm.tree.MethodNode.visitInsn()


  public void test() {
    TraceMethodVisitor tmv = new TraceMethodVisitor(null);
    MethodNode mn = new MethodNode(0, null, null, null, null);
    mn.visitCode();
    mn.visitVarInsn(ILOAD, 1);
    mn.visitInsn(ICONST_0);
    mn.visitInsn(IADD);
    mn.visitInsn(IRETURN);
    mn.visitMaxs(0, 0);
    mn.visitEnd();
    new RemoveAddZeroTransformer(null).transform(mn);
View Full Code Here


    TraceMethodVisitor tmv = new TraceMethodVisitor(null);
    MethodNode mn = new MethodNode(0, null, null, null, null);
    mn.visitCode();
    mn.visitVarInsn(ILOAD, 1);
    mn.visitInsn(ICONST_0);
    mn.visitInsn(IADD);
    mn.visitInsn(IRETURN);
    mn.visitMaxs(0, 0);
    mn.visitEnd();
    new RemoveAddZeroTransformer(null).transform(mn);
    mn.accept(tmv);
View Full Code Here

    MethodNode mn = new MethodNode(0, null, null, null, null);
    mn.visitCode();
    mn.visitVarInsn(ILOAD, 1);
    mn.visitInsn(ICONST_0);
    mn.visitInsn(IADD);
    mn.visitInsn(IRETURN);
    mn.visitMaxs(0, 0);
    mn.visitEnd();
    new RemoveAddZeroTransformer(null).transform(mn);
    mn.accept(tmv);
    checkMethod(tmv);
View Full Code Here

    MethodNode mn = new MethodNode(0, null, null, null, null);
    mn.visitCode();
    mn.visitVarInsn(ILOAD, 1);
    mn.visitVarInsn(ISTORE, 1);
    mn.visitVarInsn(ILOAD, 1);
    mn.visitInsn(IRETURN);
    mn.visitMaxs(0, 0);
    mn.visitEnd();
    new RemoveLoadStoreTransformer(null).transform(mn);
    mn.accept(tmv);
    checkMethod(tmv);
View Full Code Here

    Label end = new Label();
    mn.visitJumpInsn(GOTO, end);
    mn.visitLabel(label);
    mn.visitFrame(F_SAME, 0, null, 0, null);
    mn.visitTypeInsn(NEW, "java/lang/IllegalArgumentException");
    mn.visitInsn(DUP);
    mn.visitMethodInsn(INVOKESPECIAL,
        "java/lang/IllegalArgumentException", "<init>", "()V");
    mn.visitInsn(ATHROW);
    mn.visitLabel(end);
    mn.visitFrame(F_SAME, 0, null, 0, null);
View Full Code Here

    mn.visitFrame(F_SAME, 0, null, 0, null);
    mn.visitTypeInsn(NEW, "java/lang/IllegalArgumentException");
    mn.visitInsn(DUP);
    mn.visitMethodInsn(INVOKESPECIAL,
        "java/lang/IllegalArgumentException", "<init>", "()V");
    mn.visitInsn(ATHROW);
    mn.visitLabel(end);
    mn.visitFrame(F_SAME, 0, null, 0, null);
    mn.visitInsn(RETURN);
    mn.visitMaxs(0, 0);
    mn.visitEnd();
View Full Code Here

    mn.visitMethodInsn(INVOKESPECIAL,
        "java/lang/IllegalArgumentException", "<init>", "()V");
    mn.visitInsn(ATHROW);
    mn.visitLabel(end);
    mn.visitFrame(F_SAME, 0, null, 0, null);
    mn.visitInsn(RETURN);
    mn.visitMaxs(0, 0);
    mn.visitEnd();
    new OptimizeJumpTransformer(null).transform(mn);
    mn.accept(tmv);
    checkMethod(tmv);
View Full Code Here

    mn.visitVarInsn(ALOAD, 0);
    mn.visitVarInsn(ALOAD, 0);
    mn.visitFieldInsn(GETFIELD, "C", "f", "I");
    mn.visitFieldInsn(PUTFIELD, "C", "f", "I");
    mn.visitFieldInsn(GETFIELD, "C", "f", "I");
    mn.visitInsn(IRETURN);
    mn.visitMaxs(0, 0);
    mn.visitEnd();
    new RemoveGetFieldPutFieldTransformer(null).transform(mn);
    mn.accept(tmv);
    checkMethod(tmv);
View Full Code Here

    Label l4 = new Label();
    Label l5 = new Label();
    Label l6 = new Label();
    mn.visitTryCatchBlock(l0, l1, l2, null);
    mn.visitTryCatchBlock(l2, l3, l2, null);
    mn.visitInsn(ACONST_NULL); // insn 0
    mn.visitVarInsn(ASTORE, 3);
    mn.visitInsn(ACONST_NULL); // insn 2
    mn.visitVarInsn(ASTORE, 4);
    mn.visitTypeInsn(NEW, "C");
    mn.visitInsn(DUP);
View Full Code Here

    Label l6 = new Label();
    mn.visitTryCatchBlock(l0, l1, l2, null);
    mn.visitTryCatchBlock(l2, l3, l2, null);
    mn.visitInsn(ACONST_NULL); // insn 0
    mn.visitVarInsn(ASTORE, 3);
    mn.visitInsn(ACONST_NULL); // insn 2
    mn.visitVarInsn(ASTORE, 4);
    mn.visitTypeInsn(NEW, "C");
    mn.visitInsn(DUP);
    mn.visitMethodInsn(INVOKESPECIAL, "C", "<init>", "()V");
    mn.visitVarInsn(ASTORE, 5);
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.