code: private void run(Class<?> type, Object val, int limit) {
          int initial;
  
          initial = dest.getSize();
  
          if (val == null) {
              if (type.isPrimitive()) {
                  throw new IllegalArgumentException("primitive null");
              }
              // null is not a string, but otherwise it is  ambiguous
              dest.emit(LDC, (String) null);
          } else if (val instanceof String) {
              dest.emit(LDC, (String) val);
          } else if (type.isPrimitive()) {
              primitive(ClassRef.findComponent(type).id, val);
          } else if (type.isArray()) {
              array(type, val, limit);
          } else {
              object(type, val, limit);
          }
  
          if (dest.getSize() - initial > limit) {
              throw new IllegalStateException(
                      "limit:" + limit + " used:" + (dest.getSize() - initial) + " val:" + val);
          }
      }
docs: type is the static type. If type is primitive, the primitive
  object wrapped by val is compiled.
  
  @param limit max number of instactions the value may be compiled to. >= 1.