#include "src/compiler/refs-map.h"
namespace v8 {
namespace internal {
namespace compiler {
using UnderlyingMap =
base::TemplateHashMapImpl<Address, ObjectData*, AddressMatcher,
ZoneAllocationPolicy>;
RefsMap::RefsMap(uint32_t capacity, AddressMatcher match, Zone* zone)
: UnderlyingMap(capacity, match, ZoneAllocationPolicy(zone)) {}
RefsMap::RefsMap(const RefsMap* other, Zone* zone)
: UnderlyingMap(other, ZoneAllocationPolicy(zone)) {}
RefsMap::Entry* RefsMap::Lookup(const Address& key) const {
return UnderlyingMap::Lookup(key, Hash(key));
}
RefsMap::Entry* RefsMap::InsertNew(const Address& key) {
return UnderlyingMap::InsertNew(key, RefsMap::Hash(key));
}
ObjectData* RefsMap::Remove(const Address& key) {
return UnderlyingMap::Remove(key, RefsMap::Hash(key));
}
uint32_t RefsMap::Hash(Address addr) { return static_cast<uint32_t>(addr); }
}
}
}