Examples of InsnTarget


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

                opc_getfield,
                getjdoStateManagerFieldRef()));
        insn = insn.append(InsnUtils.aStore(varStart, pool));

        // test the sm field and return field if null
        final InsnTarget callIsLoaded = new InsnTarget();
        insn = insn.append(InsnUtils.aLoad(varStart, pool));
        insn = insn.append(Insn.create(opc_ifnonnull, callIsLoaded));
        insn = appendDirectReadReturn(insn, fieldRef);

        // call sm for isLoaded
        insn = insn.append(callIsLoaded);
        insn = insn.append(InsnUtils.aLoad(varStart, pool));

        // push instance
        insn = insn.append(Insn.create(opc_aload_0));

        // push absolute field index
        insn = insn.append(
            Insn.create(opc_getstatic,
                        pool.addFieldRef(
                            className,
                            JDO_PC_jdoInheritedFieldCount_Name,
                            JDO_PC_jdoInheritedFieldCount_Sig)));
        insn = insn.append(InsnUtils.integerConstant(fieldIndex, pool));
        insn = insn.append(Insn.create(opc_iadd));

        // test result of isLoaded and return field if nonzero
        final InsnTarget mediate = new InsnTarget();
        insn = insn.append(
            new InsnInterfaceInvoke(
                pool.addInterfaceMethodRef(
                    JDO_StateManager_Path,
                    JDO_SM_isLoaded_Name,
View Full Code Here

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

        affirm(methodName != null);     
        affirm(methodSig != null);     
        final ExceptionsAttribute exceptAttr = null;

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

        // get field's sig and compute first non-parameter slot
        final ConstFieldRef fieldRef = getAnnotatedFieldRefs()[fieldIndex];
        affirm(fieldRef != null);
View Full Code Here

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

        affirm(methodName != null);     
        affirm(methodSig != null);     
        final ExceptionsAttribute exceptAttr = null;

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

        // get field's sig and compute first non-parameter slot
        final ConstFieldRef fieldRef = getAnnotatedFieldRefs()[fieldIndex];
        affirm(fieldRef != null);
        final String sig = fieldRef.nameAndType().signature().asString();
        affirm(sig != null && sig.length() > 0);
        final int fieldSize = ((sig.equals("J") || sig.equals("D")) ? 2 : 1);
        final int varStart = 1;

        // directly return field if flags are <= LOAD_REQUIRED
        final InsnTarget mediate = new InsnTarget();
        insn = insn.append(Insn.create(opc_aload_0));
        insn = insn.append(
            Insn.create(opc_getfield,
                        getjdoFlagsFieldRef()));
        insn = insn.append(Insn.create(opc_ifgt, mediate));
View Full Code Here

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

        affirm(methodName != null);     
        affirm(methodSig != null);     
        final ExceptionsAttribute exceptAttr = null;

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

        final ConstFieldRef fieldRef = getAnnotatedFieldRefs()[fieldIndex];
        affirm(fieldRef != null);
View Full Code Here

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

                opc_getfield,
                getjdoStateManagerFieldRef()));
        insn = insn.append(InsnUtils.aStore(varStart, pool));

        // test the sm field and assign field if null
        final InsnTarget mediate = new InsnTarget();
        insn = insn.append(InsnUtils.aLoad(varStart, pool));
        insn = insn.append(Insn.create(opc_ifnonnull, mediate));

        // write argument to field and return
        insn = appendDirectWriteReturn(insn, fieldRef);
View Full Code Here

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

        affirm(methodName != null);     
        affirm(methodSig != null);     
        final ExceptionsAttribute exceptAttr = null;

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

        // get field's sig and compute first non-parameter slot
        final ConstFieldRef fieldRef = getAnnotatedFieldRefs()[fieldIndex];
        affirm(fieldRef != null);
View Full Code Here

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

        affirm(methodName != null);     
        affirm(methodSig != null);     
        final ExceptionsAttribute exceptAttr = null;

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

        // get field's sig and compute first non-parameter slot
        final ConstFieldRef fieldRef = getAnnotatedFieldRefs()[fieldIndex];
        affirm(fieldRef != null);
        final String sig = fieldRef.nameAndType().signature().asString();
        affirm(sig != null && sig.length() > 0);
        final int fieldSize = ((sig.equals("J") || sig.equals("D")) ? 2 : 1);
        final int varStart = fieldSize + 1;

        // directly write argument and retrurn if flags are != READ_WRITE_OK
        final InsnTarget mediate = new InsnTarget();
        insn = insn.append(Insn.create(opc_aload_0));
        insn = insn.append(
            Insn.create(opc_getfield,
                        getjdoFlagsFieldRef()));
        insn = insn.append(Insn.create(opc_ifne, mediate));
View Full Code Here

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

        final String methodSig = "()V";
        final int accessFlags = 0;
        final ExceptionsAttribute exceptAttr = null;

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

        //@olsen: disabled code
        if (false) {
            // reset jdoFlags = LOAD_REQUIRED
View Full Code Here

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

            = new ExceptionsAttribute(
                pool.addUtf8(ExceptionsAttribute.expectedAttrName),
                pool.addClass("java/lang/CloneNotSupportedException"));

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

        // THISCLASS newObject = (THISCLASS) super.clone();
        final ConstClass superConstClass = classFile.superName();
        final ConstClass thisConstClass = classFile.className();
View Full Code Here

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

        // assumed nonstatic call; otherwise subtract 'this' from maxStack
        affirm((accessFlags & ACCStatic) == 0);
        final ExceptionsAttribute exceptAttr = null;

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

        insn = appendThrowJavaException(
            insn, JAVA_UnsupportedOperationException_Path,
            "Method " + methodName + " not yet implemented");
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.