SpeedTracerLogger.start(DevModeEventType.CLASS_BYTES_REWRITE, "Class Name", className);
String desc = toDescriptor(className);
assert (!jsoIntfDescs.contains(desc));
// The ASM model is to chain a bunch of visitors together.
ClassWriter writer = new ClassWriter(0);
ClassVisitor v = writer;
// v = new CheckClassAdapter(v);
// v = new TraceClassVisitor(v, new PrintWriter(System.out));
v = new UseMirroredClasses(v, className);
v = new RewriteSingleJsoImplDispatches(v, typeOracle, jsoData);
v = new RewriteRefsToJsoClasses(v, jsoIntfDescs, mapper);
if (jsoImplDescs.contains(desc)) {
v = WriteJsoImpl.create(v, desc, jsoIntfDescs, mapper, jsoData);
}
v = new RewriteJsniMethods(v, anonymousClassMap);
if (Double.parseDouble(System.getProperty("java.class.version")) < Opcodes.V1_6) {
v = new ForceClassVersion15(v);
}
new ClassReader(classBytes).accept(v, 0);
classBytesRewriteEvent.end();
return writer.toByteArray();
}