This is a sea wall and also the outer wall of a moat around a fort at Valletta. 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 in two days in WWII, than on London in the duration of the blitz. That might explain some of the wear and tear.