Package org.ow2.asm

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


        mv.visitInsn(ACONST_NULL);
        mv.visitVarInsn(ASTORE, 2);
        mv.visitVarInsn(ILOAD, 1);
        Label l2 = new Label();
        mv.visitJumpInsn(IFEQ, l2);
        mv.visitFieldInsn(GETSTATIC,
                "pkg/FrameTable",
                "longArray",
                "[Ljava/lang/Long;");
        mv.visitVarInsn(ASTORE, 2);
        mv.visitFrame(F_APPEND,
View Full Code Here


            MethodVisitor gv = cv.visitMethod(ACC_PRIVATE,
                    "_get" + name,
                    gDesc,
                    null,
                    null);
            gv.visitFieldInsn(GETSTATIC,
                    "java/lang/System",
                    "err",
                    "Ljava/io/PrintStream;");
            gv.visitLdcInsn("_get" + name + " called");
            gv.visitMethodInsn(INVOKEVIRTUAL,
View Full Code Here

            gv.visitMethodInsn(INVOKEVIRTUAL,
                    "java/io/PrintStream",
                    "println",
                    "(Ljava/lang/String;)V");
            gv.visitVarInsn(ALOAD, 0);
            gv.visitFieldInsn(GETFIELD, owner, name, desc);
            gv.visitInsn(t.getOpcode(IRETURN));
            gv.visitMaxs(1 + size, 1);
            gv.visitEnd();

            // generates setter method
View Full Code Here

            MethodVisitor sv = cv.visitMethod(ACC_PRIVATE,
                    "_set" + name,
                    sDesc,
                    null,
                    null);
            sv.visitFieldInsn(GETSTATIC,
                    "java/lang/System",
                    "err",
                    "Ljava/io/PrintStream;");
            sv.visitLdcInsn("_set" + name + " called");
            sv.visitMethodInsn(INVOKEVIRTUAL,
View Full Code Here

                    "java/io/PrintStream",
                    "println",
                    "(Ljava/lang/String;)V");
            sv.visitVarInsn(ALOAD, 0);
            sv.visitVarInsn(t.getOpcode(ILOAD), 1);
            sv.visitFieldInsn(PUTFIELD, owner, name, desc);
            sv.visitInsn(RETURN);
            sv.visitMaxs(1 + size, 1 + size);
            sv.visitEnd();
        }
        return fv;
View Full Code Here

                "main",
                "([Ljava/lang/String;)V",
                null,
                null);
        // pushes the 'out' field (of type PrintStream) of the System class
        mw.visitFieldInsn(GETSTATIC,
                "java/lang/System",
                "out",
                "Ljava/io/PrintStream;");
        // pushes the "Hello World!" String constant
        mw.visitLdcInsn("Hello world!");
View Full Code Here

                    "([Ljava/lang/String;)V",
                    null,
                    null);
            mv.visitCode();

            mv.visitFieldInsn(GETSTATIC,
                    "java/lang/System",
                    "in",
                    "Ljava/io/InputStream;");
            mv.visitVarInsn(ASTORE, V_IS);
View Full Code Here

                    "java/lang/System",
                    "in",
                    "Ljava/io/InputStream;");
            mv.visitVarInsn(ASTORE, V_IS);

            mv.visitFieldInsn(GETSTATIC,
                    "java/lang/System",
                    "out",
                    "Ljava/io/PrintStream;");
            mv.visitVarInsn(ASTORE, V_OS);
View Full Code Here

            classOptimizer.class$ = true;
        }

        String clsName = classOptimizer.clsName;
        mv.visitFieldInsn(GETSTATIC, clsName, fieldName, "Ljava/lang/Class;");
        Label elseLabel = new Label();
        mv.visitJumpInsn(IFNONNULL, elseLabel);
        mv.visitLdcInsn(ldcName.replace('/', '.'));
        mv.visitMethodInsn(INVOKESTATIC,
                clsName,
View Full Code Here

        mv.visitMethodInsn(INVOKESTATIC,
                clsName,
                "class$",
                "(Ljava/lang/String;)Ljava/lang/Class;");
        mv.visitInsn(DUP);
        mv.visitFieldInsn(PUTSTATIC, clsName, fieldName, "Ljava/lang/Class;");
        Label endLabel = new Label();
        mv.visitJumpInsn(GOTO, endLabel);
        mv.visitLabel(elseLabel);
        mv.visitFieldInsn(GETSTATIC, clsName, fieldName, "Ljava/lang/Class;");
        mv.visitLabel(endLabel);
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.