Index: src/objects-inl.h |
=================================================================== |
--- src/objects-inl.h (revision 10379) |
+++ src/objects-inl.h (working copy) |
@@ -1789,7 +1789,7 @@ |
} |
-void FixedDoubleArray::Initialize(NumberDictionary* from) { |
+void FixedDoubleArray::Initialize(SeededNumberDictionary* from) { |
int offset = kHeaderSize; |
for (int current = 0; current < length(); ++current) { |
WRITE_DOUBLE_FIELD(this, offset, hole_nan_as_double()); |
@@ -2077,7 +2077,7 @@ |
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(HashTable<Shape, Key>::Hash(key), capacity); |
uint32_t count = 1; |
// EnsureCapacity will guarantee the hash table is never full. |
while (true) { |
@@ -2092,14 +2092,14 @@ |
} |
-bool NumberDictionary::requires_slow_elements() { |
+bool SeededNumberDictionary::requires_slow_elements() { |
Object* max_index_object = get(kMaxNumberKeyIndex); |
if (!max_index_object->IsSmi()) return false; |
return 0 != |
(Smi::cast(max_index_object)->value() & kRequiresSlowElementsMask); |
} |
-uint32_t NumberDictionary::max_number_key() { |
+uint32_t SeededNumberDictionary::max_number_key() { |
ASSERT(!requires_slow_elements()); |
Object* max_index_object = get(kMaxNumberKeyIndex); |
if (!max_index_object->IsSmi()) return 0; |
@@ -2107,7 +2107,7 @@ |
return value >> kRequiresSlowElementsTagSize; |
} |
-void NumberDictionary::set_requires_slow_elements() { |
+void SeededNumberDictionary::set_requires_slow_elements() { |
set(kMaxNumberKeyIndex, Smi::FromInt(kRequiresSlowElementsMask)); |
} |
@@ -4211,9 +4211,9 @@ |
} |
-NumberDictionary* JSObject::element_dictionary() { |
+SeededNumberDictionary* JSObject::element_dictionary() { |
ASSERT(HasDictionaryElements()); |
- return NumberDictionary::cast(elements()); |
+ return SeededNumberDictionary::cast(elements()); |
} |
@@ -4243,7 +4243,7 @@ |
is_array_index_(0 < length_ && length_ <= String::kMaxArrayIndexSize), |
is_first_char_(true), |
is_valid_(true) { |
- ASSERT(FLAG_randomize_string_hashes || raw_running_hash_ == 0); |
+ ASSERT(FLAG_randomize_hashes || raw_running_hash_ == 0); |
} |
@@ -4476,17 +4476,28 @@ |
} |
-uint32_t NumberDictionaryShape::Hash(uint32_t key) { |
- return ComputeIntegerHash(key); |
+uint32_t UnseededNumberDictionaryShape::Hash(uint32_t key) { |
+ return ComputeIntegerHash(key, 0); |
} |
-uint32_t NumberDictionaryShape::HashForObject(uint32_t key, Object* other) { |
+uint32_t UnseededNumberDictionaryShape::HashForObject(uint32_t key, |
+ Object* other) { |
ASSERT(other->IsNumber()); |
- return ComputeIntegerHash(static_cast<uint32_t>(other->Number())); |
+ return ComputeIntegerHash(static_cast<uint32_t>(other->Number()), 0); |
} |
+uint32_t SeededNumberDictionaryShape::SeededHash(uint32_t key, uint32_t seed) { |
+ return ComputeIntegerHash(key, seed); |
+} |
+uint32_t SeededNumberDictionaryShape::SeededHashForObject(uint32_t key, |
+ uint32_t seed, |
+ Object* other) { |
+ ASSERT(other->IsNumber()); |
+ return ComputeIntegerHash(static_cast<uint32_t>(other->Number()), seed); |
+} |
+ |
MaybeObject* NumberDictionaryShape::AsObject(uint32_t key) { |
return Isolate::Current()->heap()->NumberFromUint32(key); |
} |