< prev index next >

test/jdk/java/lang/instrument/asmlib/Instrumentor.java

Print this page
rev 52456 : imported patch asm.additional

*** 100,118 **** output = new ClassWriter(ClassWriter.COMPUTE_MAXS); instrumentingVisitor = output; } public synchronized Instrumentor addMethodEntryInjection(String methodName, Consumer<InstrHelper> injector) { ! instrumentingVisitor = new ClassVisitor(Opcodes.ASM5, instrumentingVisitor) { @Override public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) { MethodVisitor mv = super.visitMethod(access, name, desc, signature, exceptions); if (name.equals(methodName)) { matches.getAndIncrement(); ! mv = new MethodVisitor(Opcodes.ASM5, mv) { @Override public void visitCode() { injector.accept(new InstrHelper(mv, name)); } }; --- 100,118 ---- output = new ClassWriter(ClassWriter.COMPUTE_MAXS); instrumentingVisitor = output; } public synchronized Instrumentor addMethodEntryInjection(String methodName, Consumer<InstrHelper> injector) { ! instrumentingVisitor = new ClassVisitor(Opcodes.ASM7, instrumentingVisitor) { @Override public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) { MethodVisitor mv = super.visitMethod(access, name, desc, signature, exceptions); if (name.equals(methodName)) { matches.getAndIncrement(); ! mv = new MethodVisitor(Opcodes.ASM7, mv) { @Override public void visitCode() { injector.accept(new InstrHelper(mv, name)); } };
*** 122,132 **** }; return this; } public synchronized Instrumentor addNativeMethodTrackingInjection(String prefix, Consumer<InstrHelper> injector) { ! instrumentingVisitor = new ClassVisitor(Opcodes.ASM5, instrumentingVisitor) { private final Set<Consumer<ClassVisitor>> wmGenerators = new HashSet<>(); private String className; @Override public void visit(int version, int access, String name, String signature, String superName, String[] interfaces) { --- 122,132 ---- }; return this; } public synchronized Instrumentor addNativeMethodTrackingInjection(String prefix, Consumer<InstrHelper> injector) { ! instrumentingVisitor = new ClassVisitor(Opcodes.ASM7, instrumentingVisitor) { private final Set<Consumer<ClassVisitor>> wmGenerators = new HashSet<>(); private String className; @Override public void visit(int version, int access, String name, String signature, String superName, String[] interfaces) {
< prev index next >