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

Unified Diff: src/objects.h

Issue 155350: Changed hash table to use more of the hash value when probing. (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
Index: src/objects.h
===================================================================
--- src/objects.h (revision 2481)
+++ src/objects.h (working copy)
@@ -2051,11 +2051,6 @@
// Casting.
static inline HashTable* cast(Object* obj);
- // Compute the probe offset (quadratic probing).
- INLINE(static uint32_t GetProbeOffset(uint32_t n)) {
- return (n + n * n) >> 1;
- }
-
static const int kNumberOfElementsIndex = 0;
static const int kCapacityIndex = 1;
static const int kPrefixStartIndex = 2;
@@ -2071,6 +2066,9 @@
// Find entry for key otherwise return -1.
int FindEntry(Key key);
+ static const uint32_t kNofFastProbes = 4;
+ static const uint32_t kHashRotateShift = 3;
+
protected:
// Find the entry at which to insert element with the given key that
@@ -2096,13 +2094,6 @@
fast_set(this, kCapacityIndex, Smi::FromInt(capacity));
}
-
- // Returns probe entry.
- static uint32_t GetProbe(uint32_t hash, uint32_t number, uint32_t size) {
- ASSERT(IsPowerOf2(size));
- return (hash + GetProbeOffset(number)) & (size - 1);
- }
-
// Ensure enough space for n additional elements.
Object* EnsureCapacity(int n, Key key);
};

Powered by Google App Engine
This is Rietveld 408576698