[hprof] Switch visitors to manage their own stack and avoid deep recursion.

We decouple the traversal algorithm from the model, allowing visitors to manage
their own stacks (and theoretically they could perform breadth-first searches
as well). Topological order requires a more careful traversal to collect
finishing times for nodes.

Fixed reported size of root objects: they are simple tags, their composite size
should reflect the size of the referred object but not double-count it.

Bug: https://code.google.com/p/android/issues/detail?id=81206
Change-Id: I44989d5c433f7744aa6f8a742b959d65c4f66331
10 files changed