/** Validates argument index. */ public static void checkArgumentIndex( MethodSignatureVisitor msign, int argIndex, Class<? extends ProxyAdvice> advice) { if ((argIndex < 1) || (argIndex > msign.getArgumentsCount())) { throw new ProxettaException( "Invalid argument index: '" + argIndex + "' used in advice: " + advice.getName()); } }
/** Loads all method arguments before INVOKEVIRTUAL call. */ public static void loadVirtualMethodArguments(MethodVisitor mv, MethodSignatureVisitor msign) { for (int i = 1; i <= msign.getArgumentsCount(); i++) { loadMethodArgument(mv, msign, i); } }
/** Loads all method arguments before INVOKESPECIAL call. */ public static void loadSpecialMethodArguments(MethodVisitor mv, MethodSignatureVisitor msign) { mv.visitVarInsn(ALOAD, 0); for (int i = 1; i <= msign.getArgumentsCount(); i++) { loadMethodArgument(mv, msign, i); } }