private void writeConstructor() { org.objectweb.asm.commons.Method initMethod = new org.objectweb.asm.commons.Method("<init>", Type.VOID_TYPE, new Type[] {targetType}); GeneratorAdapter init = new GeneratorAdapter(ACC_PUBLIC, initMethod, null, null, this); init.loadThis(); init.invokeConstructor(OBJECT_TYPE, OBJECT_INIT); init.loadThis(); init.loadArg(0); init.putField(reflectorType, TARGET_FIELD, targetType); init.returnValue(); init.endMethod(); }
@Override public void visit(int version, int access, String name, String signature, String superName, String[] interfaces) { super.visit(version, access, name, signature, superName, interfaces); clzName = name; }
private BaseAdapter( Method method, org.objectweb.asm.commons.Method asmMethod, MethodVisitor methodVisitor) { super( Opcodes.ASM6, methodVisitor, Opcodes.ACC_PUBLIC, asmMethod.getName(), asmMethod.getDescriptor()); this.iMethod = method; }
private void invokeMethodOnLock(GeneratorAdapter interceptedTargetVisitor, String field, Method method) { interceptedTargetVisitor.loadThis(); interceptedTargetVisitor.getField(proxyType, field, TYPE_LOCK); interceptedTargetVisitor.invokeInterface(TYPE_LOCK, method); }
BaseAdapter(Method method) { this(org.objectweb.asm.commons.Method.getMethod(method), method); }
void handler() { generatorAdapter.mark(handler); } }
@Override public void visit(int version, int access, String name, String signature, String superName, String[] interfaces) { // For java/lang/Object redefinition String newName = remapper.mapType(name); if (newName.equals("java/lang/Object")) { superName = null; isObject = true; } super.visit(version, access, name, signature, superName, interfaces); }
public String getClassName() { return remapper.mapType(className); }
public MethodVisitor visitMethod(int arg0, String arg1, String arg2, String arg3, String[] arg4) { return new EmptyVisitor(); }
private void asm(int opcode) { aa.visitInsn(opcode); }
private MethodVisitor superMethodVisitor(int access, String name, String desc, String signature, String[] exceptions) { return super.visitMethod(access, name, desc, signature, exceptions); }
@Override public void visitEnd() { for (AsmTryCatchBlock tcb : asmTryCatchBlocks) { super.visitTryCatchBlock(tcb.start, tcb.end, tcb.handler, tcb.type); } super.visitEnd(); } };
@Override public void visitLineNumber(int line, Label start) { super.visitLineNumber(line, start); currentLineNumber = line; }
private static org.objectweb.asm.commons.Method asmMethod(Method method) { return org.objectweb.asm.commons.Method.getMethod(method); }
void handler() { generatorAdapter.mark(handler); } }
/** * Get renamed class name. * * @return */ public String getClassName() { return remapper.mapType(className); }
private void asm(int opcode) { aa.visitInsn(opcode); }
void end() { generatorAdapter.mark(end); }
@Override public void visitInsn(int opcode) { super.visitInsn(opcode); codeLockForTracing.code(opcode); }
void end() { generatorAdapter.mark(end); }