-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDieMethodDie.java
39 lines (31 loc) · 930 Bytes
/
DieMethodDie.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import org.objectweb.asm.*;
public class DieMethodDie extends MethodVisitor {
private final MethodVisitor targetWriter;
private final int locals;
DieMethodDie(MethodVisitor writer, int llocals) {
super(Opcodes.ASM5);
targetWriter = writer;
locals = llocals;
}
@Override
public void visitMaxs(int maxStack, int maxLocals) {
targetWriter.visitMaxs(0, locals);
}
@Override
public void visitCode() {
targetWriter.visitCode();
targetWriter.visitInsn(Opcodes.RETURN);
}
@Override
public void visitEnd() {
targetWriter.visitEnd();
}
@Override
public AnnotationVisitor visitAnnotation(String desc, boolean visible) {
return targetWriter.visitAnnotation(desc, visible);
}
@Override
public void visitParameter(String name, int access) {
targetWriter.visitParameter(name, access);
}
}