Package org.ow2.easybeans.asm

Examples of org.ow2.easybeans.asm.MethodVisitor.visitLabel()


        mv.visitJumpInsn(GOTO, l6);
        mv.visitLabel(l5);
        mv.visitInsn(ICONST_2);
        mv.visitVarInsn(ISTORE, 7);
        mv.visitJumpInsn(GOTO, l6);
        mv.visitLabel(l6);
        mv.visitVarInsn(ILOAD, 7);
        // throw
        mv.visitInsn(ACONST_NULL);
        mv.visitInsn(ATHROW);
        // misc instructions to cover code in MethodWriter.resizeInsns
View Full Code Here


        mv.visitVarInsn(ILOAD, 7);
        // throw
        mv.visitInsn(ACONST_NULL);
        mv.visitInsn(ATHROW);
        // misc instructions to cover code in MethodWriter.resizeInsns
        mv.visitLabel(l0);
        mv.visitInsn(ICONST_1);
        mv.visitInsn(ICONST_2);
        mv.visitMultiANewArrayInsn("[[I", 2);
        mv.visitVarInsn(ALOAD, 0);
        mv.visitMethodInsn(INVOKEINTERFACE, "java/util/List", "size", "()V");
View Full Code Here

    public void testIllegalLabelInsnOperand() {
        MethodVisitor mv = new CheckMethodAdapter(new EmptyVisitor());
        mv.visitCode();
        Label l = new Label();
        mv.visitLabel(l);
        try {
            mv.visitLabel(l);
            fail();
        } catch (Exception e) {
        }
View Full Code Here

        MethodVisitor mv = new CheckMethodAdapter(new EmptyVisitor());
        mv.visitCode();
        Label l = new Label();
        mv.visitLabel(l);
        try {
            mv.visitLabel(l);
            fail();
        } catch (Exception e) {
        }
    }
   
View Full Code Here

        mv.visitCode();
        Label l0 = new Label();
        Label l1 = new Label();
        mv.visitJumpInsn(GOTO, l1); // will give GOTO_W

        mv.visitLabel(l0);
        mv.visitIincInsn(300, 1); // covers 'update maxlocals' in MethodWriter
        mv.visitVarInsn(ILOAD, 300); // will give wide form
        mv.visitJumpInsn(IFEQ, l1); // will give long forward jump

        // many NOPs will be introduced here by the method resizing test
View Full Code Here

        // many NOPs will be introduced here by the method resizing test

        mv.visitVarInsn(ILOAD, 300); // will give wide form
        mv.visitInsn(IRETURN);

        mv.visitLabel(l1);
        for (int i = 1; i < 300; ++i) {
            mv.visitVarInsn(ILOAD, i);
            if (i <= 5) {
                mv.visitInsn(ICONST_0 + i);
            } else if (i <= Byte.MAX_VALUE) {
View Full Code Here

    public void testIllegalTryCatchBlock() {
        MethodVisitor mv = new CheckMethodAdapter(new EmptyVisitor());
        mv.visitCode();
        Label m = new Label();
        Label n = new Label();
        mv.visitLabel(m);
        try {
            mv.visitTryCatchBlock(m, n, n, null);
            fail();
        } catch (Exception e) {
        }       
View Full Code Here

    public void testIllegalLocalVariableLabels() {
        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();
View Full Code Here

        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

                null);
        mv.visitCode();
        Label l0 = new Label();
        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);
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.