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

Unified Diff: src/stub-cache.h

Issue 115017: X64: Changed hash computations to only use lower 32 bits of pointers. (Closed)
Patch Set: Created 11 years, 7 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/stub-cache.h
diff --git a/src/stub-cache.h b/src/stub-cache.h
index 824f4ff17b923ba8747aeac3297faa279592ff1a..92100ba59875da81610fdac0d2cc28ab0005bb18 100644
--- a/src/stub-cache.h
+++ b/src/stub-cache.h
@@ -203,14 +203,18 @@ class StubCache : public AllStatic {
// Compute the hash of the name (use entire length field).
ASSERT(name->HasHashCode());
uint32_t field = name->length_field();
+ uint32_t map_lowbits =
Dean McNamee 2009/05/06 08:29:17 lowbits makes it sounds differnt than low32, speci
+ static_cast<uint32_t>(reinterpret_cast<uintptr_t>(map));
// Base the offset on a simple combination of name, flags, and map.
- uint32_t key = (reinterpret_cast<uint32_t>(map) + field) ^ flags;
+ uint32_t key = (map_lowbits + field) ^ flags;
return key & ((kPrimaryTableSize - 1) << kHeapObjectTagSize);
}
static int SecondaryOffset(String* name, Code::Flags flags, int seed) {
// Use the seed from the primary cache in the secondary cache.
- uint32_t key = seed - reinterpret_cast<uint32_t>(name) + flags;
+ uint32_t string_lowbits =
+ static_cast<uint32_t>(reinterpret_cast<uintptr_t>(name));
+ uint32_t key = seed - string_lowbits + flags;
return key & ((kSecondaryTableSize - 1) << kHeapObjectTagSize);
}
« 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