Internal structure of massive terrestrial planets