Package javassist.bytecode

Examples of javassist.bytecode.Bytecode.addLdc()


   
    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);
View Full Code Here


        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");
        for(int i = 0; i < names.length; i++) {
            if(names[i] != null)
                b.add(Opcode.DUP);
View Full Code Here

                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");
        return b;
View Full Code Here

        return b;
    }
   
    private static Bytecode makeExitMethod(CtBehavior behavior, String className, String methodName, String signature) {
        Bytecode b = new Bytecode(behavior.getMethodInfo().getConstPool());
        b.addLdc(className);
        b.addLdc(methodName);
        b.addLdc(signature);
        b.addInvokestatic("play.classloading.enhancers.LVEnhancer$LVEnhancerRuntime", "exitMethod", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V");
        return b;
    }
View Full Code Here

    }
   
    private static Bytecode makeExitMethod(CtBehavior behavior, String className, String methodName, String signature) {
        Bytecode b = new Bytecode(behavior.getMethodInfo().getConstPool());
        b.addLdc(className);
        b.addLdc(methodName);
        b.addLdc(signature);
        b.addInvokestatic("play.classloading.enhancers.LVEnhancer$LVEnhancerRuntime", "exitMethod", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V");
        return b;
    }
   
View Full Code Here

   
    private static Bytecode makeExitMethod(CtBehavior behavior, String className, String methodName, String signature) {
        Bytecode b = new Bytecode(behavior.getMethodInfo().getConstPool());
        b.addLdc(className);
        b.addLdc(methodName);
        b.addLdc(signature);
        b.addInvokestatic("play.classloading.enhancers.LVEnhancer$LVEnhancerRuntime", "exitMethod", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V");
        return b;
    }
   
    private static Bytecode makeEnterMethod(CtBehavior behavior, String className, String methodName, String signature) {
View Full Code Here

        return b;
    }
   
    private static Bytecode makeEnterMethod(CtBehavior behavior, String className, String methodName, String signature) {
        Bytecode b = new Bytecode(behavior.getMethodInfo().getConstPool());
        b.addLdc(className);
        b.addLdc(methodName);
        b.addLdc(signature);
        b.addInvokestatic("play.classloading.enhancers.LVEnhancer$LVEnhancerRuntime", "enterMethod", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V");
        return b;
    }
View Full Code Here

    }
   
    private static Bytecode makeEnterMethod(CtBehavior behavior, String className, String methodName, String signature) {
        Bytecode b = new Bytecode(behavior.getMethodInfo().getConstPool());
        b.addLdc(className);
        b.addLdc(methodName);
        b.addLdc(signature);
        b.addInvokestatic("play.classloading.enhancers.LVEnhancer$LVEnhancerRuntime", "enterMethod", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V");
        return b;
    }
   
View Full Code Here

   
    private static Bytecode makeEnterMethod(CtBehavior behavior, String className, String methodName, String signature) {
        Bytecode b = new Bytecode(behavior.getMethodInfo().getConstPool());
        b.addLdc(className);
        b.addLdc(methodName);
        b.addLdc(signature);
        b.addInvokestatic("play.classloading.enhancers.LVEnhancer$LVEnhancerRuntime", "enterMethod", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V");
        return b;
    }
   
    private static void insert(Bytecode b, CtClass ctClass, CtBehavior behavior, CodeAttribute codeAttribute, FrameIterator iterator, Frame frame, boolean after) throws CompileError, BadBytecode, NotFoundException {
View Full Code Here

    }

    private static Bytecode makeBytecodeForLVStore(CtMethod method, String sig, String name, int slot) {
        Bytecode b = new Bytecode(method.getMethodInfo().getConstPool());
        b.addLdc(name);
        if ("I".equals(sig) || "B".equals(sig) || "C".equals(sig) || "S".equals(sig) || "Z".equals(sig))
            b.addIload(slot);
        else if ("F".equals(sig))
            b.addFload(slot);
        else if ("J".equals(sig))
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.