use of org.jetbrains.org.objectweb.asm.util.TraceMethodVisitor in project kotlin by JetBrains.
the class FunctionCodegen method renderByteCodeIfAvailable.
private static String renderByteCodeIfAvailable(MethodVisitor mv) {
String bytecode = null;
if (mv instanceof TransformationMethodVisitor) {
mv = ((TransformationMethodVisitor) mv).getTraceMethodVisitorIfPossible();
}
if (mv instanceof TraceMethodVisitor) {
TraceMethodVisitor traceMethodVisitor = (TraceMethodVisitor) mv;
StringWriter sw = new StringWriter();
PrintWriter pw = new PrintWriter(sw);
traceMethodVisitor.p.print(pw);
pw.close();
bytecode = sw.toString();
}
return bytecode;
}
Aggregations