Package org.objectweb.asm

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


            generateGetRefState(mv, true);
            mv.visitVarInsn(ft.getOpcode(ILOAD), 1);
            mv.visitFieldInsn(PUTFIELD, xfieldsJCN, f.getName(), ftd);

            //return
            mv.visitInsn(RETURN);
        }

        mv.visitLabel(l1);
        //The po is activated
        //Logger logger = ((org.objectweb.jorm.util.api.Loggable) getPClassMapping()).getLogger();
View Full Code Here


        } else {
            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
View Full Code Here

            mv.visitVarInsn(ALOAD, 0);
            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);
View Full Code Here

        mv.visitVarInsn(ALOAD, 1);
        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",
View Full Code Here

        mv.visitVarInsn(ALOAD, 1);
        mv.visitVarInsn(ILOAD, 2);
        mv.visitVarInsn(ALOAD, 0);
        mv.visitMethodInsn(INVOKESTATIC, xfieldsJCN, "speedoElementRemoved",
                "(Ljava/lang/Object;I" + JT_PO + ")V");
        mv.visitInsn(RETURN);
        mv.visitMaxs(0, 0);
    }
}
View Full Code Here

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

//            cv.visitVarInsn(ASTORE, 2);
//            cv.visitVarInsn(ALOAD, 2);
            cv.visitTypeInsn(CHECKCAST, "org/objectweb/speedo/mim/api/PersistentObjectItf");
            Label l1 = new Label();
            cv.visitLabel(l1);
            cv.visitInsn(ARETURN);
            Label l2 = new Label();
            cv.visitLabel(l2);
            cv.visitVarInsn(ASTORE, 2);
            cv.visitTypeInsn(NEW, personality.getUserRuntimeExceptionClassNameSlash());
            cv.visitInsn(DUP);
View Full Code Here

                    AbstractSpeedoGenerator.getClassNameDef(speedoClass.jormclass, scp));
        } catch (SpeedoException e) {
            throw personality.newRuntimeException(e.getMessage(), e);
        }
        if (actions == null || actions.length == 0) {
            mv.visitInsn(ACONST_NULL);
        } else if (actions[0].equals(NamingManager.PNH_NULL_VALUE)) {
            mv.visitInsn(ACONST_NULL);

        } else if (actions[0].equals(NamingManager.PNH_REF_STATE)) {
            generateGetRefState(mv, false);
View Full Code Here

            throw personality.newRuntimeException(e.getMessage(), e);
        }
        if (actions == null || actions.length == 0) {
            mv.visitInsn(ACONST_NULL);
        } else if (actions[0].equals(NamingManager.PNH_NULL_VALUE)) {
            mv.visitInsn(ACONST_NULL);

        } else if (actions[0].equals(NamingManager.PNH_REF_STATE)) {
            generateGetRefState(mv, false);
       
        } else if (actions[0].equals(NamingManager.PNH_PFIELD)) {
View Full Code Here

            final String fieldName = (String) actions[1];
            final String jvmFieldType = getJVMType(pt);
            final String wrapper = getJavaWrapper(pt);
            if (wrapper != null) {
                mv.visitTypeInsn(NEW, wrapper);
                mv.visitInsn(DUP);
            }
            generateGetRefState(mv, true);
            mv.visitFieldInsn(GETFIELD, xfieldsJCN, fieldName, jvmFieldType);
            if (wrapper != null) {
                mv.visitMethodInsn(INVOKESPECIAL, wrapper, "<init>",
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.