Rewrite retrieval of resolved classes.

Use ClassLinker::VisitClasses() instead of walking over dex
cache type arrays. The old technique relies on the dex cache
holding references to all resolved classes, an assumption
that we're going to break soon.

Test: m test-art-host-run-test-595-profile-saving
Bug: 30627598
Change-Id: Icae71f53b5a33ff931d83aa8d44cc182889f26da
2 files changed