calculate an offset for each field in a class, taking into account its
super classes