Index: src/objects-inl.h |
diff --git a/src/objects-inl.h b/src/objects-inl.h |
index dedb19956834a17b933e167d76ab3ae470e5e77d..4a17e6162a21cfab11ffc59dc9a3601fb9603556 100644 |
--- a/src/objects-inl.h |
+++ b/src/objects-inl.h |
@@ -3685,6 +3685,22 @@ uint32_t StringHasher::GetHash() { |
} |
+template <typename schar> |
+uint32_t HashSequentialString(const schar* chars, int length) { |
+ StringHasher hasher(length); |
+ if (!hasher.has_trivial_hash()) { |
+ int i; |
+ for (i = 0; hasher.is_array_index() && (i < length); i++) { |
+ hasher.AddCharacter(chars[i]); |
+ } |
+ for (; i < length; i++) { |
+ hasher.AddCharacterNoIndex(chars[i]); |
+ } |
+ } |
+ return hasher.GetHashField(); |
+} |
+ |
+ |
bool String::AsArrayIndex(uint32_t* index) { |
uint32_t field = hash_field(); |
if (IsHashFieldComputed(field) && (field & kIsNotArrayIndexMask)) { |