A Foundation of Escape Analysis