If you watch, it's mostly shot/reverse shot cutting between Joffrey and the prostitutes, so likely most of the time somebody was feeding him lines and he was all-out in the scene. Pretty common practice, same thing on Mad Men with Kiernan Shipka and pretty much everything. It is acting, after all!
The kids are crazy talented for sure, though. If I have a kid, I hope they're like half as cool as Arya.