Unless they rewrote Whatsapp from ground up, the two platforms are not mixed. Whatsapp is written in Erlang where Facebook has transitioned from PHP to Hack to the best of my knowledge.
the code isn't the only infrastructure that can intermingle.
I think whatsapp runs on facebook's massive server farms with customized chips - which would hurt whatsapp probably if they need to find a different hosting.
I imagine there are probably a lot of other services that are shared or interact in some way - maybe shared email/notification services, 2fa services, data analytics/BI, monitoring etc...
I don't know how much they did with Whatsapp, but I do know they integrated the Facebook ad serving platform into Whatsapp. Breaking up Facebook and Whatsapp would cost Whatsapp that ad serving platform, which is probably nontrivial.