Package org.objectweb.asm.util

Examples of org.objectweb.asm.util.TraceClassVisitor


*/
public class ComparableGenerator {

  public byte[] generate(PrintWriter printWriter) {
    ClassWriter cw = new ClassWriter(0);
    TraceClassVisitor tcv = new TraceClassVisitor(cw, printWriter);
    CheckClassAdapter cv = new CheckClassAdapter(tcv);
    cv.visit(V1_5, ACC_PUBLIC + ACC_ABSTRACT + ACC_INTERFACE,
        "pkg/Comparable", null, "java/lang/Object",
        new String[] { "pkg/Mesurable" });
    cv.visitSource("Comparable.java", null);
View Full Code Here


*/
public class BeanGenerator2 {

  public byte[] generate(PrintWriter printWriter) {
    ClassWriter cw = new ClassWriter(ClassWriter.COMPUTE_MAXS);
    TraceClassVisitor tcv = new TraceClassVisitor(cw, printWriter);
    CheckClassAdapter cv = new CheckClassAdapter(tcv);
    cv.visit(V1_6, ACC_PUBLIC, "pkg/Bean", null, "java/lang/Object",
        null);
    cv.visitSource("Bean.java", null);
    FieldVisitor fv = cv.visitField(ACC_PRIVATE, "f", "I", null, null);
View Full Code Here

*/
public class BeanGenerator {

  public byte[] generate(PrintWriter printWriter) {
    ClassWriter cw = new ClassWriter(0);
    TraceClassVisitor tcv = new TraceClassVisitor(cw, printWriter);
    CheckClassAdapter cv = new CheckClassAdapter(tcv);
    cv.visit(V1_6, ACC_PUBLIC, "pkg/Bean", null, "java/lang/Object",
        null);
    cv.visitSource("Bean.java", null);
    FieldVisitor fv = cv.visitField(ACC_PRIVATE, "f", "I", null, null);
View Full Code Here

        return classLoader.loadClass(c(getClassname()));
    }
   
    public void dumpClass(PrintStream out) {
        PrintWriter pw = new PrintWriter(out);
        TraceClassVisitor tcv = new TraceClassVisitor(pw);
        new ClassReader(classWriter.toByteArray()).accept(tcv, 0);

        try {
            tcv.print(pw);
        } finally {
            pw.close();
        }
    }
View Full Code Here

        @JRubyMethod(name = "inspect_bytecode")
        public static IRubyObject compiled_script_inspect_bytecode(IRubyObject recv) {
            StringWriter sw = new StringWriter();
            ClassReader cr = new ClassReader((byte[])org.jruby.javasupport.JavaUtil.convertRubyToJava(recv.getInstanceVariables().fastGetInstanceVariable("@code"),byte[].class));
            TraceClassVisitor cv = new TraceClassVisitor(new PrintWriter(sw));
            cr.accept(cv, ClassReader.SKIP_DEBUG);
            return recv.getRuntime().newString(sw.toString());
        }
View Full Code Here

    return instanceClass;
  }

  private void printBytecode(byte[] bytes) {
    ClassReader cr = new ClassReader(bytes);
    cr.accept(new TraceClassVisitor(new PrintWriter(System.out)), 0);
  }
View Full Code Here

    classWriter.visitEnd();

    if (printBytecode) {
      try {
        new ClassReader(new ByteArrayInputStream(classWriter.toByteArray())).accept(
            new TraceClassVisitor(new PrintWriter(System.out)), ClassReader.SKIP_DEBUG);
      } catch (IOException e) {
        e.printStackTrace();
      }
    }
View Full Code Here

  }

  private void startClass() {

    cw = new ClassWriter(ClassWriter.COMPUTE_FRAMES);
    cv = new TraceClassVisitor(cw, new PrintWriter(System.out));
    //cv = new CheckClassAdapter(cv);
    cv.visit(V1_6, ACC_PUBLIC + ACC_SUPER, generationContext.getClassName(), null,
        "java/lang/Object", new String[] { "org/renjin/compiler/CompiledBody" });
  }
View Full Code Here

  }

  private void startClass() {
    cw = new ClassWriter(ClassWriter.COMPUTE_FRAMES);
    //cw = new ClassWriter(0);
    cv = new TraceClassVisitor(cw, new PrintWriter(System.out));
  //  cv = new CheckClassAdapter(cv);
    cv.visit(V1_6, ACC_PUBLIC + ACC_SUPER, generationContext.getClassName(), null, "org/renjin/sexp/Promise", null);

  }
View Full Code Here

    fos.write(b);
    fos.close();

    // "disassembles" the adapted class
    cr = new ClassReader(b);
    cv = new TraceClassVisitor(null, new PrintWriter(System.out));
    cr.accept(cv, new Attribute[] { new CommentAttribute("") }, false);
  }
View Full Code Here

TOP

Related Classes of org.objectweb.asm.util.TraceClassVisitor

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.