Package org.objectweb.asm

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


        mv = cv.visitMethod(ACC_PUBLIC, "speedoElementRemoved",
                "(Ljava/lang/Object;I)V", null, null);
        //${classNameFields}.speedoElementRemoved(elem, gcid, this);
        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


            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);
            cv.visitLdcInsn("Impossible to instanciate the class " + gc.classToWriteJCN + ": ");
            cv.visitVarInsn(ALOAD, 2);
            cv.visitMethodInsn(INVOKESPECIAL,
View Full Code Here

            cv.visitLabel(l2);
            cv.visitVarInsn(ASTORE, 2);
            cv.visitTypeInsn(NEW, personality.getUserRuntimeExceptionClassNameSlash());
            cv.visitInsn(DUP);
            cv.visitLdcInsn("Impossible to instanciate the class " + gc.classToWriteJCN + ": ");
            cv.visitVarInsn(ALOAD, 2);
            cv.visitMethodInsn(INVOKESPECIAL,
                personality.getUserRuntimeExceptionClassNameSlash(),
                    "<init>", "(Ljava/lang/String;Ljava/lang/Throwable;)V");
            cv.visitInsn(ATHROW);
            cv.visitTryCatchBlock(l0, l1, l2, "java/lang/Exception");
View Full Code Here

        CodeVisitor mv = cv.visitMethod(ACC_PUBLIC, "speedoGetPOManager",
                "()Lorg/objectweb/speedo/pm/api/POManagerItf;", null, null);
        //return (speedoIsActive
                //? speedoGetHome().getPOManagerFactory().lookup()
                //: null);
        mv.visitVarInsn(ALOAD, 0);
        mv.visitFieldInsn(GETFIELD, classToWrite, ISACTIVE_FIELD_NAME, "Z");
        Label l1 = new Label();
        mv.visitJumpInsn(IFEQ, l1);
        mv.visitVarInsn(ALOAD, 0);
        mv.visitMethodInsn(INVOKEVIRTUAL, classToWrite, "speedoGetHome",
View Full Code Here

                //: null);
        mv.visitVarInsn(ALOAD, 0);
        mv.visitFieldInsn(GETFIELD, classToWrite, ISACTIVE_FIELD_NAME, "Z");
        Label l1 = new Label();
        mv.visitJumpInsn(IFEQ, l1);
        mv.visitVarInsn(ALOAD, 0);
        mv.visitMethodInsn(INVOKEVIRTUAL, classToWrite, "speedoGetHome",
                "()" + JT_HOME);
        mv.visitMethodInsn(INVOKEINTERFACE, JCN_HOME, "getPOManagerFactory",
                "()" + JT_POMF);
        mv.visitMethodInsn(INVOKEINTERFACE, JCN_POMF, "lookup", "()" + JT_POM);
View Full Code Here

        CodeVisitor mv;
        mv = cv.visitMethod(ACC_PUBLIC, M_SPEEDO_CREATE_STATE, "()" + JT_STATE, null, null);
        //return new $classNameFields(this);
        mv.visitTypeInsn(NEW, xfieldsJCN);
        mv.visitInsn(DUP);
        mv.visitVarInsn(ALOAD, 0);
        mv.visitMethodInsn(INVOKESPECIAL, xfieldsJCN, "<init>", "(" + JT_PO + ")V");
        mv.visitInsn(ARETURN);
        mv.visitMaxs(0, 0);
    }
View Full Code Here

    private void generateSpeedoSetReferenceStateMethod() {
        CodeVisitor mv;
        mv = cv.visitMethod(ACC_PUBLIC, M_SPEEDO_SET_REF_STATE, "("+ JT_STATE + ")V", null, null);
        //speedoReferenceState = ($classNameFields) refAcc;
        mv.visitVarInsn(ALOAD, 0);
        mv.visitVarInsn(ALOAD, 1);
        mv.visitTypeInsn(CHECKCAST, xfieldsAncestorJCN);
        mv.visitFieldInsn(PUTFIELD, ancestorJCN, REFSTATE_FIELD_NAME, xfieldsAncestorJT);
        mv.visitInsn(RETURN);
        mv.visitMaxs(0, 0);
View Full Code Here

    private void generateSpeedoSetReferenceStateMethod() {
        CodeVisitor mv;
        mv = cv.visitMethod(ACC_PUBLIC, M_SPEEDO_SET_REF_STATE, "("+ JT_STATE + ")V", null, null);
        //speedoReferenceState = ($classNameFields) refAcc;
        mv.visitVarInsn(ALOAD, 0);
        mv.visitVarInsn(ALOAD, 1);
        mv.visitTypeInsn(CHECKCAST, xfieldsAncestorJCN);
        mv.visitFieldInsn(PUTFIELD, ancestorJCN, REFSTATE_FIELD_NAME, xfieldsAncestorJT);
        mv.visitInsn(RETURN);
        mv.visitMaxs(0, 0);
    }
View Full Code Here

        CodeVisitor cv = gc.cv.visitMethod(ACC_PUBLIC + ACC_FINAL, "getClassProperties",
                "()Ljava/util/Properties;", null, null);
        cv.visitTypeInsn(NEW, "java/util/Properties");
        cv.visitInsn(DUP);
        cv.visitMethodInsn(INVOKESPECIAL, "java/util/Properties", "<init>", "()V");
        cv.visitVarInsn(ASTORE, 1);
       
        Properties classProperties = new Properties();
        getJormConfig(gc.sc, classProperties);
        String xmlFileName = gc.sc.moPackage.xmlDescriptor.xmlFile;
        xmlFileName = StringReplace.replaceChar('/', '.', xmlFileName);
View Full Code Here

        classProperties.setProperty(
                Object2StringSerializer.DESC_FILE_NAME_PROP,
                xmlFileName);
        for (Iterator it = classProperties.entrySet().iterator(); it.hasNext();) {
            Map.Entry me = (Map.Entry) it.next();
            cv.visitVarInsn(ALOAD, 1);
            cv.visitLdcInsn(me.getKey());
            cv.visitLdcInsn(me.getValue());
            cv.visitMethodInsn(INVOKEVIRTUAL, "java/util/Properties", "setProperty",
                    "(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/Object;");
            cv.visitInsn(POP); //remove the result of the setProperty method
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.