@@ -200,10 +200,6 @@ HEAP_CONSTANT_LIST(HEAP_CONSTANT_ACCESSOR);
200
200
HEAP_CONSTANT_LIST (HEAP_CONSTANT_TEST);
201
201
#undef HEAP_CONSTANT_TEST
202
202
203
- Node* CodeStubAssembler::HashSeed () {
204
- return LoadAndUntagToWord32Root (Heap::kHashSeedRootIndex );
205
- }
206
-
207
203
Node* CodeStubAssembler::StaleRegisterConstant () {
208
204
return LoadRoot (Heap::kStaleRegisterRootIndex );
209
205
}
@@ -5389,22 +5385,32 @@ template void CodeStubAssembler::NameDictionaryLookup<NameDictionary>(
5389
5385
template void CodeStubAssembler::NameDictionaryLookup<GlobalDictionary>(
5390
5386
Node*, Node*, Label*, Variable*, Label*, int , LookupMode);
5391
5387
5392
- Node* CodeStubAssembler::ComputeIntegerHash (Node* key) {
5393
- return ComputeIntegerHash (key, IntPtrConstant (kZeroHashSeed ));
5394
- }
5395
-
5396
- Node* CodeStubAssembler::ComputeIntegerHash (Node* key, Node* seed) {
5397
- // See v8::internal::ComputeIntegerHash()
5388
+ Node* CodeStubAssembler::ComputeUnseededHash (Node* key) {
5389
+ // See v8::internal::ComputeUnseededHash()
5398
5390
Node* hash = TruncateWordToWord32 (key);
5399
- hash = Word32Xor (hash, seed);
5400
- hash = Int32Add (Word32Xor (hash, Int32Constant (0xffffffff )),
5391
+ hash = Int32Add (Word32Xor (hash, Int32Constant (0xFFFFFFFF )),
5401
5392
Word32Shl (hash, Int32Constant (15 )));
5402
5393
hash = Word32Xor (hash, Word32Shr (hash, Int32Constant (12 )));
5403
5394
hash = Int32Add (hash, Word32Shl (hash, Int32Constant (2 )));
5404
5395
hash = Word32Xor (hash, Word32Shr (hash, Int32Constant (4 )));
5405
5396
hash = Int32Mul (hash, Int32Constant (2057 ));
5406
5397
hash = Word32Xor (hash, Word32Shr (hash, Int32Constant (16 )));
5407
- return Word32And (hash, Int32Constant (0x3fffffff ));
5398
+ return Word32And (hash, Int32Constant (0x3FFFFFFF ));
5399
+ }
5400
+
5401
+ Node* CodeStubAssembler::ComputeSeededHash (Node* key) {
5402
+ Node* const function_addr =
5403
+ ExternalConstant (ExternalReference::compute_integer_hash (isolate ()));
5404
+ Node* const isolate_ptr =
5405
+ ExternalConstant (ExternalReference::isolate_address (isolate ()));
5406
+
5407
+ MachineType type_ptr = MachineType::Pointer ();
5408
+ MachineType type_uint32 = MachineType::Uint32 ();
5409
+
5410
+ Node* const result =
5411
+ CallCFunction2 (type_uint32, type_ptr, type_uint32, function_addr,
5412
+ isolate_ptr, TruncateWordToWord32 (key));
5413
+ return result;
5408
5414
}
5409
5415
5410
5416
template <typename Dictionary>
@@ -5420,10 +5426,14 @@ void CodeStubAssembler::NumberDictionaryLookup(Node* dictionary,
5420
5426
Node* capacity = SmiUntag (GetCapacity<Dictionary>(dictionary));
5421
5427
Node* mask = IntPtrSub (capacity, IntPtrConstant (1 ));
5422
5428
5423
- Node* int32_seed = std::is_same<Dictionary, SeededNumberDictionary>::value
5424
- ? HashSeed ()
5425
- : Int32Constant (kZeroHashSeed );
5426
- Node* hash = ChangeUint32ToWord (ComputeIntegerHash (intptr_index, int32_seed));
5429
+ Node* hash;
5430
+
5431
+ if (std::is_same<Dictionary, SeededNumberDictionary>::value) {
5432
+ hash = ChangeUint32ToWord (ComputeSeededHash (intptr_index));
5433
+ } else {
5434
+ hash = ChangeUint32ToWord (ComputeUnseededHash (intptr_index));
5435
+ }
5436
+
5427
5437
Node* key_as_float64 = RoundIntPtrToFloat64 (intptr_index);
5428
5438
5429
5439
// See Dictionary::FirstProbe().
0 commit comments