Package org.hotswap.agent.javassist.compiler

Examples of org.hotswap.agent.javassist.compiler.Javac


        org.hotswap.agent.javassist.bytecode.CodeAttribute ca = methodInfo.getCodeAttribute();
        org.hotswap.agent.javassist.bytecode.CodeIterator iterator = ca.iterator();
        org.hotswap.agent.javassist.bytecode.Bytecode b = new org.hotswap.agent.javassist.bytecode.Bytecode(methodInfo.getConstPool(),
                ca.getMaxStack(), ca.getMaxLocals());
        b.setStackDepth(ca.getMaxStack());
        Javac jv = new Javac(b, cc);
        try {
            jv.recordParams(getParameterTypes(), false);
            jv.compileStmnt(src);
            ca.setMaxStack(b.getMaxStack());
            ca.setMaxLocals(b.getMaxLocals());
            iterator.skipConstructor();
            int pos = iterator.insertEx(b.get());
            iterator.insert(b.getExceptionTable(), pos);
View Full Code Here


     *                       that is called by <code>$proceed()</code>.
     */
    public static org.hotswap.agent.javassist.CtMethod make(String src, org.hotswap.agent.javassist.CtClass declaring,
                                                            String delegateObj, String delegateMethod)
            throws org.hotswap.agent.javassist.CannotCompileException {
        Javac compiler = new Javac(declaring);
        try {
            if (delegateMethod != null)
                compiler.recordProceed(delegateObj, delegateMethod);

            CtMember obj = compiler.compile(src);
            if (obj instanceof org.hotswap.agent.javassist.CtMethod)
                return (org.hotswap.agent.javassist.CtMethod) obj;
        } catch (CompileError e) {
            throw new org.hotswap.agent.javassist.CannotCompileException(e);
        }
View Full Code Here

     * @param src       the source text.
     * @param declaring the class to which the created constructor is added.
     */
    public static CtConstructor make(String src, CtClass declaring)
            throws org.hotswap.agent.javassist.CannotCompileException {
        Javac compiler = new Javac(declaring);
        try {
            CtMember obj = compiler.compile(src);
            if (obj instanceof CtConstructor) {
                // a stack map table has been already created.
                return (CtConstructor) obj;
            }
        } catch (org.hotswap.agent.javassist.compiler.CompileError e) {
View Full Code Here

            throws org.hotswap.agent.javassist.CannotCompileException, org.hotswap.agent.javassist.NotFoundException {
        if (fieldInitializers == null)
            return;

        Bytecode code = new Bytecode(cf.getConstPool(), 0, 0);
        Javac jv = new Javac(code, this);
        int stacksize = 0;
        boolean doInit = false;
        for (FieldInitLink fi = fieldInitializers; fi != null; fi = fi.next) {
            org.hotswap.agent.javassist.CtField f = fi.field;
            if (org.hotswap.agent.javassist.Modifier.isStatic(f.getModifiers())) {
View Full Code Here

    }

    private int makeFieldInitializer(Bytecode code, org.hotswap.agent.javassist.CtClass[] parameters)
            throws org.hotswap.agent.javassist.CannotCompileException, org.hotswap.agent.javassist.NotFoundException {
        int stacksize = 0;
        Javac jv = new Javac(code, this);
        try {
            jv.recordParams(parameters, false);
        } catch (CompileError e) {
            throw new org.hotswap.agent.javassist.CannotCompileException(e);
        }

        for (FieldInitLink fi = fieldInitializers; fi != null; fi = fi.next) {
View Full Code Here

TOP

Related Classes of org.hotswap.agent.javassist.compiler.Javac

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.