@@ -179,6 +179,12 @@ struct MemoryAddress {
179179 offset == other.offset &&
180180 element_size_log2 == other.element_size_log2 && size == other.size ;
181181 }
182+
183+ template <typename H>
184+ friend H AbslHashValue (H h, const MemoryAddress& mem) {
185+ return H::combine (std::move (h), mem.base , mem.index , mem.offset ,
186+ mem.element_size_log2 , mem.size );
187+ }
182188};
183189
184190inline size_t hash_value (MemoryAddress const & mem) {
@@ -530,16 +536,14 @@ class MemoryContentTable
530536 SparseOpIndexSnapshotTable<MapMaskAndOr>& object_maps_;
531537 FixedOpIndexSidetable<OpIndex>& replacements_;
532538
533- // TODO(dmercadier): consider using a faster datastructure than
534- // ZoneUnorderedMap for {all_keys_}, {base_keys_} and {offset_keys_}.
535-
536539 // A map containing all of the keys, for fast lookup of a specific
537540 // MemoryAddress.
538- ZoneUnorderedMap <MemoryAddress, Key> all_keys_;
541+ ZoneAbslFlatHashMap <MemoryAddress, Key> all_keys_;
539542 // Map from base OpIndex to keys associated with this base.
540- ZoneUnorderedMap <OpIndex, BaseData> base_keys_;
543+ ZoneAbslFlatHashMap <OpIndex, BaseData> base_keys_;
541544 // Map from offsets to keys associated with this offset.
542- ZoneUnorderedMap<int , DoublyThreadedList<Key, OffsetListTraits>> offset_keys_;
545+ ZoneAbslFlatHashMap<int , DoublyThreadedList<Key, OffsetListTraits>>
546+ offset_keys_;
543547
544548 // List of all of the keys that have a valid index.
545549 DoublyThreadedList<Key, OffsetListTraits> index_keys_;
0 commit comments