def METHOD_NAME(self):
    """Saves the marks to the metainfo."""
    d = {}
    for type in types:
        d[type] = lines = []
        for mark in self._marks[type]:
            linenum = mark.blockNumber()
            if linenum not in lines:
                lines.append(linenum)
    metainfo.info(self.document()).bookmarks = json.dumps(d)