Use HashMap<> and HashSet<> in ClassLinker.

Extend the HashSet<> and HashMap<> API with constructors
that allow using a stack-allocated initial buffer to avoid
the allocation overhead for small containers.

Fix HashMap<> implementation for std::pair<> being used
as the Key. Make Signature copy-assignable so that we can
use it as (part of) a Value in HashMap<>.

Move the definition of ClassLinker::MethodTranslation from
class_linker.h to class_linker.cc. Add a default constructor
used for creating empty entries in HashMap<>.

Use HashMap<> and HashSet<> in ClassLinker instead of
std::unordered_map<> and std::unordered_set<> as it is much
faster thanks to avoiding individual nodes that need malloc
and free and for small containers we also avoid allocations
thanks to the extended HashSet<> and HashMap<> API.

Also avoid unnecessary std::vector<> for FillIfTable() and
replace linear search with HashSet<> lookup (note that the
`ContainsElement()` helper has an overload for std::set<>
but not for any other associative container).

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