diff options
author | Vladimir Marko <vmarko@google.com> | 2020-12-23 12:47:31 +0000 |
---|---|---|
committer | Vladimir Marko <vmarko@google.com> | 2021-01-06 15:05:34 +0000 |
commit | 782fb716122d37dc4c4d7482afb21f6e68be04b4 (patch) | |
tree | fdbf479b04c73f692051dc8abf6efda3114a87e4 /compiler/optimizing/graph_visualizer.h | |
parent | 5bcdd17a43fda7ac27968b13f6969133fae40b37 (diff) |
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
Diffstat (limited to 'compiler/optimizing/graph_visualizer.h')
0 files changed, 0 insertions, 0 deletions