public static int sizeOfType(Class<?> type) {
        if (type == boolean.class) {
            return BOOLEAN_SIZE;
        } else if (type == byte.class) {
            return BYTE_SIZE;
        } else if (type == char.class) {
            return CHAR_SIZE;
        } else if (type == short.class) {
            return SHORT_SIZE;
        } else if (type == int.class) {
            return INT_SIZE;
        } else if (type == float.class) {
            return FLOAT_SIZE;
        } else if (type == long.class) {
            return LONG_SIZE;
        } else if (type == double.class) {
            return DOUBLE_SIZE;
        } else {
            return options.referenceSize;
        }
    }