Bug 1382745 - Improve the hashing of StackShape, especially on 64-bit systems; r=jandem

This commit is contained in:
Ehsan Akhgari 2017-07-20 14:13:21 -04:00
Родитель a34dfc464b
Коммит 8f4879f93e
1 изменённых файлов: 3 добавлений и 9 удалений

Просмотреть файл

@ -1488,15 +1488,9 @@ struct StackShape
}
HashNumber hash() const {
HashNumber hash = uintptr_t(base);
/* Accumulate from least to most random so the low bits are most random. */
hash = mozilla::RotateLeft(hash, 4) ^ attrs;
hash = mozilla::RotateLeft(hash, 4) ^ slot_;
hash = mozilla::RotateLeft(hash, 4) ^ HashId(propid);
hash = mozilla::RotateLeft(hash, 4) ^ uintptr_t(rawGetter);
hash = mozilla::RotateLeft(hash, 4) ^ uintptr_t(rawSetter);
return hash;
HashNumber hash = HashId(propid);
return mozilla::AddToHash(hash,
mozilla::HashGeneric(base, attrs, slot_, rawGetter, rawSetter));
}
// Traceable implementation.