Bills of attainder (laws that target a specific person or group of people) have always been unconstitutional. The are explicitly prohibited federally in Article 1, Section 9:
No Bill of Attainder ... shall be passed.
States are explicitly prohibited in Section 10:
No State shall ... pass any Bill of Attainder ...
Any legislation that specifically targets Google would be quickly overturned by the court.
A Bill of Attainder is much narrow than any legislation that targets a particular actor; this is a case where the specific details matter a lot (as does the mood of the Supreme Court, whose tests on this issue have evolved over time in shifting directions.)