Pericles was originally based on the moral "passion plays" of the Middle Ages. Although this performance retains most of the elements of the passion plays, the characters, the locations, and the timeline are changed.
Pericles is lost in his woes - he has lost his wife and his child to misadventure. He has spun his sad tale out many times in front of one particular Caribbean brothel. The pirates and whores of the place misuse Pericles, acting out his unhappy story for their own amusement - and that of the audience.