private void unwrapPrimitive(Class cls) {
    if (cls == boolean.class) {
      assert debug("CHECKCAST java/lang/Boolean");
      mv.visitTypeInsn(CHECKCAST, "java/lang/Boolean");
      assert debug("INVOKEVIRTUAL java/lang/Boolean.booleanValue");
      mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/Boolean", "booleanValue", "()Z");
    }
    else if (cls == int.class) {
      assert debug("CHECKCAST java/lang/Integer");
      mv.visitTypeInsn(CHECKCAST, "java/lang/Integer");
      assert debug("INVOKEVIRTUAL java/lang/Integer.intValue");
      mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/Integer", "intValue", "()I");
    }
    else if (cls == float.class) {
      assert debug("CHECKCAST java/lang/Float");
      mv.visitTypeInsn(CHECKCAST, "java/lang/Float");
      assert debug("INVOKEVIRTUAL java/lang/Float.floatValue");
      mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/Float", "floatValue", "()F");
    }
    else if (cls == double.class) {
      assert debug("CHECKCAST java/lang/Double");
      mv.visitTypeInsn(CHECKCAST, "java/lang/Double");
      assert debug("INVOKEVIRTUAL java/lang/Double.doubleValue");
      mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/Double", "doubleValue", "()D");
    }
    else if (cls == short.class) {
      assert debug("CHECKCAST java/lang/Short");
      mv.visitTypeInsn(CHECKCAST, "java/lang/Short");
      assert debug("INVOKEVIRTUAL java/lang/Short.shortValue");
      mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/Short", "shortValue", "()S");
    }
    else if (cls == long.class) {
      assert debug("CHECKCAST java/lang/Long");
      mv.visitTypeInsn(CHECKCAST, "java/lang/Long");
      assert debug("INVOKEVIRTUAL java/lang/Long.longValue");
      mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/Long", "longValue", "()J");
    }
    else if (cls == byte.class) {
      assert debug("CHECKCAST java/lang/Byte");
      mv.visitTypeInsn(CHECKCAST, "java/lang/Byte");
      assert debug("INVOKEVIRTUAL java/lang/Byte.byteValue");
      mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/Byte", "byteValue", "()B");
    }
    else if (cls == char.class) {
      assert debug("CHECKCAST java/lang/Character");
      mv.visitTypeInsn(CHECKCAST, "java/lang/Character");
      assert debug("INVOKEVIRTUAL java/lang/Character.charValue");
      mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/Character", "charValue", "()C");
    }
  }