Exemplo n.º 1
0
 /** Prepares return value. */
 public static void prepareReturnValue(
     MethodVisitor mv, MethodSignatureVisitor msign, int varOffset) {
   varOffset += msign.getAllArgumentsSize();
   switch (msign.getReturnOpcodeType()) {
     case 'V':
       mv.visitInsn(ACONST_NULL);
       break;
     case 'B':
       AsmUtil.valueOfByte(mv);
       break;
     case 'C':
       AsmUtil.valueOfCharacter(mv);
       break;
     case 'S':
       AsmUtil.valueOfShort(mv);
       break;
     case 'I':
       AsmUtil.valueOfInteger(mv);
       break;
     case 'Z':
       AsmUtil.valueOfBoolean(mv);
       break;
     case 'J':
       AsmUtil.valueOfLong(mv);
       break;
     case 'F':
       AsmUtil.valueOfFloat(mv);
       break;
     case 'D':
       AsmUtil.valueOfDouble(mv);
       break;
   }
 }
Exemplo n.º 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);
   }
 }