A Torelli-type theorem for gravitational instantons