Commit 752a8fba authored by bak@chromium.org's avatar bak@chromium.org

Changed the dictionary code to use original hash value when starting linear scan.

This is necessary for hash codes for string where the array index is encoded.

Review URL: http://codereview.chromium.org/149753

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2488 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 78ffa1df
......@@ -6521,15 +6521,15 @@ int HashTable<Shape, Key>::FindEntry(Key key) {
uint32_t hash = Shape::Hash(key);
// For the first probes rotate the hash to ensure a proper spread.
uint32_t h = hash;
for (uint32_t i = 0; i < kNofFastProbes; i++) {
int entry = hash & mask;
int entry = h & mask;
Object* element = KeyAt(entry);
if (element->IsUndefined()) return kNotFound;
if (!element->IsNull() && Shape::IsMatch(key, element)) return entry;
hash = RotateRight(hash, kHashRotateShift);
h = RotateRight(h, kHashRotateShift);
}
// In this unlikely event, do a linear scan.
for (uint32_t i = 1; i <= mask; i++) {
int entry = ++hash & mask;
......@@ -6584,11 +6584,12 @@ uint32_t HashTable<Shape, Key>::FindInsertionEntry(uint32_t hash) {
Object* element;
// For the first probes rotate the hash to ensure a proper spread.
uint32_t h = hash;
for (uint32_t i = 0; i < kNofFastProbes; i++) {
entry = hash & mask;
entry = h & mask;
element = KeyAt(entry);
if (element->IsUndefined() || element->IsNull()) return entry;
hash = RotateRight(hash, kHashRotateShift);
h = RotateRight(h, kHashRotateShift);
}
do {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment