Index: src/objects-inl.h |
diff --git a/src/objects-inl.h b/src/objects-inl.h |
index 0f666d7ec74ab04fe16dc1ff3128236907b64196..71e54081044ceb36a55909c42d9afda6346e4fa1 100644 |
--- a/src/objects-inl.h |
+++ b/src/objects-inl.h |
@@ -7289,6 +7289,17 @@ inline void StringHasher::AddCharacters(const Char* chars, int length) { |
} |
} |
+uint32_t StringHasher::GetHashField() { |
+ if (length_ <= String::kMaxHashCalcLength) { |
+ if (is_array_index_) { |
+ return MakeArrayIndexHash(array_index_, length_); |
+ } |
+ return (GetHashCore(raw_running_hash_) << String::kHashShift) | |
+ String::kIsNotArrayIndexMask; |
+ } else { |
+ return (length_ << String::kHashShift) | String::kIsNotArrayIndexMask; |
+ } |
+} |
template <typename schar> |
uint32_t StringHasher::HashSequentialString(const schar* chars, |
@@ -7707,6 +7718,18 @@ bool AccessorPair::IsJSAccessor(Object* obj) { |
return obj->IsCallable() || obj->IsUndefined(GetIsolate()); |
} |
+Handle<String> StringTable::LookupKey(Isolate* isolate, HashTableKey* key) { |
+ Handle<StringTable> table = isolate->factory()->string_table(); |
+ int32_t hash = key->Hash(); |
+ int entry = table->FindEntry(isolate, key, hash); |
+ |
+ // String already in table. |
+ if (entry != kNotFound) { |
+ return handle(String::cast(table->KeyAt(entry)), isolate); |
+ } |
+ |
+ return InsertKey(isolate, table, key, hash); |
+} |
template<typename Derived, typename Shape, typename Key> |
void Dictionary<Derived, Shape, Key>::SetEntry(int entry, |