This is a sea wall and also the outer wall of a moat around a fort, the illumination of which is visible top right. The stone for building the fort was quarried on site, so that both the moat and the foundation wall were formed as a result of the quarrying.
I also read somewhere that more bombs were dropped on and around Valletta (which is where this fort is) in two days in WWII, than on London in the duration of the blitz. That might explain some of the wear and tear.