Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(21)

Unified Diff: src/objects.cc

Issue 149753: Changed the dictionary code to use original hash value when starting linear s... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 11 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects.cc
===================================================================
--- src/objects.cc (revision 2487)
+++ src/objects.cc (working copy)
@@ -6521,15 +6521,15 @@
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 @@
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 {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698