5 #ifndef V8_LOOKUP_CACHE_INL_H_ 6 #define V8_LOOKUP_CACHE_INL_H_ 8 #include "src/lookup-cache.h" 10 #include "src/objects-inl.h" 16 int DescriptorLookupCache::Hash(Map source, Name name) {
17 DCHECK(name->IsUniqueName());
20 static_cast<uint32_t>(source.ptr()) >> kPointerSizeLog2;
21 uint32_t name_hash = name->hash_field();
22 return (source_hash ^ name_hash) % kLength;
25 int DescriptorLookupCache::Lookup(Map source, Name name) {
26 int index = Hash(source, name);
27 Key& key = keys_[index];
28 if ((key.source == source) && (key.name == name))
return results_[index];
32 void DescriptorLookupCache::Update(Map source, Name name,
int result) {
33 DCHECK_NE(result, kAbsent);
34 int index = Hash(source, name);
35 Key& key = keys_[index];
38 results_[index] = result;
44 #endif // V8_LOOKUP_CACHE_INL_H_