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

Unified Diff: src/arm/ic-arm.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
« no previous file with comments | « no previous file | src/arm/simulator-arm.cc » ('j') | src/objects.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/arm/ic-arm.cc
===================================================================
--- src/arm/ic-arm.cc (revision 2481)
+++ src/arm/ic-arm.cc (working copy)
@@ -103,15 +103,16 @@
// 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;
- 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.
__ ldr(t1, FieldMemOperand(r2, String::kLengthOffset));
__ mov(t1, Operand(t1, LSR, String::kHashShift));
- if (i > 0) {
- __ add(t1, t1, Operand(StringDictionary::GetProbeOffset(i)));
- }
- __ and_(t1, t1, Operand(r3));
+ __ and_(t1, r3, Operand(t1, ROR, (kShift * i) % kBitsPerInt));
Kasper Lund 2009/07/16 12:41:43 Maybe this needs to be guarded with something like
bak 2009/07/16 12:52:41 Fixed, good catch.
// Scale the index by multiplying by the element size.
ASSERT(StringDictionary::kEntrySize == 3);
« no previous file with comments | « no previous file | src/arm/simulator-arm.cc » ('j') | src/objects.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698