Use HashMap<> and HashSet<> in dex2oat.

Use HashMap<> instead of std::unordered_map<> in ImageWriter
as it is much faster thanks to avoiding individual nodes
that need malloc/free. However, for larger value types, such
as `NativeObjectRelocation`, this can increase memory usage.

Avoid storing individual ArtField relocations to reduce the
memory usage and re-hashing time. Rename `pointer_arrays_`
to `method_pointer_arrays_` and change it to HashSet<>,
removing the unnecessary storage for `Bin`, as it has not
been used for fields since
    https://android-review.googlesource.com/162796 .

Avoid double-lookups for insertion CHECK()s by using the
result of HashSet<>::insert(). Remove obsolete comments from
the HashSet<>::insert() API that have been wrong since
    https://android-review.googlesource.com/1169846 .

Similary, use HashSet<> instead of std::unordered_set<> in
CompilerDriver.

Test: m test-art-host-gtest
Test: testrunner.py --host --optimizing
Test: boots.
Bug: 175869411
Change-Id: I538c3ac2ce8d7cad69bb14709702ac7ee0af810d
7 files changed