Java Code Examples for org.objectweb.asm.Type#FLOAT_TYPE

The following examples show how to use org.objectweb.asm.Type#FLOAT_TYPE . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: AnalyzedMethod.java    From glowroot with Apache License 2.0 6 votes vote down vote up
@VisibleForTesting
static Type getType(String type) {
    if (type.equals(Void.TYPE.getName())) {
        return Type.VOID_TYPE;
    } else if (type.equals(Boolean.TYPE.getName())) {
        return Type.BOOLEAN_TYPE;
    } else if (type.equals(Character.TYPE.getName())) {
        return Type.CHAR_TYPE;
    } else if (type.equals(Byte.TYPE.getName())) {
        return Type.BYTE_TYPE;
    } else if (type.equals(Short.TYPE.getName())) {
        return Type.SHORT_TYPE;
    } else if (type.equals(Integer.TYPE.getName())) {
        return Type.INT_TYPE;
    } else if (type.equals(Float.TYPE.getName())) {
        return Type.FLOAT_TYPE;
    } else if (type.equals(Long.TYPE.getName())) {
        return Type.LONG_TYPE;
    } else if (type.equals(Double.TYPE.getName())) {
        return Type.DOUBLE_TYPE;
    } else if (type.endsWith("[]")) {
        return getArrayType(type);
    } else {
        return Type.getObjectType(type.replace('.', '/'));
    }
}
 
Example 2
Source File: TypeUtils.java    From maple-ir with GNU General Public License v3.0 6 votes vote down vote up
public static Number rebox(Number cst, Type t) {
	if(t == Type.BYTE_TYPE) {
		return cst.byteValue();
	}  else if(t == Type.SHORT_TYPE) {
		return cst.shortValue();
	} else if(t == Type.INT_TYPE) {
		return cst.intValue();
	} else if(t == Type.LONG_TYPE) {
		return cst.longValue();
	} else if(t == Type.FLOAT_TYPE) {
		return cst.floatValue();
	} else if(t == Type.DOUBLE_TYPE) {
		return cst.doubleValue();
	} else {
		throw new UnsupportedOperationException(String.format("%s (%s) to %s", cst, cst.getClass(), t));
	}
}
 
Example 3
Source File: BuildStackInfoAdapter.java    From copper-engine with Apache License 2.0 6 votes vote down vote up
Type getArrayElementType(int type) {
    switch (type) {
        case T_BOOLEAN:
            return Type.BOOLEAN_TYPE;
        case T_BYTE:
            return Type.BYTE_TYPE;
        case T_CHAR:
            return Type.CHAR_TYPE;
        case T_DOUBLE:
            return Type.DOUBLE_TYPE;
        case T_FLOAT:
            return Type.FLOAT_TYPE;
        case T_INT:
            return Type.INT_TYPE;
        case T_LONG:
            return Type.LONG_TYPE;
        case T_SHORT:
            return Type.SHORT_TYPE;
    }
    throw new BuildStackFrameException("Illegal array type code: " + type);
}
 
Example 4
Source File: TypeUtils.java    From maple-ir with GNU General Public License v3.0 6 votes vote down vote up
public static int getVariableLoadOpcode(Type type) {
		if (type.getSort() >= Type.BOOLEAN && type.getSort() <= Type.INT) {
			return Opcodes.ILOAD;
		} else if (type == Type.LONG_TYPE) {
			return Opcodes.LLOAD;
		} else if (type == Type.FLOAT_TYPE) {
			return Opcodes.FLOAD;
		} else if (type == Type.DOUBLE_TYPE) {
			return Opcodes.DLOAD;
		} else if (type.getSort() >= Type.ARRAY && type.getSort() <= Type.OBJECT) {
			return Opcodes.ALOAD;
		} else {
			return getVariableLoadOpcode(asSimpleType(type));
//			throw new IllegalArgumentException(type.toString());
		}
	}
 
