public static void generateParameterReifierCode(String[] paramTypes,boolean isStatic,final CodeVisitor cv){
  cv.visitIntInsn(SIPUSH,paramTypes.length);
  cv.visitTypeInsn(ANEWARRAY,"java/lang/Object");
  int localVarIndex=isStatic ? 0 : 1;
  for (int i=0; i < paramTypes.length; ++i) {
    String param=paramTypes[i];
    cv.visitInsn(DUP);
    cv.visitIntInsn(SIPUSH,i);
    if (isPrimitive(param)) {
      int opcode;
      if (param.equals("F")) {
        opcode=FLOAD;
      }
 else       if (param.equals("D")) {
        opcode=DLOAD;
      }
 else       if (param.equals("J")) {
        opcode=LLOAD;
      }
 else {
        opcode=ILOAD;
      }
      String type="bsh/Primitive";
      cv.visitTypeInsn(NEW,type);
      cv.visitInsn(DUP);
      cv.visitVarInsn(opcode,localVarIndex);
      String desc=param;
      cv.visitMethodInsn(INVOKESPECIAL,type,"<init>","(" + desc + ")V");
    }
 else {
      cv.visitVarInsn(ALOAD,localVarIndex);
    }
    cv.visitInsn(AASTORE);
    localVarIndex+=((param.equals("D") || param.equals("J")) ? 2 : 1);
  }
}

public static void generateParameterReifierCode ( String [ ] paramTypes , boolean isStatic , final CodeVisitor cv ) { cv . visitIntInsn ( SIPUSH , paramTypes . length ) ; cv . visitTypeInsn ( ANEWARRAY , "java/lang/Object" ) ; int localVarIndex = isStatic ? 0 : 1 ; for ( int i = 0 ; i < paramTypes . length ; ++ i ) { String param = paramTypes [ i ] ; cv . visitInsn ( DUP ) ; cv . visitIntInsn ( SIPUSH , i ) ; if ( isPrimitive ( param ) ) { int opcode ; if ( param . equals ( "F" ) ) { opcode = FLOAD ; } else if ( param . equals ( "D" ) ) { opcode = DLOAD ; } else if ( param . equals ( "J" ) ) { opcode = LLOAD ; } else { opcode = ILOAD ; } String type = "bsh/Primitive" ; cv . visitTypeInsn ( NEW , type ) ; cv . visitInsn ( DUP ) ; cv . visitVarInsn ( opcode , localVarIndex ) ; String desc = param ; cv . visitMethodInsn ( INVOKESPECIAL , type , "<init>" , "(" + desc + ")V" ) ; } else { cv . visitVarInsn ( ALOAD , localVarIndex ) ; } cv . visitInsn ( AASTORE ) ; localVarIndex += ( ( param . equals ( "D" ) || param . equals ( "J" ) ) ? 2 : 1 ) ; } }
generates the code to reify the arguments of the given method . for a method " int m ( int i , string s ) " , this code is the bytecode corresponding to the " new object [ ] { new bsh . primitive ( i ) , s } " expression .
