Examples of addIconst()


Examples of javassist.bytecode.Bytecode.addIconst()

        FieldInfo finfo = new FieldInfo(cp, HOLDER, HOLDER_TYPE);
        finfo.setAccessFlags(AccessFlag.PRIVATE | AccessFlag.STATIC);
        cf.addField(finfo);
        MethodInfo minfo = new MethodInfo(cp, "<clinit>", "()V");
        Bytecode code = new Bytecode(cp, 0, 0);
        code.addIconst(size * 2);
        code.addAnewarray("java.lang.reflect.Method");
        code.addPutstatic(classname, HOLDER, HOLDER_TYPE);
        code.addOpcode(Bytecode.RETURN);
        minfo.setCodeAttribute(code.toCodeAttribute());
        cf.addMethod(minfo);
View Full Code Here

Examples of javassist.bytecode.Bytecode.addIconst()

        int delIndex = index * 2 + 1;
        int arrayVar = args + 1;
        code.addGetstatic(thisClassName, HOLDER, HOLDER_TYPE);
        code.addAstore(arrayVar);
        code.addAload(arrayVar);
        code.addIconst(origIndex);
        code.addOpcode(Opcode.AALOAD);
        code.addOpcode(Opcode.IFNONNULL);
        int pc = code.currentPc();
        code.addIndex(0);

View Full Code Here

Examples of javassist.bytecode.Bytecode.addIconst()

                b.add(Opcode.POP);
                b.addAstore(3);
                b.addAload(0);
                b.addAload(1);
                b.addAload(3);
                b.addIconst(0);
                b.addAload(3);
                b.add(Opcode.ARRAYLENGTH);
                b.addInvokevirtual("java.lang.ClassLoader", "defineClass", "(Ljava/lang/String;[BII)Ljava/lang/Class;");
                if (method.getDescriptor().equals("Ljava/lang/String;Z)Ljava/lang/Class;")) {
                    b.addIload(2);
View Full Code Here

Examples of javassist.bytecode.Bytecode.addIconst()

                b.add(Opcode.ARRAYLENGTH);
                b.addInvokevirtual("java.lang.ClassLoader", "defineClass", "(Ljava/lang/String;[BII)Ljava/lang/Class;");
                if (method.getDescriptor().equals("Ljava/lang/String;Z)Ljava/lang/Class;")) {
                    b.addIload(2);
                } else {
                    b.addIconst(0);
                }
                b.add(Opcode.IFEQ);
                final JumpMarker linkJumpEnd = JumpUtils.addJumpInstruction(b);
                b.add(Opcode.DUP);
                b.addAload(0);
View Full Code Here

Examples of javassist.bytecode.Bytecode.addIconst()

                                Bytecode bc = new Bytecode(file.getConstPool());
                                ManipulationUtils.pushParametersIntoArray(bc, data.getMethodDesc());
                                // so now our stack looks like unconstructed instance :
                                // array
                                // we need unconstructed instance : int : array : null
                                bc.addIconst(data.getMethodNo());
                                bc.add(Opcode.SWAP);
                                bc.add(Opcode.ACONST_NULL);
                                bc.addInvokespecial(data.getClazz(), "<init>", Constants.ADDED_CONSTRUCTOR_DESCRIPTOR);
                                // and we have our bytecode
                                it.insert(bc.get());
View Full Code Here

Examples of javassist.bytecode.Bytecode.addIconst()

    private static final long startedAt = System.currentTimeMillis();
   
    private static Bytecode makeInitMethodCall(CtBehavior behavior, String method, int nbParameters, String subject, String... names) {
        Bytecode b = new Bytecode(behavior.getMethodInfo().getConstPool());
        b.addLdc(method);
        b.addIconst(nbParameters);
        if(subject == null)
            b.add(Opcode.ACONST_NULL);
        else b.addLdc(subject);
        b.addIconst(names.length);
        b.addAnewarray("java.lang.String");
View Full Code Here

Examples of javassist.bytecode.Bytecode.addIconst()

        b.addLdc(method);
        b.addIconst(nbParameters);
        if(subject == null)
            b.add(Opcode.ACONST_NULL);
        else b.addLdc(subject);
        b.addIconst(names.length);
        b.addAnewarray("java.lang.String");
        for(int i = 0; i < names.length; i++) {
            if(names[i] != null)
                b.add(Opcode.DUP);
        }
View Full Code Here

Examples of javassist.bytecode.Bytecode.addIconst()

            if(names[i] != null)
                b.add(Opcode.DUP);
        }
        for(int i = 0; i < names.length; i++) {
            if(names[i] != null) {
                b.addIconst(i);
                b.addLdc(names[i]);
                b.add(Opcode.AASTORE);
            }
        }
        b.addInvokestatic("play.classloading.enhancers.LVEnhancer$LVEnhancerRuntime", "initMethodCall", "(Ljava/lang/String;ILjava/lang/String;[Ljava/lang/String;)V");
View Full Code Here

Examples of javassist.bytecode.Bytecode.addIconst()

/*  856 */     finfo.setAccessFlags(10);
/*  857 */     cf.addField(finfo);
/*  858 */     MethodInfo minfo = new MethodInfo(cp, "<clinit>", "()V");
/*  859 */     minfo.setAccessFlags(8);
/*  860 */     Bytecode code = new Bytecode(cp, 0, 0);
/*  861 */     code.addIconst(size * 2);
/*  862 */     code.addAnewarray("java.lang.reflect.Method");
/*  863 */     code.addPutstatic(classname, "_methods_", "[Ljava/lang/reflect/Method;");
/*      */
/*  865 */     code.addLconst(-1L);
/*  866 */     code.addPutstatic(classname, "serialVersionUID", "J");
View Full Code Here

Examples of javassist.bytecode.Bytecode.addIconst()

/* 1148 */     code.addAload(0);
/* 1149 */     code.addGetfield(thisClassName, "handler", HANDLER_TYPE);
/* 1150 */     code.addAload(0);
/*      */
/* 1152 */     code.addAload(arrayVar);
/* 1153 */     code.addIconst(origIndex);
/* 1154 */     code.addOpcode(50);
/*      */
/* 1156 */     code.addAload(arrayVar);
/* 1157 */     code.addIconst(delIndex);
/* 1158 */     code.addOpcode(50);
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.