Examples of Insn


Examples of org.apache.jdo.impl.enhancer.classfile.Insn

        final int accessFlags = JDO_PC_jdoPreSerialize_Mods;
        final ExceptionsAttribute exceptAttr = null;

        // begin of method body
        final InsnTarget begin = new InsnTarget();
        Insn insn = begin;

        // store the sm field into local var
        insn = insn.append(Insn.create(opc_aload_0));
        insn = insn.append(
            Insn.create(
                opc_getfield,
                getjdoStateManagerFieldRef()));
        insn = insn.append(Insn.create(opc_astore_1));

        // test the sm field and goto end if null
        final InsnTarget end = new InsnTarget();
        insn = insn.append(Insn.create(opc_aload_1));
        insn = insn.append(Insn.create(opc_ifnull, end));

        // call the sm's method with 'this' argument
        insn = insn.append(Insn.create(opc_aload_1));
        insn = insn.append(Insn.create(opc_aload_0));
        insn = insn.append(
            new InsnInterfaceInvoke(
                pool.addInterfaceMethodRef(
                    JDO_StateManager_Path,
                    JDO_SM_preSerialize_Name,
                    JDO_SM_preSerialize_Sig),
                countMethodArgWords(JDO_SM_preSerialize_Sig)));

        // end of method body
        insn = insn.append(end);
        insn = insn.append(Insn.create(opc_return));

        final CodeAttribute codeAttr
            = new CodeAttribute(getCodeAttributeUtf8(),
                                2, // maxStack
                                2, // maxLocals
View Full Code Here

Examples of org.apache.jdo.impl.enhancer.classfile.Insn

                pool.addUtf8(ExceptionsAttribute.expectedAttrName),
                pool.addClass("java/io/IOException"));
       
        // begin of method body
        final InsnTarget begin = new InsnTarget();
        Insn insn = begin;

        // call jdoPreSerialize
        insn = insn.append(Insn.create(opc_aload_0));
        insn = insn.append(
            Insn.create(opc_invokevirtual,
                        pool.addMethodRef(
                            className,
                            JDO_PC_jdoPreSerialize_Name,
                            JDO_PC_jdoPreSerialize_Sig)));

        // call out.defaultWriteObject();
        insn = insn.append(Insn.create(opc_aload_1));
        insn = insn.append(
            Insn.create(opc_invokevirtual,
                        pool.addMethodRef(
                            JAVA_ObjectOutputStream_Path,
                            JAVA_ObjectOutputStream_defaultWriteObject_Name,
                            JDO_PC_jdoPreSerialize_Sig)));
       
        // end of method body
        insn = insn.append(Insn.create(opc_return));

        final CodeAttribute codeAttr
            = new CodeAttribute(getCodeAttributeUtf8(),
                                1, // maxStack
                                2, // maxLocals
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.