Example 5
Source File: Utils.java    From obfuscator with MIT License 5 votes vote down vote up
public static Type getType(VarInsnNode abstractInsnNode) {
    int offset;

    if (abstractInsnNode.getOpcode() >= ISTORE && abstractInsnNode.getOpcode() <= ASTORE)
        offset = abstractInsnNode.getOpcode() - ISTORE;
    else if (abstractInsnNode.getOpcode() >= ILOAD && abstractInsnNode.getOpcode() <= ALOAD)
        offset = abstractInsnNode.getOpcode() - ILOAD;
    else if (abstractInsnNode.getOpcode() == RET)
        throw new UnsupportedOperationException("RET is not supported");
    else
        throw new UnsupportedOperationException();

    switch (offset) {
        case 0:
            return Type.INT_TYPE;
        case LLOAD - ILOAD:
            return Type.LONG_TYPE;
        case FLOAD - ILOAD:
            return Type.FLOAT_TYPE;
        case DLOAD - ILOAD:
            return Type.DOUBLE_TYPE;
        case ALOAD - ILOAD:
            return Type.getType("Ljava/lang/Object;");
    }

    throw new UnsupportedOperationException();
}
 
Example 6
Source File: TypeUtils.java    From maple-ir with GNU General Public License v3.0 5 votes vote down vote up
public static Type resolveUnaryOpType(Type type) {
	if (type.getSort() >= Type.BOOLEAN && type.getSort() <= Type.INT) {
		return Type.INT_TYPE;
	} else if (type == Type.LONG_TYPE || type == Type.FLOAT_TYPE || type == Type.DOUBLE_TYPE) {
		return type;
	} else {
		throw new UnsupportedOperationException("Unsupported binop types: " + type);
	}
}
 
Example 7
Source File: TypeUtils.java    From maple-ir with GNU General Public License v3.0 5 votes vote down vote up
public static Type getStoreType(int opcode) {
	if (opcode == ISTORE) {
		return Type.INT_TYPE;
	} else if (opcode == LSTORE) {
		return Type.LONG_TYPE;
	} else if (opcode == FSTORE) {
		return Type.FLOAT_TYPE;
	} else if (opcode == DSTORE) {
		return Type.DOUBLE_TYPE;
	} else if (opcode == ASTORE) {
		return OBJECT_TYPE;
	} else {
		throw new IllegalArgumentException(Printer.OPCODES[opcode]);
	}
}
 
Example 8
Source File: ScottyMethodAdapter.java    From copper-engine with Apache License 2.0 5 votes vote down vote up
void pushLocals(StackInfo info) {
    super.visitIntInsn(SIPUSH, info.localsSize());
    super.visitTypeInsn(ANEWARRAY, "java/lang/Object");
    for (int i = 0; i < info.localsSize(); ++i) {
        Type t = info.getLocal(i);
        if (t != null) {
            super.visitInsn(DUP);
            super.visitIntInsn(SIPUSH, i);
            if (t == Type.BOOLEAN_TYPE || t == Type.BYTE_TYPE || t == Type.SHORT_TYPE || t == Type.INT_TYPE || t == Type.CHAR_TYPE) {
                super.visitVarInsn(ILOAD, i);
                super.visitMethodInsn(INVOKESTATIC, "java/lang/Integer", "valueOf", "(I)Ljava/lang/Integer;", false);
            } else if (t == Type.FLOAT_TYPE) {
                super.visitVarInsn(FLOAD, i);
                super.visitMethodInsn(INVOKESTATIC, "java/lang/Float", "valueOf", "(F)Ljava/lang/Float;", false);
            } else if (t == Type.LONG_TYPE) {
                super.visitVarInsn(LLOAD, i);
                super.visitMethodInsn(INVOKESTATIC, "java/lang/Long", "valueOf", "(J)Ljava/lang/Long;", false);
            } else if (t == Type.DOUBLE_TYPE) {
                super.visitVarInsn(DLOAD, i);
                super.visitMethodInsn(INVOKESTATIC, "java/lang/Double", "valueOf", "(D)Ljava/lang/Double;", false);
            } else if (t == StackInfo.AconstNullType) {
                super.visitInsn(ACONST_NULL);
            } else {
                super.visitVarInsn(ALOAD, i);
            }
            super.visitInsn(AASTORE);
        }
    }
}
 
Example 9
Source File: TypeUtils.java    From maple-ir with GNU General Public License v3.0 5 votes vote down vote up
public static int getSubtractOpcode(Type type) {
	if (type == Type.INT_TYPE) {
		return ISUB;
	} else if (type == Type.LONG_TYPE) {
		return LSUB;
	} else if (type == Type.FLOAT_TYPE) {
		return FSUB;
	} else if (type == Type.DOUBLE_TYPE) {
		return DSUB;
	} else {
		throw new IllegalArgumentException(type.toString());
	}
}
 
