Package serp.bytecode

Examples of serp.bytecode.Code.calculateMaxLocals()


            code.invokevirtual().setMethod(type, "setTimeZone", void.class,
                new Class[] { TimeZone.class });
        }
        code.areturn();
        code.calculateMaxStack();
        code.calculateMaxLocals();

        // new instance factory
        m = bc.declareMethod("newInstance", ProxyCalendar.class, null);
        m.makePublic();
        code = m.getCode(true);
View Full Code Here


        code.anew().setType(bc);
        code.dup();
        code.invokespecial().setMethod("<init>", void.class, null);
        code.areturn();
        code.calculateMaxStack();
        code.calculateMaxLocals();

        // proxy the protected computeFields method b/c it is called on
        // mutate, and some setters are final and therefore not proxyable
        m = bc.declareMethod("computeFields", void.class, null);
        m.makeProtected();
View Full Code Here

            new Class[] { Proxy.class, boolean.class });
        code.aload().setThis();
        code.invokespecial().setMethod(type, "computeFields", void.class, null);
        code.vreturn();
        code.calculateMaxStack();
        code.calculateMaxLocals();
    }

    /**
     * Implement the methods in the {@link ProxyBean} interface.
     */
 
View Full Code Here

        code.invokespecial().setMethod(cons);
        if (params.length == 0)
            copyProperties(type, code);
        code.areturn();
        code.calculateMaxStack();
        code.calculateMaxLocals();

        // new instance factory
        m = bc.declareMethod("newInstance", ProxyBean.class,
            new Class[] { Object.class });
        m.makePublic();
View Full Code Here

        code.invokespecial().setMethod("<init>", void.class, params);
        if (params.length == 0)
            copyProperties(type, code);
        code.areturn();
        code.calculateMaxStack();
        code.calculateMaxLocals();
    }

    /**
     * Copy bean properties.  Called with the copy object on the stack.  Must
     * return with the copy object on the stack.
View Full Code Here

            code.xload().setParam(i - 1).setType(params[i]);
        code.invokestatic().setMethod(helper);
        code.xreturn().setType(meth.getReturnType());

        code.calculateMaxStack();
        code.calculateMaxLocals();
    }

    /**
     * Proxy the given method with one that overrides it by calling into the
     * given helper.
View Full Code Here

            code.invokestatic().setMethod(after);
        }
        code.xreturn().setType(meth.getReturnType());

        code.calculateMaxStack();
        code.calculateMaxLocals();
    }

    /**
     * Return whether the given method is a setter.
     */
 
View Full Code Here

        for (int i = 0; i < params.length; i++)
            code.xload().setParam(i).setType(params[i]);
        code.invokespecial().setMethod(type, meth.getName(), ret, params);
        code.xreturn().setType(ret);
        code.calculateMaxStack();
        code.calculateMaxLocals();
    }

    /**
     * Add a writeReplace implementation that serializes to a non-proxy type
     * unless detached and this is a build-time generated class.
View Full Code Here

        code.aload().setThis();
        code.constant().setValue(!runtime);
        code.invokestatic().setMethod(Proxies.class, "writeReplace",
            Object.class, new Class[] { Proxy.class, boolean.class });
        code.areturn();
        code.calculateMaxLocals();
        code.calculateMaxStack();
    }

    /**
     * Create a unique id to avoid proxy class name conflicts.
View Full Code Here

            getfield(code, _managedType.getProject().loadClass(declarer),
                name);
        } else
            code.constant().setNull();
        code.areturn();
        code.calculateMaxLocals();
        code.calculateMaxStack();

        // public void pcSetDetachedState (Object state)
        method = _pc.declareMethod(PRE + "SetDetachedState",
            void.class, new Class []{ Object.class });
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.