Index: src/heap/heap-inl.h |
diff --git a/src/heap/heap-inl.h b/src/heap/heap-inl.h |
index fbfca6301505b27eaf7aa7c3b1fe2d213967861e..14ffca4147f7a4ebcf5a205eed5e1821f82affb8 100644 |
--- a/src/heap/heap-inl.h |
+++ b/src/heap/heap-inl.h |
@@ -17,6 +17,7 @@ |
#include "src/heap-profiler.h" |
#include "src/isolate.h" |
#include "src/list-inl.h" |
+#include "src/log.h" |
#include "src/msan.h" |
#include "src/objects.h" |
@@ -632,6 +633,27 @@ void ExternalStringTable::ShrinkNewStrings(int position) { |
} |
+int DescriptorLookupCache::Lookup(Map* source, Name* name) { |
+ if (!name->IsUniqueName()) return kAbsent; |
+ int index = Hash(source, name); |
+ Key& key = keys_[index]; |
+ if ((key.source == source) && (key.name == name)) return results_[index]; |
+ return kAbsent; |
+} |
+ |
+ |
+void DescriptorLookupCache::Update(Map* source, Name* name, int result) { |
+ DCHECK(result != kAbsent); |
+ if (name->IsUniqueName()) { |
+ int index = Hash(source, name); |
+ Key& key = keys_[index]; |
+ key.source = source; |
+ key.name = name; |
+ results_[index] = result; |
+ } |
+} |
+ |
+ |
void Heap::ClearInstanceofCache() { |
set_instanceof_cache_function(Smi::FromInt(0)); |
} |