Example 10
Source File: TypeUtils.java    From maple-ir with GNU General Public License v3.0 5 votes vote down vote up
public static int getMultiplyOpcode(Type type) {
	if (type == Type.INT_TYPE) {
		return IMUL;
	} else if (type == Type.LONG_TYPE) {
		return LMUL;
	} else if (type == Type.FLOAT_TYPE) {
		return FMUL;
	} else if (type == Type.DOUBLE_TYPE) {
		return DMUL;
	} else {
		throw new IllegalArgumentException(type.toString());
	}
}
 
Example 11
Source File: TypeUtils.java    From maple-ir with GNU General Public License v3.0 5 votes vote down vote up
public static int getDivideOpcode(Type type) {
	if (type == Type.INT_TYPE) {
		return IDIV;
	} else if (type == Type.LONG_TYPE) {
		return LDIV;
	} else if (type == Type.FLOAT_TYPE) {
		return FDIV;
	} else if (type == Type.DOUBLE_TYPE) {
		return DDIV;
	} else {
		throw new IllegalArgumentException(type.toString());
	}
}
 
Example 12
Source File: TypeUtils.java    From maple-ir with GNU General Public License v3.0 5 votes vote down vote up
public static int getRemainderOpcode(Type type) {
	if (type == Type.INT_TYPE) {
		return IREM;
	} else if (type == Type.LONG_TYPE) {
		return LREM;
	} else if (type == Type.FLOAT_TYPE) {
		return FREM;
	} else if (type == Type.DOUBLE_TYPE) {
		return DREM;
	} else {
		throw new IllegalArgumentException(type.toString());
	}
}
 
Example 13
Source File: TypeUtil.java    From Recaf with MIT License 5 votes vote down vote up
/**
 * @param arg
 * 		Operand value of a NEWARRAY instruction.
 *
 * @return Array element type.
 */
public static Type newArrayArgToType(int arg) {
	switch(arg) {
		case 4: return Type.BOOLEAN_TYPE;
		case 5: return Type.CHAR_TYPE;
		case 6: return Type.FLOAT_TYPE;
		case 7: return Type.DOUBLE_TYPE;
		case 8: return Type.BYTE_TYPE;
		case 9: return Type.SHORT_TYPE;
		case 10: return Type.INT_TYPE;
		case 11: return Type.LONG_TYPE;
		default: break;
	}
	throw new IllegalArgumentException("Unexpected NEWARRAY arg: " + arg);
}
 
Example 14
Source File: NegationExpr.java    From maple-ir with GNU General Public License v3.0 5 votes vote down vote up
@Override
public Type getType() {
	Type t = expression.getType();
	if (t.getSort() >= Type.BOOLEAN && t.getSort() <= Type.INT) {
		return Type.INT_TYPE;
	} else if (t == Type.LONG_TYPE || t == Type.FLOAT_TYPE || t == Type.DOUBLE_TYPE) {
		return t;
	} else {
		throw new IllegalArgumentException(t.toString());
	}
}
 
Example 15
Source File: TypeUtils.java    From maple-ir with GNU General Public License v3.0 5 votes vote down vote up
public static int getReturnOpcode(Type type) {
	if (type.getSort() >= Type.BOOLEAN && type.getSort() <= Type.INT) {
		return Opcodes.IRETURN;
	} else if (type == Type.LONG_TYPE) {
		return Opcodes.LRETURN;
	} else if (type == Type.FLOAT_TYPE) {
		return Opcodes.FRETURN;
	} else if (type == Type.DOUBLE_TYPE) {
		return Opcodes.DRETURN;
	} else if (type.getSort() >= Type.ARRAY && type.getSort() <= Type.OBJECT) {
		return Opcodes.ARETURN;
	} else {
		throw new IllegalArgumentException(type.toString());
	}
}
 
Example 16
Source File: LocalVariablesSorter.java    From JReFrameworker with MIT License 5 votes vote down vote up
@Override
public void visitVarInsn(final int opcode, final int var) {
  Type varType;
  switch (opcode) {
    case Opcodes.LLOAD:
    case Opcodes.LSTORE:
      varType = Type.LONG_TYPE;
      break;
    case Opcodes.DLOAD:
    case Opcodes.DSTORE:
      varType = Type.DOUBLE_TYPE;
      break;
    case Opcodes.FLOAD:
    case Opcodes.FSTORE:
      varType = Type.FLOAT_TYPE;
      break;
    case Opcodes.ILOAD:
    case Opcodes.ISTORE:
      varType = Type.INT_TYPE;
      break;
    case Opcodes.ALOAD:
    case Opcodes.ASTORE:
    case Opcodes.RET:
      varType = OBJECT_TYPE;
      break;
    default:
      throw new IllegalArgumentException("Invalid opcode " + opcode);
  }
  super.visitVarInsn(opcode, remap(var, varType));
}
 
