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

Unified Diff: src/objects-inl.h

Issue 9148006: [objects] seed NumberDictionary (only ia32 now) Base URL: gh:v8/v8@master
Patch Set: fixed lint issues Created 8 years, 11 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-inl.h
diff --git a/src/objects-inl.h b/src/objects-inl.h
index c5cf060829f5867cbfea4dc35d56a0c682e4a486..e98c7cde168ede79147929ef807ab63dbd7adf5a 100644
--- a/src/objects-inl.h
+++ b/src/objects-inl.h
@@ -2057,7 +2057,8 @@ int HashTable<Shape, Key>::FindEntry(Key key) {
template<typename Shape, typename Key>
int HashTable<Shape, Key>::FindEntry(Isolate* isolate, Key key) {
uint32_t capacity = Capacity();
- uint32_t entry = FirstProbe(Shape::Hash(key), capacity);
+ uint32_t entry = FirstProbe(Shape::Hash(key, GetHeap()->StringHashSeed()),
Erik Corry 2012/01/09 23:52:48 isolate->heap() is faster than GetHeap() If the ar
+ capacity);
uint32_t count = 1;
// EnsureCapacity will guarantee the hash table is never full.
while (true) {
@@ -4535,14 +4536,15 @@ bool NumberDictionaryShape::IsMatch(uint32_t key, Object* other) {
}
-uint32_t NumberDictionaryShape::Hash(uint32_t key) {
- return ComputeIntegerHash(key);
+uint32_t NumberDictionaryShape::Hash(uint32_t key, uint32_t seed) {
+ return ComputeIntegerHash(key, seed);
}
-uint32_t NumberDictionaryShape::HashForObject(uint32_t key, Object* other) {
+uint32_t NumberDictionaryShape::HashForObject(uint32_t key, uint32_t seed,
Erik Corry 2012/01/09 23:52:48 Formatting.
+ Object* other) {
ASSERT(other->IsNumber());
- return ComputeIntegerHash(static_cast<uint32_t>(other->Number()));
+ return ComputeIntegerHash(static_cast<uint32_t>(other->Number()), seed);
}
@@ -4559,12 +4561,13 @@ bool StringDictionaryShape::IsMatch(String* key, Object* other) {
}
-uint32_t StringDictionaryShape::Hash(String* key) {
+uint32_t StringDictionaryShape::Hash(String* key, uint32_t) {
return key->Hash();
}
-uint32_t StringDictionaryShape::HashForObject(String* key, Object* other) {
+uint32_t StringDictionaryShape::HashForObject(String* key, uint32_t,
Erik Corry 2012/01/09 23:52:48 Formatting.
+ Object* other) {
return String::cast(other)->Hash();
}
@@ -4581,7 +4584,7 @@ bool ObjectHashTableShape<entrysize>::IsMatch(Object* key, Object* other) {
template <int entrysize>
-uint32_t ObjectHashTableShape<entrysize>::Hash(Object* key) {
+uint32_t ObjectHashTableShape<entrysize>::Hash(Object* key, uint32_t) {
MaybeObject* maybe_hash = key->GetHash(OMIT_CREATION);
return Smi::cast(maybe_hash->ToObjectChecked())->value();
}
@@ -4589,6 +4592,7 @@ uint32_t ObjectHashTableShape<entrysize>::Hash(Object* key) {
template <int entrysize>
uint32_t ObjectHashTableShape<entrysize>::HashForObject(Object* key,
+ uint32_t,
Object* other) {
MaybeObject* maybe_hash = other->GetHash(OMIT_CREATION);
return Smi::cast(maybe_hash->ToObjectChecked())->value();

Powered by Google App Engine
This is Rietveld 408576698