@@ -230,10 +230,6 @@ HEAP_CONSTANT_LIST(HEAP_CONSTANT_ACCESSOR);
230
230
HEAP_CONSTANT_LIST(HEAP_CONSTANT_TEST);
231
231
#undef HEAP_CONSTANT_TEST
232
232
233
- TNode<Int32T> CodeStubAssembler::HashSeed() {
234
- return LoadAndUntagToWord32Root(Heap::kHashSeedRootIndex);
235
- }
236
-
237
233
Node* CodeStubAssembler::IntPtrOrSmiConstant(int value, ParameterMode mode) {
238
234
if (mode == SMI_PARAMETERS) {
239
235
return SmiConstant(value);
@@ -7094,14 +7090,9 @@ template void CodeStubAssembler::NameDictionaryLookup<GlobalDictionary>(
7094
7090
TNode<GlobalDictionary>, TNode<Name>, Label*, TVariable<IntPtrT>*, Label*,
7095
7091
int, LookupMode);
7096
7092
7097
- Node* CodeStubAssembler::ComputeIntegerHash(Node* key) {
7098
- return ComputeIntegerHash(key, IntPtrConstant(kZeroHashSeed));
7099
- }
7100
-
7101
- Node* CodeStubAssembler::ComputeIntegerHash(Node* key, Node* seed) {
7102
- // See v8::internal::ComputeIntegerHash()
7093
+ Node* CodeStubAssembler::ComputeUnseededHash(Node* key) {
7094
+ // See v8::internal::ComputeUnseededHash()
7103
7095
Node* hash = TruncateIntPtrToInt32(key);
7104
- hash = Word32Xor(hash, seed);
7105
7096
hash = Int32Add(Word32Xor(hash, Int32Constant(0xFFFFFFFF)),
7106
7097
Word32Shl(hash, Int32Constant(15)));
7107
7098
hash = Word32Xor(hash, Word32Shr(hash, Int32Constant(12)));
@@ -7112,6 +7103,21 @@ Node* CodeStubAssembler::ComputeIntegerHash(Node* key, Node* seed) {
7112
7103
return Word32And(hash, Int32Constant(0x3FFFFFFF));
7113
7104
}
7114
7105
7106
+ Node* CodeStubAssembler::ComputeSeededHash(Node* key) {
7107
+ Node* const function_addr =
7108
+ ExternalConstant(ExternalReference::compute_integer_hash());
7109
+ Node* const isolate_ptr =
7110
+ ExternalConstant(ExternalReference::isolate_address(isolate()));
7111
+
7112
+ MachineType type_ptr = MachineType::Pointer();
7113
+ MachineType type_uint32 = MachineType::Uint32();
7114
+
7115
+ Node* const result =
7116
+ CallCFunction2(type_uint32, type_ptr, type_uint32, function_addr,
7117
+ isolate_ptr, TruncateIntPtrToInt32(key));
7118
+ return result;
7119
+ }
7120
+
7115
7121
void CodeStubAssembler::NumberDictionaryLookup(
7116
7122
TNode<NumberDictionary> dictionary, TNode<IntPtrT> intptr_index,
7117
7123
Label* if_found, TVariable<IntPtrT>* var_entry, Label* if_not_found) {
@@ -7122,9 +7128,7 @@ void CodeStubAssembler::NumberDictionaryLookup(
7122
7128
TNode<IntPtrT> capacity = SmiUntag(GetCapacity<NumberDictionary>(dictionary));
7123
7129
TNode<WordT> mask = IntPtrSub(capacity, IntPtrConstant(1));
7124
7130
7125
- TNode<Int32T> int32_seed = HashSeed();
7126
- TNode<WordT> hash =
7127
- ChangeUint32ToWord(ComputeIntegerHash(intptr_index, int32_seed));
7131
+ TNode<WordT> hash = ChangeUint32ToWord(ComputeSeededHash(intptr_index));
7128
7132
Node* key_as_float64 = RoundIntPtrToFloat64(intptr_index);
7129
7133
7130
7134
// See Dictionary::FirstProbe().
0 commit comments