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

Unified Diff: src/ia32/ic-ia32.cc

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/ia32/ic-ia32.cc
===================================================================
--- src/ia32/ic-ia32.cc (revision 2481)
+++ src/ia32/ic-ia32.cc (working copy)
@@ -97,15 +97,20 @@
// Generate an unrolled loop that performs a few probes before
// giving up. Measurements done on Gmail indicate that 2 probes
// cover ~93% of loads from dictionaries.
- static const int kProbes = 4;
const int kElementsStartOffset =
Array::kHeaderSize + StringDictionary::kElementsStartIndex * kPointerSize;
- for (int i = 0; i < kProbes; i++) {
- // Compute the masked index: (hash + i + i * i) & mask.
+
+ static const uint32_t kProbes =
+ HashTable<StringDictionaryShape, String*>::kNofFastProbes;
+ static const uint32_t kShift =
+ HashTable<StringDictionaryShape, String*>::kHashRotateShift;
+
+ for (uint32_t i = 0; i < kProbes; i++) {
+ // Compute the masked index.
__ mov(r1, FieldOperand(name, String::kLengthOffset));
__ shr(r1, String::kHashShift);
if (i > 0) {
- __ add(Operand(r1), Immediate(StringDictionary::GetProbeOffset(i)));
+ __ ror(r1, (kShift * i) % kBitsPerInt);
}
__ and_(r1, Operand(r2));

Powered by Google App Engine
This is Rietveld 408576698