Package org.ow2.asm

Examples of org.ow2.asm.Label


                "(Z)V",
                null,
                null);
        mv.visitCode();
        mv.visitFrame(F_SAME, 0, null, 0, null);
        Label l0 = new Label();
        mv.visitLabel(l0);
        mv.visitLdcInsn(new Long(11L));
        mv.visitVarInsn(LSTORE, 2);
        mv.visitLdcInsn(new Long(11L));
        mv.visitVarInsn(LSTORE, 4);
        mv.visitLdcInsn(new Long(11L));
        mv.visitVarInsn(LSTORE, 6);
        mv.visitLdcInsn(new Long(11L));
        mv.visitVarInsn(LSTORE, 8);
        mv.visitLdcInsn(new Long(11L));
        mv.visitVarInsn(LSTORE, 10);
        mv.visitLdcInsn(new Long(11L));
        mv.visitVarInsn(LSTORE, 12);
        mv.visitLdcInsn(new Long(11L));
        mv.visitVarInsn(LSTORE, 14);
        mv.visitLdcInsn(new Long(11L));
        mv.visitVarInsn(LSTORE, 16);
        mv.visitLdcInsn(new Long(11L));
        mv.visitVarInsn(LSTORE, 18);
        mv.visitLdcInsn(new Long(11L));
        mv.visitVarInsn(LSTORE, 20);
        mv.visitLdcInsn(new Long(11L));
        mv.visitVarInsn(LSTORE, 22);
        mv.visitLdcInsn(new Long(11L));
        mv.visitVarInsn(LSTORE, 24);
        mv.visitLdcInsn(new Long(11L));
        mv.visitVarInsn(LSTORE, 26);
        mv.visitVarInsn(ILOAD, 1);
        Label l1 = new Label();
        mv.visitJumpInsn(IFEQ, l1);
        mv.visitInsn(RETURN);
        mv.visitFrame(F_SAME, 0, null, 0, null);
        mv.visitLabel(l1);
        mv.visitJumpInsn(GOTO, l0);
View Full Code Here


                "deadCode",
                "(Z)V",
                null,
                null);
        mv.visitCode();
        Label l0 = new Label();
        Label l1 = new Label();
        Label l2 = new Label();
        Label l3 = new Label();
        mv.visitTryCatchBlock(l0, l1, l1, "java/lang/Exception");
        mv.visitTryCatchBlock(l2, l3, l3, "java/lang/Exception");
        mv.visitJumpInsn(GOTO, l2);
        mv.visitFrame(F_SAME, 0, null, 0, null);
        mv.visitLabel(l0);
View Full Code Here

         * the following instructions are designed so that this method will be
         * resized by the method resizing test, in order to cover the code that
         * recomputes the code attribute labels in the resizeInstructions method
         * (see MethodWriter).
         */
        Label l0 = new Label();
        mv.visitInsn(ICONST_0);
        mv.visitJumpInsn(IFEQ, l0);
        // many NOPs will be introduced here by the method resizing test
        mv.visitJumpInsn(GOTO, l0);
        mv.visitLabel(l0);
View Full Code Here

        mv.visitFrame(Opcodes.F_NEW,
                2, new Object[] {Opcodes.INTEGER, Opcodes.INTEGER },
                0, new Object[0]);
       
       
        Label l = new Label();

        mv.visitLocalVariable("boo", "LBoo;", null, l, l, 1);
        mv.visitLocalVariable("boo1", "[LBoo;", null, l, l, 3);
        mv.visitLocalVariable("boo2", "[[LBoo;", null, l, l, 4);
        mv.visitMaxs(0, 0);
View Full Code Here

        mn.visitInsn(ICONST_0);
        assertInvalid();
    }

    public void testInconsistentStackHeights() {
        Label l0 = new Label();
        mn.visitInsn(ICONST_0);
        mn.visitJumpInsn(IFEQ, l0);
        mn.visitInsn(ICONST_0);
        mn.visitLabel(l0);
        assertInvalid();
View Full Code Here

        } catch (RuntimeException e) {
        }
    }

    public void testInvalidSubroutineFalloff() {
        Label l0 = new Label();
        Label l1 = new Label();
        mn.visitJumpInsn(GOTO, l0);
        mn.visitLabel(l1);
        mn.visitVarInsn(ASTORE, 1);
        mn.visitVarInsn(RET, 1);
        mn.visitLabel(l0);
View Full Code Here

        } catch (RuntimeException e) {
        }
    }

    public void testNestedSubroutines() throws AnalyzerException {
        Label l0 = new Label();
        Label l1 = new Label();
        mn.visitJumpInsn(JSR, l0);
        mn.visitInsn(RETURN);
        mn.visitLabel(l0);
        mn.visitVarInsn(ASTORE, 1);
        mn.visitJumpInsn(JSR, l1);
View Full Code Here

    }

    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);
        mv.visitTryCatchBlock(l0, l2, l2, "java/lang/RuntimeException");
        mv.visitLabel(l0);
        mv.visitJumpInsn(JSR, l3);
        mv.visitInsn(RETURN);
View Full Code Here

    public void _testOverlappingSubroutines() {
        // TODO currently Analyzer can not detect this situation. The problem
        // is that other overlapping subroutine situations are valid, such as
        // when a nested subroutine implicitly returns to its parent
        // subroutine, without a RET.
        Label l0 = new Label();
        Label l1 = new Label();
        Label l2 = new Label();
        mn.visitJumpInsn(JSR, l0);
        mn.visitJumpInsn(JSR, l1);
        mn.visitInsn(RETURN);
        mn.visitLabel(l0);
        mn.visitVarInsn(ASTORE, 1);
View Full Code Here

        mn.visitVarInsn(RET, 1);
        assertInvalid();
    }

    public void testMerge() throws AnalyzerException {
        Label l0 = new Label();
        mn.visitVarInsn(ALOAD, 0);
        mn.visitVarInsn(ASTORE, 1);
        mn.visitInsn(ACONST_NULL);
        mn.visitTypeInsn(CHECKCAST, "java/lang/Number");
        mn.visitVarInsn(ASTORE, 2);
View Full Code Here

TOP

Related Classes of org.ow2.asm.Label

Copyright © 2018 www.massapicom. 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.