Example 17
Source File: ArithmeticExpr.java    From maple-ir with GNU General Public License v3.0 4 votes vote down vote up
public static Type resolveType(int bOpcode) {
	switch(bOpcode) {
		case IADD:
		case ISUB:
		case IMUL:
		case IDIV:
		case IREM:
		case INEG:
		case ISHL:
		case ISHR:
		case IUSHR:
		case IAND:
		case IOR:
		case IXOR:
			return Type.INT_TYPE;
		case LADD:
		case LSUB:
		case LMUL:
		case LDIV:
		case LREM:
		case LNEG:
		case LSHL:
		case LSHR:
		case LUSHR:
		case LAND:
		case LOR:
		case LXOR:
			return Type.LONG_TYPE;
		case FADD:
		case FSUB:
		case FMUL:
		case FDIV:
		case FREM:
		case FNEG:
			return Type.FLOAT_TYPE;
		case DADD:
		case DSUB:
		case DMUL:
		case DDIV:
		case DREM:
		case DNEG:
			return Type.DOUBLE_TYPE;
			
		default:
			throw new UnsupportedOperationException(Printer.OPCODES[bOpcode]);
	}
}
 
Example 18
Source File: ABICompilerClassVisitor.java    From AVM with MIT License 4 votes vote down vote up
private void callTheDecoder(MethodVisitor methodVisitor, Type type) {
    if (type == Type.BYTE_TYPE) {
        methodVisitor.visitMethodInsn(INVOKEVIRTUAL, "org/aion/avm/userlib/abi/ABIDecoder", "decodeOneByte", "()B", false);
    } else if (type == Type.BOOLEAN_TYPE) {
        methodVisitor.visitMethodInsn(INVOKEVIRTUAL, "org/aion/avm/userlib/abi/ABIDecoder", "decodeOneBoolean", "()Z", false);
    } else if (type == Type.CHAR_TYPE) {
        methodVisitor.visitMethodInsn(INVOKEVIRTUAL, "org/aion/avm/userlib/abi/ABIDecoder", "decodeOneCharacter", "()C", false);
    } else if (type == Type.SHORT_TYPE) {
        methodVisitor.visitMethodInsn(INVOKEVIRTUAL, "org/aion/avm/userlib/abi/ABIDecoder", "decodeOneShort", "()S", false);
    } else if (type == Type.INT_TYPE) {
        methodVisitor.visitMethodInsn(INVOKEVIRTUAL, "org/aion/avm/userlib/abi/ABIDecoder", "decodeOneInteger", "()I", false);
    } else if (type == Type.LONG_TYPE) {
        methodVisitor.visitMethodInsn(INVOKEVIRTUAL, "org/aion/avm/userlib/abi/ABIDecoder", "decodeOneLong", "()J", false);
    } else if (type == Type.FLOAT_TYPE) {
        methodVisitor.visitMethodInsn(INVOKEVIRTUAL, "org/aion/avm/userlib/abi/ABIDecoder", "decodeOneFloat", "()F", false);
    } else if (type == Type.DOUBLE_TYPE) {
        methodVisitor.visitMethodInsn(INVOKEVIRTUAL, "org/aion/avm/userlib/abi/ABIDecoder", "decodeOneDouble", "()D", false);
    } else if (isArrayOfTypeAndDimensions(type, Type.BYTE_TYPE, 1)) {
        methodVisitor.visitMethodInsn(INVOKEVIRTUAL, "org/aion/avm/userlib/abi/ABIDecoder", "decodeOneByteArray", "()[B", false);
    } else if (isArrayOfTypeAndDimensions(type, Type.BOOLEAN_TYPE, 1)) {
        methodVisitor.visitMethodInsn(INVOKEVIRTUAL, "org/aion/avm/userlib/abi/ABIDecoder", "decodeOneBooleanArray", "()[Z", false);
    } else if (isArrayOfTypeAndDimensions(type, Type.CHAR_TYPE, 1)) {
        methodVisitor.visitMethodInsn(INVOKEVIRTUAL, "org/aion/avm/userlib/abi/ABIDecoder", "decodeOneCharacterArray", "()[C", false);
    } else if (isArrayOfTypeAndDimensions(type, Type.SHORT_TYPE, 1)) {
        methodVisitor.visitMethodInsn(INVOKEVIRTUAL, "org/aion/avm/userlib/abi/ABIDecoder", "decodeOneShortArray", "()[S", false);
    } else if (isArrayOfTypeAndDimensions(type, Type.INT_TYPE, 1)) {
        methodVisitor.visitMethodInsn(INVOKEVIRTUAL, "org/aion/avm/userlib/abi/ABIDecoder", "decodeOneIntegerArray", "()[I", false);
    } else if (isArrayOfTypeAndDimensions(type, Type.LONG_TYPE, 1)) {
        methodVisitor.visitMethodInsn(INVOKEVIRTUAL, "org/aion/avm/userlib/abi/ABIDecoder", "decodeOneLongArray", "()[J", false);
    } else if (isArrayOfTypeAndDimensions(type, Type.FLOAT_TYPE, 1)) {
        methodVisitor.visitMethodInsn(INVOKEVIRTUAL, "org/aion/avm/userlib/abi/ABIDecoder", "decodeOneFloatArray", "()[F", false);
    } else if (isArrayOfTypeAndDimensions(type, Type.DOUBLE_TYPE, 1)) {
        methodVisitor.visitMethodInsn(INVOKEVIRTUAL, "org/aion/avm/userlib/abi/ABIDecoder", "decodeOneDoubleArray", "()[D", false);
    } else if (isString(type)) {
        methodVisitor.visitMethodInsn(INVOKEVIRTUAL, "org/aion/avm/userlib/abi/ABIDecoder", "decodeOneString", "()Ljava/lang/String;", false);
    } else if (isAddress(type)) {
        methodVisitor.visitMethodInsn(INVOKEVIRTUAL, "org/aion/avm/userlib/abi/ABIDecoder", "decodeOneAddress", "()Lavm/Address;", false);
    } else if(isBigInteger(type)) {
        methodVisitor.visitMethodInsn(INVOKEVIRTUAL, "org/aion/avm/userlib/abi/ABIDecoder", "decodeOneBigInteger", "()Ljava/math/BigInteger;", false);
    } else if (isArrayOfTypeAndDimensions(type, Type.BYTE_TYPE, 2)) {
        methodVisitor.visitMethodInsn(INVOKEVIRTUAL, "org/aion/avm/userlib/abi/ABIDecoder", "decodeOne2DByteArray", "()[[B", false);
    } else if (isArrayOfTypeAndDimensions(type, Type.BOOLEAN_TYPE, 2)) {
        methodVisitor.visitMethodInsn(INVOKEVIRTUAL, "org/aion/avm/userlib/abi/ABIDecoder", "decodeOne2DBooleanArray", "()[[Z", false);
    } else if (isArrayOfTypeAndDimensions(type, Type.CHAR_TYPE, 2)) {
        methodVisitor.visitMethodInsn(INVOKEVIRTUAL, "org/aion/avm/userlib/abi/ABIDecoder", "decodeOne2DCharacterArray", "()[[C", false);
    } else if (isArrayOfTypeAndDimensions(type, Type.SHORT_TYPE, 2)) {
        methodVisitor.visitMethodInsn(INVOKEVIRTUAL, "org/aion/avm/userlib/abi/ABIDecoder", "decodeOne2DShortArray", "()[[S", false);
    } else if (isArrayOfTypeAndDimensions(type, Type.INT_TYPE, 2)) {
        methodVisitor.visitMethodInsn(INVOKEVIRTUAL, "org/aion/avm/userlib/abi/ABIDecoder", "decodeOne2DIntegerArray", "()[[I", false);
    } else if (isArrayOfTypeAndDimensions(type, Type.LONG_TYPE, 2)) {
        methodVisitor.visitMethodInsn(INVOKEVIRTUAL, "org/aion/avm/userlib/abi/ABIDecoder", "decodeOne2DLongArray", "()[[J", false);
    } else if (isArrayOfTypeAndDimensions(type, Type.FLOAT_TYPE, 2)) {
        methodVisitor.visitMethodInsn(INVOKEVIRTUAL, "org/aion/avm/userlib/abi/ABIDecoder", "decodeOne2DFloatArray", "()[[F", false);
    } else if (isArrayOfTypeAndDimensions(type, Type.DOUBLE_TYPE, 2)) {
        methodVisitor.visitMethodInsn(INVOKEVIRTUAL, "org/aion/avm/userlib/abi/ABIDecoder", "decodeOne2DDoubleArray", "()[[D", false);
    } else if (type.getSort() == Type.ARRAY && type.getDimensions() == 1 && isString(type.getElementType())) {
        methodVisitor.visitMethodInsn(INVOKEVIRTUAL, "org/aion/avm/userlib/abi/ABIDecoder", "decodeOneStringArray", "()[Ljava/lang/String;", false);
    } else if (type.getSort() == Type.ARRAY && type.getDimensions() == 1 && isAddress(type.getElementType())) {
        methodVisitor.visitMethodInsn(INVOKEVIRTUAL, "org/aion/avm/userlib/abi/ABIDecoder", "decodeOneAddressArray", "()[Lavm/Address;", false);
    } else if(type.getSort() == Type.ARRAY && type.getDimensions() == 1 && isBigInteger(type.getElementType())) {
        methodVisitor.visitMethodInsn(INVOKEVIRTUAL, "org/aion/avm/userlib/abi/ABIDecoder", "decodeOneBigIntegerArray", "()[Ljava/math/BigInteger;", false);
    } else {
        throw new ABICompilerException("Need to decode an unsupported ABI type");
    }
}
 
