| Index: src/objects-inl.h
|
| diff --git a/src/objects-inl.h b/src/objects-inl.h
|
| index 03aea64736d818f456c748f76a31d583593dc664..bfec3a49550340d4dc6f8bd81b3bd80fff588bac 100644
|
| --- a/src/objects-inl.h
|
| +++ b/src/objects-inl.h
|
| @@ -6722,6 +6722,30 @@ uint32_t StringHasher::GetHashCore(uint32_t running_hash) {
|
| }
|
|
|
|
|
| +uint32_t StringHasher::ComputeRunningHash(uint32_t running_hash,
|
| + const uc16* chars, int length) {
|
| + DCHECK_NOT_NULL(chars);
|
| + DCHECK(length >= 0);
|
| + for (int i = 0; i < length; ++i) {
|
| + running_hash = AddCharacterCore(running_hash, *chars++);
|
| + }
|
| + return running_hash;
|
| +}
|
| +
|
| +
|
| +uint32_t StringHasher::ComputeRunningHashOneByte(uint32_t running_hash,
|
| + const char* chars,
|
| + int length) {
|
| + DCHECK_NOT_NULL(chars);
|
| + DCHECK(length >= 0);
|
| + for (int i = 0; i < length; ++i) {
|
| + uint16_t c = static_cast<uint16_t>(*chars++);
|
| + running_hash = AddCharacterCore(running_hash, c);
|
| + }
|
| + return running_hash;
|
| +}
|
| +
|
| +
|
| void StringHasher::AddCharacter(uint16_t c) {
|
| // Use the Jenkins one-at-a-time hash function to update the hash
|
| // for the given character.
|
|
|