Question Star Spectrums

This might seem absurd because this is from what I have heard and read. I don't know the weeds of astronomy.

But I wonder if anyone has ever done this.

I am assuming that we have many decades of recorded star spectrums. And I thought that if space is really distorted around the objects in it, that distortion should be directly proportional to the mass of a star.

This might shift, distort or disturb the starlight, proportional to the mass. So, somewhere within that star's spectrum there might be a mass signature. It might be very slight. Perhaps this would be a job for A.I. If it's a small signature it might take many detections, samples or comparisons to spot it. We can detect under noise signals now, in radio, if we know where they are. I don't think we can do that with light. Perhaps they can now.

But wouldn't it be nice to get a dependable mass figure directly from the starlight.