protected MethodVisitor makeDelegateCall(final String name,final String desc,final String signature,final String[] exceptions,final int accessFlags){
  MethodVisitor mv=super.visitMethod(accessFlags,name,desc,signature,exceptions);
  mv.visitVarInsn(ALOAD,0);
  mv.visitFieldInsn(GETFIELD,proxyName,DELEGATE_OBJECT_FIELD,BytecodeHelper.getTypeDescription(delegateClass));
  int size;
  mv.visitLdcInsn(name);
  Type[] args=Type.getArgumentTypes(desc);
  BytecodeHelper.pushConstant(mv,args.length);
  mv.visitTypeInsn(ANEWARRAY,"java/lang/Object");
  size=6;
  int idx=1;
  for (int i=0; i < args.length; i++) {
    Type arg=args[i];
    mv.visitInsn(DUP);
    BytecodeHelper.pushConstant(mv,i);
    if (isPrimitive(arg)) {
      mv.visitIntInsn(getLoadInsn(arg),idx);
      String wrappedType=getWrappedClassDescriptor(arg);
      mv.visitMethodInsn(INVOKESTATIC,wrappedType,"valueOf","(" + arg.getDescriptor() + ")L"+ wrappedType+ ";",false);
    }
 else {
      mv.visitVarInsn(ALOAD,idx);
    }
    size=Math.max(size,5 + registerLen(arg));
    idx+=registerLen(arg);
    mv.visitInsn(AASTORE);
  }
  mv.visitMethodInsn(INVOKESTATIC,"org/codehaus/groovy/runtime/InvokerHelper","invokeMethod","(Ljava/lang/Object;Ljava/lang/String;Ljava/lang/Object;)Ljava/lang/Object;",false);
  unwrapResult(mv,desc);
  mv.visitMaxs(size,registerLen(args) + 1);
  return mv;
}

protected MethodVisitor makeDelegateCall ( final String name , final String desc , final String signature , final String [ ] exceptions , final int accessFlags ) { MethodVisitor mv = super . visitMethod ( accessFlags , name , desc , signature , exceptions ) ; mv . visitVarInsn ( ALOAD , 0 ) ; mv . visitFieldInsn ( GETFIELD , proxyName , DELEGATE_OBJECT_FIELD , BytecodeHelper . getTypeDescription ( delegateClass ) ) ; int size ; mv . visitLdcInsn ( name ) ; Type [ ] args = Type . getArgumentTypes ( desc ) ; BytecodeHelper . pushConstant ( mv , args . length ) ; mv . visitTypeInsn ( ANEWARRAY , "java/lang/Object" ) ; size = 6 ; int idx = 1 ; for ( int i = 0 ; i < args . length ; i ++ ) { Type arg = args [ i ] ; mv . visitInsn ( DUP ) ; BytecodeHelper . pushConstant ( mv , i ) ; if ( isPrimitive ( arg ) ) { mv . visitIntInsn ( getLoadInsn ( arg ) , idx ) ; String wrappedType = getWrappedClassDescriptor ( arg ) ; mv . visitMethodInsn ( INVOKESTATIC , wrappedType , "valueOf" , "(" + arg . getDescriptor ( ) + ")L" + wrappedType + ";" , false ) ; } else { mv . visitVarInsn ( ALOAD , idx ) ; } size = Math . max ( size , 5 + registerLen ( arg ) ) ; idx += registerLen ( arg ) ; mv . visitInsn ( AASTORE ) ; } mv . visitMethodInsn ( INVOKESTATIC , "org/codehaus/groovy/runtime/InvokerHelper" , "invokeMethod" , "(Ljava/lang/Object;Ljava/lang/String;Ljava/lang/Object;)Ljava/lang/Object;" , false ) ; unwrapResult ( mv , desc ) ; mv . visitMaxs ( size , registerLen ( args ) + 1 ) ; return mv ; }
generate a call to the delegate object .
