Examples of CodeAttribute


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

        }

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

        final CodeAttribute codeAttr
            = new CodeAttribute(getCodeAttributeUtf8(),
                                isPCRoot ? 1 : 2, // maxStack
                                0, // maxLocals
                                begin,
                                new ExceptionTable(),
                                new AttributeVector());
View Full Code Here

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

        // invoke registerClass
        insn = registerClass(insn);

        // add or extend the static initializer
        final CodeAttribute codeAttr
            = new CodeAttribute(getCodeAttributeUtf8(),
                                7, // maxStack
                                0, // maxLocals
                                begin,
                                new ExceptionTable(),
                                new AttributeVector());
View Full Code Here

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

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

        final CodeAttribute codeAttr
            = new CodeAttribute(getCodeAttributeUtf8(),
                                2, // maxStack
                                3, // maxLocals
                                begin,
                                new ExceptionTable(),
                                new AttributeVector());
View Full Code Here

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

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

        final CodeAttribute codeAttr
            = new CodeAttribute(getCodeAttributeUtf8(),
                                2, // maxStack
                                4, // maxLocals
                                begin,
                                new ExceptionTable(),
                                new AttributeVector());
View Full Code Here

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

       
        affirm(0 <= sizeHolder.size && sizeHolder.size <= 2);
        //System.out.println("sizeHolder.size = " + sizeHolder.size);
        final int maxStack = (sizeHolder.size == 0
                              ? 3 : (sizeHolder.size == 1 ? 4 : 5));
        final CodeAttribute codeAttr
            = new CodeAttribute(getCodeAttributeUtf8(),
                                maxStack, // maxStack
                                3, // maxLocals
                                begin,
                                new ExceptionTable(),
                                new AttributeVector());
View Full Code Here

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

        affirm(insn.opcode() == opc_athrow || insn.opcode() == opc_return);

        affirm(0 <= sizeHolder.size && sizeHolder.size <= 2);
        //System.out.println("sizeHolder.size = " + sizeHolder.size);
        final int maxStack = (sizeHolder.size == 0 ? 3 : 4);
        final CodeAttribute codeAttr
            = new CodeAttribute(getCodeAttributeUtf8(),
                                maxStack, // maxStack
                                3, // maxLocals
                                begin,
                                new ExceptionTable(),
                                new AttributeVector());
View Full Code Here

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

        insn = appendEndCopyField(insn);

        // end of method body
        affirm(insn.opcode() == opc_athrow || insn.opcode() == opc_return);
       
        final CodeAttribute codeAttr
            = new CodeAttribute(getCodeAttributeUtf8(),
                                3, // maxStack
                                3, // maxLocals
                                begin,
                                new ExceptionTable(),
                                new AttributeVector());
View Full Code Here

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

        insn = insn.append(Insn.create(opc_if_icmplt, loopbody));

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

        final CodeAttribute codeAttr
            = new CodeAttribute(getCodeAttributeUtf8(),
                                4, // maxStack
                                6, // maxLocals
                                begin,
                                new ExceptionTable(),
                                new AttributeVector());
View Full Code Here

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

        if (keyClassName == null){
            // end of method body
            insn = insn.append(Insn.create(opc_aconst_null));
            insn = insn.append(Insn.create(opc_areturn));

            final CodeAttribute codeAttr
                = new CodeAttribute(getCodeAttributeUtf8(),
                                    1, // maxStack
                                    1, // maxLocals
                                    begin,
                                    new ExceptionTable(),
                                    new AttributeVector());
            augmenter.addMethod(methodName, methodSig, accessFlags,
                                codeAttr, exceptAttr);
            return;
        }
        affirm(keyClassName != null);

        // push a newly created an instance of this class
        insn = insn.append(
            Insn.create(opc_new,
                        pool.addClass(keyClassName)));
        insn = insn.append(Insn.create(opc_dup));
        insn = insn.append(
            Insn.create(opc_invokespecial,
                        pool.addMethodRef(
                            keyClassName,
                            NameHelper.constructorName(),
                            NameHelper.constructorSig())));

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

        final CodeAttribute codeAttr
            = new CodeAttribute(getCodeAttributeUtf8(),
                                2, // maxStack
                                1, // maxLocals
                                begin,
                                new ExceptionTable(),
                                new AttributeVector());
View Full Code Here

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

        if (keyClassName == null){
            // end of method body
            insn = insn.append(Insn.create(opc_aconst_null));
            insn = insn.append(Insn.create(opc_areturn));

            final CodeAttribute codeAttr
                = new CodeAttribute(getCodeAttributeUtf8(),
                                    1, // maxStack
                                    2, // maxLocals
                                    begin,
                                    new ExceptionTable(),
                                    new AttributeVector());
            augmenter.addMethod(methodName, methodSig, accessFlags,
                                codeAttr, exceptAttr);
            return;
        }
        affirm(keyClassName != null);

        // TODO: support for single field identity

        // push a newly created an instance of this class
        insn = insn.append(
            Insn.create(opc_new,
                        pool.addClass(keyClassName)));
        insn = insn.append(Insn.create(opc_dup));
        insn = insn.append(Insn.create(opc_aload_1));
        insn = insn.append(Insn.create(opc_checkcast,
                                       pool.addClass(JAVA_String_Path)));
        insn = insn.append(
            Insn.create(opc_invokespecial,
                        pool.addMethodRef(
                            keyClassName,
                            NameHelper.constructorName(),
                            NameHelper.constructorSig(JAVA_String_Sig))));

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

        final CodeAttribute codeAttr
            = new CodeAttribute(getCodeAttributeUtf8(),
                                3, // maxStack
                                2, // maxLocals
                                begin,
                                new ExceptionTable(),
                                new AttributeVector());
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.