Besides the bootcode, it is run by startx if the X server differs. For example, if your current X server is Xorg, but the line in .xsession references Xfbdev, xsetup would be run.
There is no code to handle other conditions like the X server failing to start.