@Override public void visitFieldInsn(final int opcode, final String owner, final String name, final String desc) { minSize += 3; maxSize += 3; if (mv != null) { mv.visitFieldInsn(opcode, owner, name, desc); } }
public void getstatic(final String owner, final String name, final String desc) { mv.visitFieldInsn(Opcodes.GETSTATIC, owner, name, desc); }
public void putstatic(final String owner, final String name, final String desc) { mv.visitFieldInsn(Opcodes.PUTSTATIC, owner, name, desc); }
public void getfield(final String owner, final String name, final String desc) { mv.visitFieldInsn(Opcodes.GETFIELD, owner, name, desc); }
public void putfield(final String owner, final String name, final String desc) { mv.visitFieldInsn(Opcodes.PUTFIELD, owner, name, desc); }
/** * Visits a field instruction. A field instruction is an instruction that * loads or stores the value of a field of an object. * * @param opcode * the opcode of the type instruction to be visited. This opcode * is either GETSTATIC, PUTSTATIC, GETFIELD or PUTFIELD. * @param owner * the internal name of the field's owner class (see * {@link Type#getInternalName() getInternalName}). * @param name * the field's name. * @param desc * the field's descriptor (see {@link Type Type}). */ public void visitFieldInsn(int opcode, String owner, String name, String desc) { if (mv != null) { mv.visitFieldInsn(opcode, owner, name, desc); } }
@Override public void accept(final MethodVisitor mv) { mv.visitFieldInsn(opcode, owner, name, desc); acceptAnnotations(mv); }
@Override public void visitFieldInsn(final int opcode, final String owner, final String name, final String desc) { p.visitFieldInsn(opcode, owner, name, desc); super.visitFieldInsn(opcode, owner, name, desc); }
@Override public void visitFieldInsn(final int opcode, final String owner, final String name, final String desc) { if (mv != null) { mv.visitFieldInsn(opcode, owner, name, desc); } execute(opcode, 0, desc); }
switch (value.getSort()) { case Type.BOOLEAN: mv.visitFieldInsn(Opcodes.GETSTATIC, "java/lang/Boolean", "TYPE", CLDESC); break; case Type.CHAR: mv.visitFieldInsn(Opcodes.GETSTATIC, "java/lang/Character", "TYPE", CLDESC); break; case Type.BYTE: mv.visitFieldInsn(Opcodes.GETSTATIC, "java/lang/Byte", "TYPE", CLDESC); break; case Type.SHORT: mv.visitFieldInsn(Opcodes.GETSTATIC, "java/lang/Short", "TYPE", CLDESC); break; case Type.INT: mv.visitFieldInsn(Opcodes.GETSTATIC, "java/lang/Integer", "TYPE", CLDESC); break; case Type.FLOAT: mv.visitFieldInsn(Opcodes.GETSTATIC, "java/lang/Float", "TYPE", CLDESC); break; case Type.LONG: mv.visitFieldInsn(Opcodes.GETSTATIC, "java/lang/Long", "TYPE", CLDESC); break;
protected void instrumentRemoveClassName(ClassReader cr,MethodVisitor mv){ mv.visitFieldInsn(Opcodes.GETSTATIC, cr.getClassName(), "className", "Ljava/lang/ThreadLocal;"); mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, "java/lang/ThreadLocal", "remove", "()V",false); }
/** * Generates a get field or set field instruction. * * @param opcode * the instruction's opcode. * @param ownerType * the class in which the field is defined. * @param name * the name of the field. * @param fieldType * the type of the field. */ private void fieldInsn(final int opcode, final Type ownerType, final String name, final Type fieldType) { mv.visitFieldInsn(opcode, ownerType.getInternalName(), name, fieldType.getDescriptor()); }
protected void instrumentSetClassName(ClassReader cr,MethodVisitor mv){ mv.visitFieldInsn(Opcodes.GETSTATIC, cr.getClassName(), "className", "Ljava/lang/ThreadLocal;"); mv.visitLdcInsn(cr.getClassName().replace('/', '.')); mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, "java/lang/ThreadLocal", "set", "(Ljava/lang/Object;)V",false); }
protected void getTransactionManager() { if(!methodBodyOnly) { mv.visitVarInsn(Opcodes.ALOAD, 0); mv.visitFieldInsn(GETFIELD, type.getInternalName(), MANAGER_FIELD, MANAGER_TYPE.getDescriptor()); }else{ invokeStatic(TxInst.TYPE,TxInst.MANAGER); } }
@Override public void visitFieldInsn(final int opcode, final String owner, final String name, final String desc) { mv.visitFieldInsn(opcode, owner, name, desc); if (constructor) { char c = desc.charAt(0);
mv.visitFieldInsn(Opcodes.GETSTATIC, classNameInternal, field.getName(), Type.getDescriptor(field.getType())); }else{ mv.visitFieldInsn(GETFIELD, classNameInternal, field.getName(), Type.getDescriptor(field.getType()));
mv.visitFieldInsn(Opcodes.PUTSTATIC, classNameInternal, field.getName(), fieldType.getDescriptor()); }else{ mv.visitFieldInsn(PUTFIELD, classNameInternal, field.getName(), fieldType.getDescriptor());
String idesc = readUTF8(cpIndex + 2, c); if (opcode < Opcodes.INVOKEVIRTUAL) { mv.visitFieldInsn(opcode, iowner, iname, idesc); } else { mv.visitMethodInsn(opcode, iowner, iname, idesc, itf);