Пример #1
0
 /** Stores one argument. Index is 1-based. No conversion occurs. */
 public static void storeMethodArgument(
     MethodVisitor mv, MethodSignatureVisitor msign, int index) {
   int offset = msign.getArgumentOffset(index);
   int type = msign.getArgumentOpcodeType(index);
   switch (type) {
     case 'V':
       break;
     case 'B':
     case 'C':
     case 'S':
     case 'I':
     case 'Z':
       mv.visitVarInsn(ISTORE, offset);
       break;
     case 'J':
       mv.visitVarInsn(LSTORE, offset);
       break;
     case 'F':
       mv.visitVarInsn(FSTORE, offset);
       break;
     case 'D':
       mv.visitVarInsn(DSTORE, offset);
       break;
     default:
       mv.visitVarInsn(ASTORE, offset);
   }
 }
Пример #2
0
 public static void loadMethodArgumentAsObject(
     MethodVisitor mv, MethodSignatureVisitor msign, int index) {
   int offset = msign.getArgumentOffset(index);
   int type = msign.getArgumentOpcodeType(index);
   switch (type) {
     case 'V':
       break;
     case 'B':
       mv.visitVarInsn(ILOAD, offset);
       AsmUtil.valueOfByte(mv);
       break;
     case 'C':
       mv.visitVarInsn(ILOAD, offset);
       AsmUtil.valueOfCharacter(mv);
       break;
     case 'S':
       mv.visitVarInsn(ILOAD, offset);
       AsmUtil.valueOfShort(mv);
       break;
     case 'I':
       mv.visitVarInsn(ILOAD, offset);
       AsmUtil.valueOfInteger(mv);
       break;
     case 'Z':
       mv.visitVarInsn(ILOAD, offset);
       AsmUtil.valueOfBoolean(mv);
       break;
     case 'J':
       mv.visitVarInsn(LLOAD, offset);
       AsmUtil.valueOfLong(mv);
       break;
     case 'F':
       mv.visitVarInsn(FLOAD, offset);
       AsmUtil.valueOfFloat(mv);
       break;
     case 'D':
       mv.visitVarInsn(DLOAD, offset);
       AsmUtil.valueOfDouble(mv);
       break;
     default:
       mv.visitVarInsn(ALOAD, offset);
   }
 }
Пример #3
0
 public static void storeMethodArgumentFromObject(
     MethodVisitor mv, MethodSignatureVisitor msign, int index) {
   int type = msign.getArgumentOpcodeType(index);
   int offset = msign.getArgumentOffset(index);
   storeValue(mv, offset, type);
 }