Example 19
Source File: ConstantInterpreter.java    From radon with GNU General Public License v3.0 4 votes vote down vote up
private static UnknownValue floatSymbolicValue(AbstractInsnNode insnNode) {
    return new UnknownValue(insnNode, Type.FLOAT_TYPE);
}
 
Example 20
Source File: GeneratorAdapter.java    From JReFrameworker with MIT License 4 votes vote down vote up
/**
 * Generates the instructions to cast a numerical value from one type to another.
 *
 * @param from the type of the top stack value
 * @param to the type into which this value must be cast.
 */
public void cast(final Type from, final Type to) {
  if (from != to) {
    if (from.getSort() < Type.BOOLEAN
        || from.getSort() > Type.DOUBLE
        || to.getSort() < Type.BOOLEAN
        || to.getSort() > Type.DOUBLE) {
      throw new IllegalArgumentException("Cannot cast from " + from + " to " + to);
    }
    if (from == Type.DOUBLE_TYPE) {
      if (to == Type.FLOAT_TYPE) {
        mv.visitInsn(Opcodes.D2F);
      } else if (to == Type.LONG_TYPE) {
        mv.visitInsn(Opcodes.D2L);
      } else {
        mv.visitInsn(Opcodes.D2I);
        cast(Type.INT_TYPE, to);
      }
    } else if (from == Type.FLOAT_TYPE) {
      if (to == Type.DOUBLE_TYPE) {
        mv.visitInsn(Opcodes.F2D);
      } else if (to == Type.LONG_TYPE) {
        mv.visitInsn(Opcodes.F2L);
      } else {
        mv.visitInsn(Opcodes.F2I);
        cast(Type.INT_TYPE, to);
      }
    } else if (from == Type.LONG_TYPE) {
      if (to == Type.DOUBLE_TYPE) {
        mv.visitInsn(Opcodes.L2D);
      } else if (to == Type.FLOAT_TYPE) {
        mv.visitInsn(Opcodes.L2F);
      } else {
        mv.visitInsn(Opcodes.L2I);
        cast(Type.INT_TYPE, to);
      }
    } else {
      if (to == Type.BYTE_TYPE) {
        mv.visitInsn(Opcodes.I2B);
      } else if (to == Type.CHAR_TYPE) {
        mv.visitInsn(Opcodes.I2C);
      } else if (to == Type.DOUBLE_TYPE) {
        mv.visitInsn(Opcodes.I2D);
      } else if (to == Type.FLOAT_TYPE) {
        mv.visitInsn(Opcodes.I2F);
      } else if (to == Type.LONG_TYPE) {
        mv.visitInsn(Opcodes.I2L);
      } else if (to == Type.SHORT_TYPE) {
        mv.visitInsn(Opcodes.I2S);
      }
    }
  }
}