@@ -253,40 +253,6 @@ HEAP_IMMUTABLE_IMMOVABLE_OBJECT_LIST(HEAP_CONSTANT_ACCESSOR);
253253HEAP_IMMOVABLE_OBJECT_LIST (HEAP_CONSTANT_TEST);
254254#undef HEAP_CONSTANT_TEST
255255
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-
290256Node* CodeStubAssembler::IntPtrOrSmiConstant (int value, ParameterMode mode) {
291257 if (mode == SMI_PARAMETERS) {
292258 return SmiConstant (value);
@@ -7709,14 +7675,9 @@ template void CodeStubAssembler::NameDictionaryLookup<GlobalDictionary>(
77097675 TNode<GlobalDictionary>, TNode<Name>, Label*, TVariable<IntPtrT>*, Label*,
77107676 int , LookupMode);
77117677
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()
77187680 Node* hash = TruncateIntPtrToInt32 (key);
7719- hash = Word32Xor (hash, seed);
77207681 hash = Int32Add (Word32Xor (hash, Int32Constant (0xFFFFFFFF )),
77217682 Word32Shl (hash, Int32Constant (15 )));
77227683 hash = Word32Xor (hash, Word32Shr (hash, Int32Constant (12 )));
@@ -7727,6 +7688,21 @@ Node* CodeStubAssembler::ComputeIntegerHash(Node* key, Node* seed) {
77277688 return Word32And (hash, Int32Constant (0x3FFFFFFF ));
77287689}
77297690
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+
77307706void CodeStubAssembler::NumberDictionaryLookup (
77317707 TNode<NumberDictionary> dictionary, TNode<IntPtrT> intptr_index,
77327708 Label* if_found, TVariable<IntPtrT>* var_entry, Label* if_not_found) {
@@ -7737,16 +7713,7 @@ void CodeStubAssembler::NumberDictionaryLookup(
77377713 TNode<IntPtrT> capacity = SmiUntag (GetCapacity<NumberDictionary>(dictionary));
77387714 TNode<WordT> mask = IntPtrSub (capacity, IntPtrConstant (1 ));
77397715
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));
77507717 Node* key_as_float64 = RoundIntPtrToFloat64 (intptr_index);
77517718
77527719 // See Dictionary::FirstProbe().
0 commit comments