Windshield perimeter dots

On many newer automobiles the front windshield has small black dots around the perimeter. These vary in width from less than half inch to a full inch or more. In the area of the rear view mirror, the pattern often increases. Some rear windows also have this dot pattern.
What is the purpose for this decoration?

They block sunlight.

Adding: There is also often a solid black back at the edge of the windshield. It blocks the sun (heat and UV) that might affect the adhesive underneath that bonds the windshield to the car. Rear view mirrors are also glued on, so you’ll see the dots there as well.

The black part is called the frit.