Package org.objectweb.asm

Examples of org.objectweb.asm.CodeVisitor.visitVarInsn()


        //public final static void ${f.setter}(${baseClassName} instance, ${f.memoryType} val) {
        CodeVisitor mv;
        mv = cv.visitMethod(ACC_PUBLIC + ACC_FINAL + ACC_STATIC, f.getSetter(),
                "(" + getJVMType(classToWrite) + ft.getDescriptor() + ")V", null, null);
        //instance.${f.setter}(val);
        mv.visitVarInsn(ALOAD, 0); //Class instance
        mv.visitVarInsn(ft.getOpcode(ILOAD), 1); //field
        mv.visitMethodInsn(INVOKEVIRTUAL, classToWrite, f.getSetter(),
                "(" + ft.getDescriptor() + ")V");
        mv.visitInsn(RETURN);
        mv.visitMaxs(0, 0);
View Full Code Here


        CodeVisitor mv;
        mv = cv.visitMethod(ACC_PUBLIC + ACC_FINAL + ACC_STATIC, f.getSetter(),
                "(" + getJVMType(classToWrite) + ft.getDescriptor() + ")V", null, null);
        //instance.${f.setter}(val);
        mv.visitVarInsn(ALOAD, 0); //Class instance
        mv.visitVarInsn(ft.getOpcode(ILOAD), 1); //field
        mv.visitMethodInsn(INVOKEVIRTUAL, classToWrite, f.getSetter(),
                "(" + ft.getDescriptor() + ")V");
        mv.visitInsn(RETURN);
        mv.visitMaxs(0, 0);
    }
View Full Code Here

            }
            mv.visitLabel(l1);
        }
       
        //StateItf sa = this.speedoReadIntention(new long[] { ... });
        mv.visitVarInsn(ALOAD, 0);
        generateFieldIdAsLongArray(f, nbField, mv);
        mv.visitMethodInsn(INVOKEVIRTUAL, classToWrite, "speedoReadIntention",
                "([J)" + JT_STATE);
        mv.visitTypeInsn(CHECKCAST, xfieldsJCN);
        mv.visitVarInsn(ASTORE, 1);
View Full Code Here

        mv.visitVarInsn(ALOAD, 0);
        generateFieldIdAsLongArray(f, nbField, mv);
        mv.visitMethodInsn(INVOKEVIRTUAL, classToWrite, "speedoReadIntention",
                "([J)" + JT_STATE);
        mv.visitTypeInsn(CHECKCAST, xfieldsJCN);
        mv.visitVarInsn(ASTORE, 1);

        //return sa.f1;
        mv.visitVarInsn(ALOAD, 1);
        mv.visitFieldInsn(GETFIELD, xfieldsJCN, f.getName(), ftd);
        mv.visitInsn(ft.getOpcode(IRETURN));
View Full Code Here

                "([J)" + JT_STATE);
        mv.visitTypeInsn(CHECKCAST, xfieldsJCN);
        mv.visitVarInsn(ASTORE, 1);

        //return sa.f1;
        mv.visitVarInsn(ALOAD, 1);
        mv.visitFieldInsn(GETFIELD, xfieldsJCN, f.getName(), ftd);
        mv.visitInsn(ft.getOpcode(IRETURN));
        mv.visitMaxs(0, 0);
    }
View Full Code Here

        CodeVisitor mv;
        int nextLocalVarIdx = 1 + ft.getSize();
        mv = cv.visitMethod(ACC_PUBLIC, f.getSetter(), "(" + ftd + ")V", null, null);

        //if (!speedoIsActive()) {
        mv.visitVarInsn(ALOAD, 0);
        mv.visitMethodInsn(INVOKEVIRTUAL, classToWrite, ISACTIVE_FIELD_NAME, "()Z");
        Label l1 = new Label();
        mv.visitJumpInsn(IFNE, l1);
        {
            //if(speedoReferenceState.getDetachedStatus() != DetachedLifeCycle.DETACHED_NONE) {
View Full Code Here

                mv.visitMethodInsn(INVOKEVIRTUAL, xfieldsAncestorJCN, "setDetachedStatus", "(B)V");
            }
            mv.visitLabel(l3);
            //(($classNameFields) speedoReferenceState).${f.name} = val;
            generateGetRefState(mv, true);
            mv.visitVarInsn(ft.getOpcode(ILOAD), 1);
            mv.visitFieldInsn(PUTFIELD, xfieldsJCN, f.getName(), ftd);

            //return
            mv.visitInsn(RETURN);
        }
View Full Code Here

        }

        mv.visitLabel(l1);
        //The po is activated
        //Logger logger = ((org.objectweb.jorm.util.api.Loggable) getPClassMapping()).getLogger();
        mv.visitVarInsn(ALOAD, 0);
        mv.visitMethodInsn(INVOKEVIRTUAL, classToWrite, "getPClassMapping",
                "()Lorg/objectweb/jorm/api/PClassMapping;");
        mv.visitTypeInsn(CHECKCAST, "org/objectweb/jorm/util/api/Loggable");
        mv.visitMethodInsn(INVOKEINTERFACE, "org/objectweb/jorm/util/api/Loggable",
                "getLogger", "()Lorg/objectweb/util/monolog/api/Logger;");
View Full Code Here

        mv.visitTypeInsn(CHECKCAST, "org/objectweb/jorm/util/api/Loggable");
        mv.visitMethodInsn(INVOKEINTERFACE, "org/objectweb/jorm/util/api/Loggable",
                "getLogger", "()Lorg/objectweb/util/monolog/api/Logger;");
        final int loggerIdx = nextLocalVarIdx;
        nextLocalVarIdx++;
        mv.visitVarInsn(ASTORE, loggerIdx);

        //$classNameFields state = ($classNameFields) speedoWriteIntention(${f.jormFielIdDecl});
        mv.visitVarInsn(ALOAD, 0);
        generateFieldIdAsLongArray(f, nbField, mv);
        mv.visitMethodInsn(INVOKEVIRTUAL, classToWrite, "speedoWriteIntention",
View Full Code Here

        final int loggerIdx = nextLocalVarIdx;
        nextLocalVarIdx++;
        mv.visitVarInsn(ASTORE, loggerIdx);

        //$classNameFields state = ($classNameFields) speedoWriteIntention(${f.jormFielIdDecl});
        mv.visitVarInsn(ALOAD, 0);
        generateFieldIdAsLongArray(f, nbField, mv);
        mv.visitMethodInsn(INVOKEVIRTUAL, classToWrite, "speedoWriteIntention",
                "([J)" + JT_STATE);
        mv.visitTypeInsn(CHECKCAST, xfieldsJCN);
        final int stateIdx = nextLocalVarIdx;
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.