At once, the spider's leg bent in upon its body; it rolled over and began to twitch horribly, rocking from side to side.
I don't understand the phrase "bent in upon". I can't picture what it would be like when the spider's leg bent in upon its body. What's the correct way to understand it?
Quoted from Harry Potter and the Goblet of Fire.