Package org.objectweb.asm

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


        mv.visitVarInsn(Constants.ALOAD, 0);
        mv.visitFieldInsn(Constants.GETFIELD,
                className, ADDED_FIELD_NAME, ADDED_FIELD_DESC);
        Type returnType = Type.getType(ADDED_FIELD_DESC);
        mv.visitInsn(returnType.getOpcode(Constants.IRETURN));
        mv.visitMaxs(1, 2);

        //Add the method speedoSetPersistentClassName
        methodName = "speedoSetPersistentClassName";
        logger.log(BasicLevel.DEBUG, "Add to the class " + className
                + " the method " + methodName);
View Full Code Here


        mv.visitVarInsn(Constants.ALOAD, 0);
        mv.visitVarInsn(Constants.ALOAD, 1);
        mv.visitFieldInsn(Constants.PUTFIELD,
                className, ADDED_FIELD_NAME, ADDED_FIELD_DESC);
        mv.visitInsn(Constants.RETURN);
        mv.visitMaxs(2, 2);
    }

    public CodeVisitor visitMethod(final int access,
                                   final String name,
                                   final String desc,
View Full Code Here

        //return instance.${f.getter}();
        mv.visitVarInsn(ALOAD, 0);
        mv.visitMethodInsn(INVOKEVIRTUAL, classToWrite,
                f.getGetter(), "()" +  ft.getDescriptor());
        mv.visitInsn(ft.getOpcode(IRETURN));
        mv.visitMaxs(0, 0);
    }
    private void generateStaticFieldSetter(Field f, Type ft) {
        //public final static void ${f.setter}(${baseClassName} instance, ${f.memoryType} val) {
        CodeVisitor mv;
        mv = cv.visitMethod(ACC_PUBLIC + ACC_FINAL + ACC_STATIC, f.getSetter(),
View Full Code Here

        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);
    }
    private void generateFieldGetter(Field f, Type ft, String ftd, int nbField) {
        CodeVisitor mv;
        mv = cv.visitMethod(ACC_PUBLIC, f.getGetter(), "()" + ftd, null, null);
        if (f.isReference) {
View Full Code Here

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

    private void generateFieldSetter(Field f, Type ft, String ftd, int nbField) {
        CodeVisitor mv;
        int nextLocalVarIdx = 1 + ft.getSize();
View Full Code Here

            mv.visitVarInsn(ALOAD, stateIdx);
            mv.visitVarInsn(ft.getOpcode(ILOAD), 1);
            mv.visitFieldInsn(PUTFIELD, xfieldsJCN, f.getName(), ftd);
        }
        mv.visitInsn(RETURN);
        mv.visitMaxs(0, 0);
    }
    /**
     * Generate the part of the setter concerning reference (the field is a
     * reference
     * @param f is the Field descriptor
View Full Code Here

            mv.visitVarInsn(ft.getOpcode(ILOAD), 1);
            mv.visitMethodInsn(INVOKEVIRTUAL, classToWrite, f.getSetter(),
                    "(" + ftd + ")V");
        }
        mv.visitInsn(RETURN);
        mv.visitMaxs(0, 0);
    }
    private void generateCoherenceFieldSetter11(Field f, Type ft, String ftd, int nbField, CodeVisitor mv) {
        //${f.memoryType} oldVal = ${f.getter}();
        mv.visitVarInsn(ALOAD, 0);
        mv.visitMethodInsn(INVOKEVIRTUAL, classToWrite, f.getGetter(), "()" + ftd);
View Full Code Here

        mv.visitVarInsn(ILOAD, 2);
        mv.visitVarInsn(ALOAD, 0);
        mv.visitMethodInsn(INVOKESTATIC, xfieldsJCN, "speedoElementAdded",
                "(Ljava/lang/Object;I" + JT_PO + ")V");
        mv.visitInsn(RETURN);
        mv.visitMaxs(0, 0);
    }
    private void generateSpeedoElementRemovedMethod() {
        CodeVisitor mv;
        mv = cv.visitMethod(ACC_PUBLIC, "speedoElementRemoved",
                "(Ljava/lang/Object;I)V", null, null);
View Full Code Here

        mv = cv.visitMethod(ACC_PUBLIC, "speedoSetEncodedPName", "(Ljava/lang/Object;)V", null, null);
        mv.visitVarInsn(ALOAD, 0);
        mv.visitVarInsn(ALOAD, 1);
        mv.visitFieldInsn(PUTFIELD, classToWrite, ENCODEDPNAME_FIELD_NAME, "Ljava/lang/Object;");
        mv.visitInsn(RETURN);
        mv.visitMaxs(0, 0);
    }

    private void generateSpeedoGetPNameHintsMethod() {
        CodeVisitor mv;
        mv = cv.visitMethod(ACC_PUBLIC, "speedoGetPNameHints", "()Ljava/lang/Object;", null, null);
View Full Code Here

                        "(" + jvmFieldType + ")V");
            }
        }

        mv.visitInsn(ARETURN);
        mv.visitMaxs(0, 0);
    }
    private void generateSpeedoGetPOManagerMethod() {
        CodeVisitor mv = cv.visitMethod(ACC_PUBLIC, "speedoGetPOManager",
                "()Lorg/objectweb/speedo/pm/api/POManagerItf;", null, null);
        //return (speedoIsActive
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.