Package org.apache.jdo.impl.enhancer.classfile

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


            = new ExceptionsAttribute(
                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(
View Full Code Here


    public void addJDOPreSerializeCall(String methodName, String methodSig)
    {
        final ExceptionsAttribute exceptAttr = null;

        // begin of method body
        final InsnTarget begin = new InsnTarget();
        Insn insn = begin;
       
        // invoke jdoPreSerialize
        insn = insn.append(Insn.create(opc_aload_0));
        insn = insn.append(
View Full Code Here

                                           final String delegateSig)
    {
        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 do the call if nonnull
        InsnTarget noncall = new InsnTarget();
        insn = insn.append(Insn.create(opc_aload_1));
        insn = insn.append(Insn.create(opc_ifnull, noncall));

        // call the sm's method with 'this' argument and return
        insn = insn.append(Insn.create(opc_aload_1));
View Full Code Here

                                         final String delegateSig)
    {
        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 do the call if nonnull
        InsnTarget noncall = new InsnTarget();
        insn = insn.append(Insn.create(opc_aload_1));
        insn = insn.append(Insn.create(opc_ifnull, noncall));

        // call the sm's method with 'this' argument and return
        insn = insn.append(Insn.create(opc_aload_1));
View Full Code Here

                                                   final String delegateSig)
    {
        final ExceptionsAttribute exceptAttr = null;

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

        // check arg
        insn = appendCheckVarNonNull(insn, 1,
                                     JAVA_IllegalArgumentException_Path,
                                     "arg1");

        // store the array argument length into local var
        insn = insn.append(Insn.create(opc_aload_1));
        insn = insn.append(Insn.create(opc_arraylength));
        insn = insn.append(Insn.create(opc_istore_2));

        // init loop counter and goto loop check
        final InsnTarget loopcheck = new InsnTarget();
        insn = insn.append(Insn.create(opc_iconst_0));
        insn = insn.append(Insn.create(opc_istore_3));
        insn = insn.append(Insn.create(opc_goto, loopcheck));

        // loop body: call self-delegating method with array element
        final InsnTarget loopbody = new InsnTarget();
        insn = insn.append(loopbody);
        insn = insn.append(Insn.create(opc_aload_0));

        // select element from array argument at loop counter
        insn = insn.append(Insn.create(opc_aload_1));
View Full Code Here

        final String methodSig = SUNJDO_PC_sunjdoClassForName_Sig;
        final int accessFlags = SUNJDO_PC_sunjdoClassForName_Mods;
        final ExceptionsAttribute exceptAttr = null;

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

        // invoke the Class.forName(String) method with argument
        insn = insn.append(Insn.create(opc_aload_0));
        insn = insn.append(
            Insn.create(opc_invokestatic,
                        pool.addMethodRef(
                            JAVA_Class_Path,
                            JAVA_Class_forName_Name,
                            JAVA_Class_forName_Sig)));

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

        // begin of exception handler
        final InsnTarget end = new InsnTarget();
        final InsnTarget beginHandler = end;
        insn = insn.append(beginHandler);

        // create NoClassDefFoundError with message from caught exception
        insn = insn.append(Insn.create(opc_astore_1));
        insn = insn.append(
View Full Code Here

        final int managedFieldCount = analyzer.getManagedFieldCount();
        affirm(managedFieldCount >= 0);

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

        // push total (absolute) number of managed fields
        final boolean isPCRoot = analyzer.isAugmentableAsRoot();
        if (isPCRoot) {
View Full Code Here

        final String methodSig = JAVA_clinit_Sig;
        final int accessFlags = JAVA_clinit_Mods;
        final ExceptionsAttribute exceptAttr = null;

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

        // initialize jdo fields
        insn = initJdoInheritedFieldCount(insn);
        insn = initJdoFieldNames(insn);
View Full Code Here

        final String methodSig = JDO_PC_jdoNewInstance_Sig;
        final int accessFlags = JDO_PC_jdoNewInstance_Mods;
        final ExceptionsAttribute exceptAttr = null;

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

        // push a newly created an instance of this class
        final ConstClass thisConstClass = classFile.className();
        affirm(thisConstClass != null);
View Full Code Here

        final String methodSig = JDO_PC_jdoNewInstance_Object_Sig;
        final int accessFlags = JDO_PC_jdoNewInstance_Object_Mods;
        final ExceptionsAttribute exceptAttr = null;

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

        // push a newly created an instance of this class
        final ConstClass thisConstClass = classFile.className();
        affirm(thisConstClass != null);
View Full Code Here

TOP

Related Classes of org.apache.jdo.impl.enhancer.classfile.InsnTarget

Copyright © 2018 www.massapicom. 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.