@@ -1801,12 +1801,13 @@ TNode<IntPtrT> CodeStubAssembler::LoadJSReceiverIdentityHash(
1801
1801
return var_hash.value();
1802
1802
}
1803
1803
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)));
1807
1808
}
1808
1809
1809
- TNode<Uint32T> CodeStubAssembler::LoadNameHash(SloppyTNode <Name> name,
1810
+ TNode<Uint32T> CodeStubAssembler::LoadNameHash(TNode <Name> name,
1810
1811
Label* if_hash_not_computed) {
1811
1812
TNode<Uint32T> hash_field = LoadNameHashField(name);
1812
1813
if (if_hash_not_computed != nullptr) {
@@ -1994,13 +1995,13 @@ TNode<T> CodeStubAssembler::LoadArrayElement(TNode<Array> array,
1994
1995
}
1995
1996
}
1996
1997
1997
- template TNode<MaybeObject>
1998
+ template V8_EXPORT_PRIVATE TNode<MaybeObject>
1998
1999
CodeStubAssembler::LoadArrayElement<TransitionArray>(TNode<TransitionArray>,
1999
2000
int, Node*, int,
2000
2001
ParameterMode,
2001
2002
LoadSensitivity);
2002
2003
2003
- template TNode<MaybeObject>
2004
+ template V8_EXPORT_PRIVATE TNode<MaybeObject>
2004
2005
CodeStubAssembler::LoadArrayElement<DescriptorArray>(TNode<DescriptorArray>,
2005
2006
int, Node*, int,
2006
2007
ParameterMode,
@@ -8063,7 +8064,7 @@ void CodeStubAssembler::LookupBinary(TNode<Name> unique_name,
8063
8064
TNode<Uint32T> limit =
8064
8065
Unsigned(Int32Sub(NumberOfEntries<Array>(array), Int32Constant(1)));
8065
8066
TVARIABLE(Uint32T, var_high, limit);
8066
- TNode<Uint32T> hash = LoadNameHashField (unique_name);
8067
+ TNode<Uint32T> hash = LoadNameHashAssumeComputed (unique_name);
8067
8068
CSA_ASSERT(this, Word32NotEqual(hash, Int32Constant(0)));
8068
8069
8069
8070
// Assume non-empty array.
@@ -8081,7 +8082,7 @@ void CodeStubAssembler::LookupBinary(TNode<Name> unique_name,
8081
8082
TNode<Uint32T> sorted_key_index = GetSortedKeyIndex<Array>(array, mid);
8082
8083
TNode<Name> mid_name = GetKey<Array>(array, sorted_key_index);
8083
8084
8084
- TNode<Uint32T> mid_hash = LoadNameHashField (mid_name);
8085
+ TNode<Uint32T> mid_hash = LoadNameHashAssumeComputed (mid_name);
8085
8086
8086
8087
Label mid_greater(this), mid_less(this), merge(this);
8087
8088
Branch(Uint32GreaterThanOrEqual(mid_hash, hash), &mid_greater, &mid_less);
@@ -8108,7 +8109,7 @@ void CodeStubAssembler::LookupBinary(TNode<Name> unique_name,
8108
8109
TNode<Uint32T> sort_index =
8109
8110
GetSortedKeyIndex<Array>(array, var_low.value());
8110
8111
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);
8112
8113
GotoIf(Word32NotEqual(current_hash, hash), if_not_found);
8113
8114
Label next(this);
8114
8115
GotoIf(TaggedNotEqual(current_name, unique_name), &next);
0 commit comments