Optimize FetchAndCacheResolvedClassesAndMethods

Moved FetchAndCacheResolvedClassesAndMethods to use a newly added
memory efficient DexReferenceCollection. This reduces RAM by
6+ bytes per sampled method during the process.

Changed profile logic to use bulk adding for each dex file instead
of looping through all of the ids and doing a string map comparison
for each one.

Also moved the vectors to use arena allocators to make sure the
pages get released after sampling is done.

Time in FetchAndCacheResolvedClassesAndMethods for Maps goes from
90.4ms to 47ms (average of 5 samples).

The motivation is to improve this call since it will be called more
often for sampling post startup methods.

Test: test-art-host
Test: manually look at -verbose:profiler output

Bug: 36457259

Change-Id: I3ed647ae15900c96d2180eb5c799f45393794dda
5 files changed