fix jsr problem. #1304

pull/920/merge
hengyunabc 5 years ago
parent 4a48a7b073
commit 94b95b2ab6

@ -155,6 +155,19 @@ public class AsmUtils {
return result;
}
public static ClassNode removeJSRInstructions(ClassNode classNode) {
ClassNode result = new ClassNode(Opcodes.ASM8);
classNode.accept(new ClassVisitor(Opcodes.ASM8, result) {
@Override
public MethodVisitor visitMethod(int access, String name, String desc, String signature,
String[] exceptions) {
MethodVisitor mv = super.visitMethod(access, name, desc, signature, exceptions);
return new JSRInlinerAdapter(mv, access, name, desc, signature, exceptions);
}
});
return result;
}
public static MethodNode removeLineNumbers(MethodNode methodNode) {
MethodNode result = newMethodNode(methodNode);
methodNode.accept(new MethodVisitor(Opcodes.ASM8, result) {

@ -123,6 +123,8 @@ public class Enhancer implements ClassFileTransformer {
}
ClassNode classNode = AsmUtils.toClassNode(classfileBuffer);
// remove JSR https://github.com/alibaba/arthas/issues/1304
classNode = AsmUtils.removeJSRInstructions(classNode);
// 生成增强字节码
DefaultInterceptorClassParser defaultInterceptorClassParser = new DefaultInterceptorClassParser();

Loading…
Cancel
Save