Examples of Bytecode

This program produces a Code attribute including a bytecode sequence:

@see ConstPool @see CodeAttribute
  • objot.bytecode.Bytecode
  • org.hotswap.agent.javassist.bytecode.Bytecode
    tant pool table Bytecode b = new Bytecode(cp, 1, 0); b.addIconst(3); b.addReturn(CtClass.intType); CodeAttribute ca = b.toCodeAttribute();

    This program produces a Code attribute including a bytecode sequence:

    @see ConstPool @see CodeAttribute
  • org.jboss.forge.furnace.proxy.javassist.bytecode.Bytecode
    tant pool table Bytecode b = new Bytecode(cp, 1, 0); b.addIconst(3); b.addReturn(CtClass.intType); CodeAttribute ca = b.toCodeAttribute();

    This program produces a Code attribute including a bytecode sequence:

    @see ConstPool @see CodeAttribute

  • Examples of javassist.bytecode.Bytecode

            throws CannotCompileException, 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) {
                CtField f = fi.field;
    View Full Code Here

    Examples of javassist.bytecode.Bytecode

                MethodInfo minfo = (MethodInfo)list.get(i);
                if (minfo.isConstructor()) {
                    CodeAttribute codeAttr = minfo.getCodeAttribute();
                    if (codeAttr != null)
                        try {
                            Bytecode init = new Bytecode(cp, 0,
                                                    codeAttr.getMaxLocals());
                            CtClass[] params
                                = Descriptor.getParameterTypes(
                                                    minfo.getDescriptor(),
                                                    classPool);
    View Full Code Here

    Examples of objot.bytecode.Bytecode

      protected abstract Object forWeave(Class<? extends Aspect> ac, Method m) throws Exception;

      private byte[] make(Class<?> target, Bytes ab, String name, Class<?> sup,
        ArrayList<Constructor<?>> ts, ArrayList<Method> ms)
      {
        Bytecode y = new Bytecode(ab);
        Constants cs = y.cons;
        y.head.setModifier(Mod2.PUBLIC | Mod2.SYNTHETIC);
        int classCi = cs.addClass(name);
        y.head.setSuperCi(cs.addClass(sup));

        Bytes n = cs.getUtf(cs.getClass(y.head.getClassCi()));
        for (int i = 1; i < cs.getConN(); i++)
          if (cs.getTag(i) == Constants.TAG_CLASS && cs.equalsUtf(cs.getClass(i), n))
            cs.setClass(i, cs.getClass(classCi));

        Field f = new Field(cs);
        f.setModifier(Mod2.PUBLIC | Mod2.STATIC);
        f.setNameCi(cs.addUcs(DATAS_NAME));
        f.setDescCi(cs.addUcs(Class2.descript(Object[].class)));
        y.getFields().addField(f);
        int datasCi = cs.addField(y.head.getClassCi(), cs.addNameDesc(f.getNameCi(),
          f.getDescCi()));

        Code ato = y.getProcs().removeProc(y.getProcs().searchProc(CTOR_NAME, null)).getCode();
        for (Constructor<?> t: ts)
          new WeaveProc(target, y, ato).ctor(t);
        Code ao = y.getProcs().removeProc( //
          y.getProcs().searchProc(Aspect.NAME_aspect, null)).getCode();
        for (int i = 0; i < ms.size(); i++)
          new WeaveProc(target, y, ao).method(ms.get(i), i, datasCi);
        y.removeInnerClasses();
        return y.normalize();
      }
    View Full Code Here

    Examples of org.hotswap.agent.javassist.bytecode.Bytecode

         *
         * @param thisClass the class that a compiled method/field
         *                  belongs to.
         */
        public Javac(org.hotswap.agent.javassist.CtClass thisClass) {
            this(new Bytecode(thisClass.getClassFile2().getConstPool(), 0, 0),
                    thisClass);
        }
    View Full Code Here

    Examples of org.jboss.forge.furnace.proxy.javassist.bytecode.Bytecode

         *
         * @param thisClass         the class that a compiled method/field
         *                          belongs to.
         */
        public Javac(CtClass thisClass) {
            this(new Bytecode(thisClass.getClassFile2().getConstPool(), 0, 0),
                 thisClass);
        }
    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.