Package org.objectweb.asm

Examples of org.objectweb.asm.MethodVisitor.visitEnd()


          "()Ljava/lang/Object;", null, null);
      mv.visitCode();
      mv.visitVarInsn(ALOAD, 0);
      mv.visitInsn(ARETURN);
      mv.visitMaxs(1, 1);
      mv.visitEnd();
    }
    cv.visitEnd();
  }
}
View Full Code Here


      mv.visitVarInsn(ALOAD, 0);
      mv.visitMethodInsn(INVOKESPECIAL, "java/lang/Object", "<init>",
          "()V");
      mv.visitInsn(RETURN);
      mv.visitMaxs(1, 1);
      mv.visitEnd();
    }
    mv = cv.visitMethod(ACC_PUBLIC, "getF", "()I", null, null);
    if (mv != null) {
      mv.visitCode();
      mv.visitVarInsn(ALOAD, 0);
View Full Code Here

      mv.visitCode();
      mv.visitVarInsn(ALOAD, 0);
      mv.visitFieldInsn(GETFIELD, "pkg/Bean", "f", "I");
      mv.visitInsn(IRETURN);
      mv.visitMaxs(1, 1);
      mv.visitEnd();
    }
    mv = cv.visitMethod(ACC_PUBLIC, "setF", "(I)V", null, null);
    if (mv != null) {
      mv.visitCode();
      mv.visitVarInsn(ALOAD, 0);
View Full Code Here

      mv.visitVarInsn(ALOAD, 0);
      mv.visitVarInsn(ILOAD, 1);
      mv.visitFieldInsn(PUTFIELD, "pkg/Bean", "f", "I");
      mv.visitInsn(RETURN);
      mv.visitMaxs(2, 2);
      mv.visitEnd();
    }
    mv = cv.visitMethod(ACC_PUBLIC, "checkAndSetF", "(I)V", null, null);
    if (mv != null) {
      mv.visitCode();
      mv.visitVarInsn(ILOAD, 1);
View Full Code Here

      mv.visitInsn(ATHROW);
      mv.visitLabel(end);
      mv.visitFrame(F_SAME, 0, null, 0, null);
      mv.visitInsn(RETURN);
      mv.visitMaxs(2, 2);
      mv.visitEnd();
    }
    cv.visitEnd();
    return cw.toByteArray();
  }
}
View Full Code Here

      mv.visitVarInsn(ALOAD, 0);
      mv.visitMethodInsn(INVOKESPECIAL, "java/lang/Object", "<init>",
          "()V");
      mv.visitInsn(RETURN);
      mv.visitMaxs(1, 1);
      mv.visitEnd();
    }

    Iterator<Map.Entry<String, Type>> i = fields.entrySet().iterator();
    while (i.hasNext()) {
      Map.Entry<String, Type> e = i.next();
View Full Code Here

        mv.visitCode();
        mv.visitVarInsn(ALOAD, 0);
        mv.visitFieldInsn(GETFIELD, name, fName, fDesc);
        mv.visitInsn(fType.getOpcode(IRETURN));
        mv.visitMaxs(fType.getSize(), 1);
        mv.visitEnd();
      }

      // generate setter
      mName = "set" + up(fName);
      mDesc = "(" + fDesc + ")V";
View Full Code Here

        mv.visitVarInsn(ALOAD, 0);
        mv.visitVarInsn(fType.getOpcode(ILOAD), 1);
        mv.visitFieldInsn(PUTFIELD, name, fName, fDesc);
        mv.visitInsn(RETURN);
        mv.visitMaxs(1 + fType.getSize(), 1 + fType.getSize());
        mv.visitEnd();
      }
    }

    cv.visitEnd();
  }
View Full Code Here

        mv.visitMethodInsn(INVOKESPECIAL, SUPER_CLASS, "<init>", "()V");
        Label line = new Label();
        mv.visitLineNumber(0, line);
        mv.visitInsn(RETURN);
        mv.visitMaxs(1, 1);
        mv.visitEnd();
        return cw;
    }

    @Deprecated
    private ClassWriter createCtorFast(String namePath) throws Exception {
View Full Code Here

        mv.visitMethodInsn(INVOKESPECIAL, FAST_SUPER_CLASS, "<init>", "()V");
        Label line = new Label();
        mv.visitLineNumber(0, line);
        mv.visitInsn(RETURN);
        mv.visitMaxs(1, 1);
        mv.visitEnd();
        return cw;
    }

    private ClassWriter createBlockCtor(String namePath) throws Exception {
        ClassWriter cw = new ClassWriter(ClassWriter.COMPUTE_MAXS);
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.