/** * Visits a local variable declaration. * * @param name the name of a local variable. * @param descriptor the type descriptor of this local variable. * @param signature the type signature of this local variable. May be {@literal null} if the local * variable type does not use generic types. * @param start the first instruction corresponding to the scope of this local variable * (inclusive). * @param end the last instruction corresponding to the scope of this local variable (exclusive). * @param index the local variable's index. * @throws IllegalArgumentException if one of the labels has not already been visited by this * visitor (by the {@link #visitLabel} method). */ public void visitLocalVariable( final String name, final String descriptor, final String signature, final Label start, final Label end, final int index) { if (mv != null) { mv.visitLocalVariable(name, descriptor, signature, start, end, index); } }
methodVisitor.visitLocalVariable( name, descriptor, signature, labels[startPc], labels[startPc + length], index);
/** * Visits a local variable declaration. * * @param name the name of a local variable. * @param descriptor the type descriptor of this local variable. * @param signature the type signature of this local variable. May be {@literal null} if the local * variable type does not use generic types. * @param start the first instruction corresponding to the scope of this local variable * (inclusive). * @param end the last instruction corresponding to the scope of this local variable (exclusive). * @param index the local variable's index. * @throws IllegalArgumentException if one of the labels has not already been visited by this * visitor (by the {@link #visitLabel} method). */ public void visitLocalVariable( final String name, final String descriptor, final String signature, final Label start, final Label end, final int index) { if (mv != null) { mv.visitLocalVariable(name, descriptor, signature, start, end, index); } }
methodVisitor.visitLocalVariable( name, descriptor, signature, labels[startPc], labels[startPc + length], index);
/** * Visits a local variable declaration. * * @param name the name of a local variable. * @param descriptor the type descriptor of this local variable. * @param signature the type signature of this local variable. May be {@literal null} if the local * variable type does not use generic types. * @param start the first instruction corresponding to the scope of this local variable * (inclusive). * @param end the last instruction corresponding to the scope of this local variable (exclusive). * @param index the local variable's index. * @throws IllegalArgumentException if one of the labels has not already been visited by this * visitor (by the {@link #visitLabel} method). */ public void visitLocalVariable( final String name, final String descriptor, final String signature, final Label start, final Label end, final int index) { if (mv != null) { mv.visitLocalVariable(name, descriptor, signature, start, end, index); } }
methodVisitor.visitLocalVariable( name, descriptor, signature, labels[startPc], labels[startPc + length], index);
/** * Visits a local variable declaration. * * @param name the name of a local variable. * @param descriptor the type descriptor of this local variable. * @param signature the type signature of this local variable. May be {@literal null} if the local * variable type does not use generic types. * @param start the first instruction corresponding to the scope of this local variable * (inclusive). * @param end the last instruction corresponding to the scope of this local variable (exclusive). * @param index the local variable's index. * @throws IllegalArgumentException if one of the labels has not already been visited by this * visitor (by the {@link #visitLabel} method). */ public void visitLocalVariable( final String name, final String descriptor, final String signature, final Label start, final Label end, final int index) { if (mv != null) { mv.visitLocalVariable(name, descriptor, signature, start, end, index); } }
mv.visitLocalVariable(THIS_REF, referenceName(internalClassName), null, l0, l1, 0); mv.visitLocalVariable("property", "Lorg/springframework/data/mapping/PersistentProperty;", "Lorg/springframework/data/mapping/PersistentProperty<*>;", l0, l1, 1); mv.visitLocalVariable("value", referenceName(JAVA_LANG_OBJECT), null, l0, l1, 2); mv.visitLocalVariable(BEAN_FIELD, getAccessibleTypeReferenceName(entity), null, l0, l1, 3);
visitThrowUnsupportedOperationException(mv, "No accessor to get property %s!"); mv.visitLocalVariable(THIS_REF, referenceName(internalClassName), null, l0, l1, 0); mv.visitLocalVariable("property", referenceName(PERSISTENT_PROPERTY), "Lorg/springframework/data/mapping/PersistentProperty<*>;", l0, l1, 1); mv.visitLocalVariable(BEAN_FIELD, getAccessibleTypeReferenceName(entity), null, l0, l1, 2);
mv.visitInsn(RETURN); mv.visitLocalVariable("lookup", referenceName(JAVA_LANG_INVOKE_METHOD_HANDLES_LOOKUP), null, l0, l1, 0); mv.visitLocalVariable("field", referenceName(JAVA_LANG_REFLECT_FIELD), null, l0, l1, 1); mv.visitLocalVariable("setter", referenceName(JAVA_LANG_REFLECT_METHOD), null, l0, l1, 2); mv.visitLocalVariable("getter", referenceName(JAVA_LANG_REFLECT_METHOD), null, l0, l1, 3); mv.visitLocalVariable("wither", referenceName(JAVA_LANG_REFLECT_METHOD), null, l0, l1, 4); mv.visitLocalVariable(String.format("class_%d", index), referenceName(JAVA_LANG_CLASS), null, l0, l1, index);
private static void visitBeanGetter(PersistentEntity<?, ?> entity, String internalClassName, ClassWriter cw) { // public Object getBean() MethodVisitor mv = cw.visitMethod(ACC_PUBLIC, "getBean", String.format("()%s", referenceName(JAVA_LANG_OBJECT)), null, null); mv.visitCode(); Label l0 = new Label(); // return this.bean mv.visitLabel(l0); mv.visitVarInsn(ALOAD, 0); mv.visitFieldInsn(GETFIELD, internalClassName, BEAN_FIELD, getAccessibleTypeReferenceName(entity)); mv.visitInsn(ARETURN); Label l1 = new Label(); mv.visitLabel(l1); mv.visitLocalVariable(THIS_REF, referenceName(internalClassName), null, l0, l1, 0); mv.visitMaxs(1, 1); mv.visitEnd(); }
Label l3 = new Label(); mv.visitLabel(l3); mv.visitLocalVariable(THIS_REF, referenceName(internalClassName), null, l0, l3, 0); mv.visitLocalVariable(BEAN_FIELD, getAccessibleTypeReferenceName(entity), null, l0, l3, 1);
methodVisitor.visitLocalVariable( name, descriptor, signature, labels[startPc], labels[startPc + length], index);