@@ -1832,12 +1832,13 @@ TNode<IntPtrT> CodeStubAssembler::LoadJSReceiverIdentityHash(
18321832 return var_hash.value();
18331833}
18341834
1835- TNode<Uint32T> CodeStubAssembler::LoadNameHashField(SloppyTNode<Name> name) {
1836- CSA_ASSERT(this, IsName(name));
1837- return LoadObjectField<Uint32T>(name, Name::kHashFieldOffset);
1835+ TNode<Uint32T> CodeStubAssembler::LoadNameHashAssumeComputed(TNode<Name> name) {
1836+ TNode<Uint32T> hash_field = LoadNameHashField(name);
1837+ CSA_ASSERT(this, IsClearWord32(hash_field, Name::kHashNotComputedMask));
1838+ return Unsigned(Word32Shr(hash_field, Int32Constant(Name::kHashShift)));
18381839}
18391840
1840- TNode<Uint32T> CodeStubAssembler::LoadNameHash(SloppyTNode <Name> name,
1841+ TNode<Uint32T> CodeStubAssembler::LoadNameHash(TNode <Name> name,
18411842 Label* if_hash_not_computed) {
18421843 TNode<Uint32T> hash_field = LoadNameHashField(name);
18431844 if (if_hash_not_computed != nullptr) {
@@ -8110,7 +8111,7 @@ void CodeStubAssembler::LookupBinary(TNode<Name> unique_name,
81108111 TNode<Uint32T> limit =
81118112 Unsigned(Int32Sub(NumberOfEntries<Array>(array), Int32Constant(1)));
81128113 TVARIABLE(Uint32T, var_high, limit);
8113- TNode<Uint32T> hash = LoadNameHashField (unique_name);
8114+ TNode<Uint32T> hash = LoadNameHashAssumeComputed (unique_name);
81148115 CSA_ASSERT(this, Word32NotEqual(hash, Int32Constant(0)));
81158116
81168117 // Assume non-empty array.
@@ -8128,7 +8129,7 @@ void CodeStubAssembler::LookupBinary(TNode<Name> unique_name,
81288129 TNode<Uint32T> sorted_key_index = GetSortedKeyIndex<Array>(array, mid);
81298130 TNode<Name> mid_name = GetKey<Array>(array, sorted_key_index);
81308131
8131- TNode<Uint32T> mid_hash = LoadNameHashField (mid_name);
8132+ TNode<Uint32T> mid_hash = LoadNameHashAssumeComputed (mid_name);
81328133
81338134 Label mid_greater(this), mid_less(this), merge(this);
81348135 Branch(Uint32GreaterThanOrEqual(mid_hash, hash), &mid_greater, &mid_less);
@@ -8155,7 +8156,7 @@ void CodeStubAssembler::LookupBinary(TNode<Name> unique_name,
81558156 TNode<Uint32T> sort_index =
81568157 GetSortedKeyIndex<Array>(array, var_low.value());
81578158 TNode<Name> current_name = GetKey<Array>(array, sort_index);
8158- TNode<Uint32T> current_hash = LoadNameHashField (current_name);
8159+ TNode<Uint32T> current_hash = LoadNameHashAssumeComputed (current_name);
81598160 GotoIf(Word32NotEqual(current_hash, hash), if_not_found);
81608161 Label next(this);
81618162 GotoIf(TaggedNotEqual(current_name, unique_name), &next);
0 commit comments