Clean up ScopedArenaAllocatorAdapter.
Make the adapter equality-comparable, define aliases for
containers using the adapter and use those aliases.
Fix DebugStackIndirectTopRefImpl assignment.
Change-Id: I689aa8a93d169f63a659dec5040567d7b1343277
diff --git a/compiler/dex/mir_analysis.cc b/compiler/dex/mir_analysis.cc
index 200795e..c3b5a25 100644
--- a/compiler/dex/mir_analysis.cc
+++ b/compiler/dex/mir_analysis.cc
@@ -24,6 +24,7 @@
#include "dex/quick/dex_file_to_method_inliner_map.h"
#include "driver/compiler_options.h"
#include "UniquePtr.h"
+#include "utils/scoped_arena_containers.h"
namespace art {
@@ -1205,17 +1206,16 @@
MethodReferenceComparator devirt_cmp;
};
- // Map invoke key (see MapEntry) to lowering info index.
- typedef std::set<MapEntry, MapEntryComparator, ScopedArenaAllocatorAdapter<MapEntry> > InvokeMap;
-
ScopedArenaAllocator allocator(&cu_->arena_stack);
// All INVOKE instructions take 3 code units and there must also be a RETURN.
uint32_t max_refs = (current_code_item_->insns_size_in_code_units_ - 1u) / 3u;
+ // Map invoke key (see MapEntry) to lowering info index and vice versa.
// The invoke_map and sequential entries are essentially equivalent to Boost.MultiIndex's
// multi_index_container with one ordered index and one sequential index.
- InvokeMap invoke_map(MapEntryComparator(), allocator.Adapter());
+ ScopedArenaSet<MapEntry, MapEntryComparator> invoke_map(MapEntryComparator(),
+ allocator.Adapter());
const MapEntry** sequential_entries = reinterpret_cast<const MapEntry**>(
allocator.Alloc(max_refs * sizeof(sequential_entries[0]), kArenaAllocMisc));