@@ -253,40 +253,6 @@ HEAP_IMMUTABLE_IMMOVABLE_OBJECT_LIST(HEAP_CONSTANT_ACCESSOR);
253
253
HEAP_IMMOVABLE_OBJECT_LIST(HEAP_CONSTANT_TEST);
254
254
#undef HEAP_CONSTANT_TEST
255
255
256
- TNode<Int64T> CodeStubAssembler::HashSeed() {
257
- DCHECK(Is64());
258
- TNode<HeapObject> hash_seed_root =
259
- TNode<HeapObject>::UncheckedCast(LoadRoot(Heap::kHashSeedRootIndex));
260
- return TNode<Int64T>::UncheckedCast(LoadObjectField(
261
- hash_seed_root, ByteArray::kHeaderSize, MachineType::Int64()));
262
- }
263
-
264
- TNode<Int32T> CodeStubAssembler::HashSeedHigh() {
265
- DCHECK(!Is64());
266
- #ifdef V8_TARGET_BIG_ENDIAN
267
- static int kOffset = 0;
268
- #else
269
- static int kOffset = kInt32Size;
270
- #endif
271
- TNode<HeapObject> hash_seed_root =
272
- TNode<HeapObject>::UncheckedCast(LoadRoot(Heap::kHashSeedRootIndex));
273
- return TNode<Int32T>::UncheckedCast(LoadObjectField(
274
- hash_seed_root, ByteArray::kHeaderSize + kOffset, MachineType::Int32()));
275
- }
276
-
277
- TNode<Int32T> CodeStubAssembler::HashSeedLow() {
278
- DCHECK(!Is64());
279
- #ifdef V8_TARGET_BIG_ENDIAN
280
- static int kOffset = kInt32Size;
281
- #else
282
- static int kOffset = 0;
283
- #endif
284
- TNode<HeapObject> hash_seed_root =
285
- TNode<HeapObject>::UncheckedCast(LoadRoot(Heap::kHashSeedRootIndex));
286
- return TNode<Int32T>::UncheckedCast(LoadObjectField(
287
- hash_seed_root, ByteArray::kHeaderSize + kOffset, MachineType::Int32()));
288
- }
289
-
290
256
Node* CodeStubAssembler::IntPtrOrSmiConstant(int value, ParameterMode mode) {
291
257
if (mode == SMI_PARAMETERS) {
292
258
return SmiConstant(value);
@@ -7709,14 +7675,9 @@ template void CodeStubAssembler::NameDictionaryLookup<GlobalDictionary>(
7709
7675
TNode<GlobalDictionary>, TNode<Name>, Label*, TVariable<IntPtrT>*, Label*,
7710
7676
int, LookupMode);
7711
7677
7712
- Node* CodeStubAssembler::ComputeIntegerHash(Node* key) {
7713
- return ComputeIntegerHash(key, IntPtrConstant(kZeroHashSeed));
7714
- }
7715
-
7716
- Node* CodeStubAssembler::ComputeIntegerHash(Node* key, Node* seed) {
7717
- // See v8::internal::ComputeIntegerHash()
7678
+ Node* CodeStubAssembler::ComputeUnseededHash(Node* key) {
7679
+ // See v8::internal::ComputeUnseededHash()
7718
7680
Node* hash = TruncateIntPtrToInt32(key);
7719
- hash = Word32Xor(hash, seed);
7720
7681
hash = Int32Add(Word32Xor(hash, Int32Constant(0xFFFFFFFF)),
7721
7682
Word32Shl(hash, Int32Constant(15)));
7722
7683
hash = Word32Xor(hash, Word32Shr(hash, Int32Constant(12)));
@@ -7727,6 +7688,21 @@ Node* CodeStubAssembler::ComputeIntegerHash(Node* key, Node* seed) {
7727
7688
return Word32And(hash, Int32Constant(0x3FFFFFFF));
7728
7689
}
7729
7690
7691
+ Node* CodeStubAssembler::ComputeSeededHash(Node* key) {
7692
+ Node* const function_addr =
7693
+ ExternalConstant(ExternalReference::compute_integer_hash());
7694
+ Node* const isolate_ptr =
7695
+ ExternalConstant(ExternalReference::isolate_address(isolate()));
7696
+
7697
+ MachineType type_ptr = MachineType::Pointer();
7698
+ MachineType type_uint32 = MachineType::Uint32();
7699
+
7700
+ Node* const result =
7701
+ CallCFunction2(type_uint32, type_ptr, type_uint32, function_addr,
7702
+ isolate_ptr, TruncateIntPtrToInt32(key));
7703
+ return result;
7704
+ }
7705
+
7730
7706
void CodeStubAssembler::NumberDictionaryLookup(
7731
7707
TNode<NumberDictionary> dictionary, TNode<IntPtrT> intptr_index,
7732
7708
Label* if_found, TVariable<IntPtrT>* var_entry, Label* if_not_found) {
@@ -7737,16 +7713,7 @@ void CodeStubAssembler::NumberDictionaryLookup(
7737
7713
TNode<IntPtrT> capacity = SmiUntag(GetCapacity<NumberDictionary>(dictionary));
7738
7714
TNode<WordT> mask = IntPtrSub(capacity, IntPtrConstant(1));
7739
7715
7740
- TNode<Int32T> int32_seed;
7741
-
7742
- if (Is64()) {
7743
- int32_seed = TruncateInt64ToInt32(HashSeed());
7744
- } else {
7745
- int32_seed = HashSeedLow();
7746
- }
7747
-
7748
- TNode<WordT> hash =
7749
- ChangeUint32ToWord(ComputeIntegerHash(intptr_index, int32_seed));
7716
+ TNode<WordT> hash = ChangeUint32ToWord(ComputeSeededHash(intptr_index));
7750
7717
Node* key_as_float64 = RoundIntPtrToFloat64(intptr_index);
7751
7718
7752
7719
// See Dictionary::FirstProbe().
0 commit comments