@@ -1801,12 +1801,13 @@ TNode<IntPtrT> CodeStubAssembler::LoadJSReceiverIdentityHash(
18011801 return var_hash.value();
18021802}
18031803
1804- TNode<Uint32T> CodeStubAssembler::LoadNameHashField(SloppyTNode<Name> name) {
1805- CSA_ASSERT(this, IsName(name));
1806- return LoadObjectField<Uint32T>(name, Name::kHashFieldOffset);
1804+ TNode<Uint32T> CodeStubAssembler::LoadNameHashAssumeComputed(TNode<Name> name) {
1805+ TNode<Uint32T> hash_field = LoadNameHashField(name);
1806+ CSA_ASSERT(this, IsClearWord32(hash_field, Name::kHashNotComputedMask));
1807+ return Unsigned(Word32Shr(hash_field, Int32Constant(Name::kHashShift)));
18071808}
18081809
1809- TNode<Uint32T> CodeStubAssembler::LoadNameHash(SloppyTNode <Name> name,
1810+ TNode<Uint32T> CodeStubAssembler::LoadNameHash(TNode <Name> name,
18101811 Label* if_hash_not_computed) {
18111812 TNode<Uint32T> hash_field = LoadNameHashField(name);
18121813 if (if_hash_not_computed != nullptr) {
@@ -1994,13 +1995,13 @@ TNode<T> CodeStubAssembler::LoadArrayElement(TNode<Array> array,
19941995 }
19951996}
19961997
1997- template TNode<MaybeObject>
1998+ template V8_EXPORT_PRIVATE TNode<MaybeObject>
19981999CodeStubAssembler::LoadArrayElement<TransitionArray>(TNode<TransitionArray>,
19992000 int, Node*, int,
20002001 ParameterMode,
20012002 LoadSensitivity);
20022003
2003- template TNode<MaybeObject>
2004+ template V8_EXPORT_PRIVATE TNode<MaybeObject>
20042005CodeStubAssembler::LoadArrayElement<DescriptorArray>(TNode<DescriptorArray>,
20052006 int, Node*, int,
20062007 ParameterMode,
@@ -8063,7 +8064,7 @@ void CodeStubAssembler::LookupBinary(TNode<Name> unique_name,
80638064 TNode<Uint32T> limit =
80648065 Unsigned(Int32Sub(NumberOfEntries<Array>(array), Int32Constant(1)));
80658066 TVARIABLE(Uint32T, var_high, limit);
8066- TNode<Uint32T> hash = LoadNameHashField (unique_name);
8067+ TNode<Uint32T> hash = LoadNameHashAssumeComputed (unique_name);
80678068 CSA_ASSERT(this, Word32NotEqual(hash, Int32Constant(0)));
80688069
80698070 // Assume non-empty array.
@@ -8081,7 +8082,7 @@ void CodeStubAssembler::LookupBinary(TNode<Name> unique_name,
80818082 TNode<Uint32T> sorted_key_index = GetSortedKeyIndex<Array>(array, mid);
80828083 TNode<Name> mid_name = GetKey<Array>(array, sorted_key_index);
80838084
8084- TNode<Uint32T> mid_hash = LoadNameHashField (mid_name);
8085+ TNode<Uint32T> mid_hash = LoadNameHashAssumeComputed (mid_name);
80858086
80868087 Label mid_greater(this), mid_less(this), merge(this);
80878088 Branch(Uint32GreaterThanOrEqual(mid_hash, hash), &mid_greater, &mid_less);
@@ -8108,7 +8109,7 @@ void CodeStubAssembler::LookupBinary(TNode<Name> unique_name,
81088109 TNode<Uint32T> sort_index =
81098110 GetSortedKeyIndex<Array>(array, var_low.value());
81108111 TNode<Name> current_name = GetKey<Array>(array, sort_index);
8111- TNode<Uint32T> current_hash = LoadNameHashField (current_name);
8112+ TNode<Uint32T> current_hash = LoadNameHashAssumeComputed (current_name);
81128113 GotoIf(Word32NotEqual(current_hash, hash), if_not_found);
81138114 Label next(this);
81148115 GotoIf(TaggedNotEqual(current_name, unique_name), &next);
0 commit comments