Package org.ow2.asm

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


                "get",
                "(I)Ljava/lang/String;",
                null,
                null);
        mv.visitCode();
        mv.visitVarInsn(ALOAD, 0);
        mv.visitVarInsn(ILOAD, 1);
        mv.visitMethodInsn(INVOKESPECIAL,
                "java/util/ArrayList",
                "get",
                "(I)Ljava/lang/Object;");
View Full Code Here


                "(I)Ljava/lang/String;",
                null,
                null);
        mv.visitCode();
        mv.visitVarInsn(ALOAD, 0);
        mv.visitVarInsn(ILOAD, 1);
        mv.visitMethodInsn(INVOKESPECIAL,
                "java/util/ArrayList",
                "get",
                "(I)Ljava/lang/Object;");
        mv.visitTypeInsn(CHECKCAST, "java/lang/String");
View Full Code Here

                "get",
                "(I)Ljava/lang/Object;",
                "(I)TE;",
                null);
        mv.visitCode();
        mv.visitVarInsn(ALOAD, 0);
        mv.visitVarInsn(ILOAD, 1);
        mv.visitMethodInsn(INVOKEVIRTUAL,
                "pkg/Insns",
                "get",
                "(I)Ljava/lang/String;");
View Full Code Here

                "(I)Ljava/lang/Object;",
                "(I)TE;",
                null);
        mv.visitCode();
        mv.visitVarInsn(ALOAD, 0);
        mv.visitVarInsn(ILOAD, 1);
        mv.visitMethodInsn(INVOKEVIRTUAL,
                "pkg/Insns",
                "get",
                "(I)Ljava/lang/String;");
        mv.visitInsn(ARETURN);
View Full Code Here

        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);
        }
View Full Code Here

        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

        mv.visitVarInsn(ILOAD, 300); // will give wide form
View Full Code Here

        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

        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);
View Full Code Here

        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) {
                mv.visitIntInsn(BIPUSH, i);
            } else {
View Full Code Here

                mv.visitIntInsn(BIPUSH, i);
            } else {
                mv.visitIntInsn(SIPUSH, i);
            }
            mv.visitInsn(IADD);
            mv.visitVarInsn(ISTORE, i + 1);
        }
        mv.visitInsn(ICONST_0);
        mv.visitJumpInsn(IFEQ, l0); // will give long backward jump
        mv.visitJumpInsn(GOTO, l0); // will give long backward goto
View Full Code Here

                "m",
                "(I)V",
                new EmptyVisitor(),
                new HashMap<Label, Integer>());
        mv.visitCode();
        mv.visitVarInsn(ILOAD, 1);
        mv.visitInsn(IRETURN);
        mv.visitMaxs(1, 2);
        try {
            mv.visitEnd();
            fail();
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.