@@ -1605,6 +1605,13 @@ TNode<IntPtrT> CodeStubAssembler::LoadAndUntagWeakFixedArrayLength(
16051605 return LoadAndUntagObjectField(array, WeakFixedArray::kLengthOffset);
16061606}
16071607
1608+ TNode<Int32T> CodeStubAssembler::LoadNumberOfDescriptors(
1609+ TNode<DescriptorArray> array) {
1610+ return UncheckedCast<Int32T>(
1611+ LoadObjectField(array, DescriptorArray::kNumberOfDescriptorsOffset,
1612+ MachineType::Int16()));
1613+ }
1614+
16081615TNode<Int32T> CodeStubAssembler::LoadMapBitField(SloppyTNode<Map> map) {
16091616 CSA_SLOW_ASSERT(this, IsMap(map));
16101617 return UncheckedCast<Int32T>(
@@ -1961,7 +1968,8 @@ TNode<IntPtrT> CodeStubAssembler::LoadArrayLength(TNode<PropertyArray> array) {
19611968template <>
19621969TNode<IntPtrT> CodeStubAssembler::LoadArrayLength(
19631970 TNode<DescriptorArray> array) {
1964- return LoadAndUntagWeakFixedArrayLength(array);
1971+ return IntPtrMul(ChangeInt32ToIntPtr(LoadNumberOfDescriptors(array)),
1972+ IntPtrConstant(DescriptorArray::kEntrySize));
19651973}
19661974
19671975template <>
@@ -8701,7 +8709,8 @@ void CodeStubAssembler::LookupLinear(TNode<Name> unique_name,
87018709 TVariable<IntPtrT>* var_name_index,
87028710 Label* if_not_found) {
87038711 static_assert(std::is_base_of<FixedArray, Array>::value ||
8704- std::is_base_of<WeakFixedArray, Array>::value,
8712+ std::is_base_of<WeakFixedArray, Array>::value ||
8713+ std::is_base_of<DescriptorArray, Array>::value,
87058714 "T must be a descendant of FixedArray or a WeakFixedArray");
87068715 Comment("LookupLinear");
87078716 TNode<IntPtrT> first_inclusive = IntPtrConstant(Array::ToKeyIndex(0));
@@ -8725,9 +8734,7 @@ void CodeStubAssembler::LookupLinear(TNode<Name> unique_name,
87258734template <>
87268735TNode<Uint32T> CodeStubAssembler::NumberOfEntries<DescriptorArray>(
87278736 TNode<DescriptorArray> descriptors) {
8728- return Unsigned(LoadAndUntagToWord32ArrayElement(
8729- descriptors, WeakFixedArray::kHeaderSize,
8730- IntPtrConstant(DescriptorArray::kDescriptorLengthIndex)));
8737+ return Unsigned(LoadNumberOfDescriptors(descriptors));
87318738}
87328739
87338740template <>
@@ -8780,9 +8787,9 @@ TNode<Uint32T> CodeStubAssembler::GetSortedKeyIndex<TransitionArray>(
87808787template <typename Array>
87818788TNode<Name> CodeStubAssembler::GetKey(TNode<Array> array,
87828789 TNode<Uint32T> entry_index) {
8783- static_assert(std::is_base_of<FixedArray , Array>::value ||
8784- std::is_base_of<WeakFixedArray , Array>::value,
8785- "T must be a descendant of FixedArray or a TransitionArray");
8790+ static_assert(std::is_base_of<TransitionArray , Array>::value ||
8791+ std::is_base_of<DescriptorArray , Array>::value,
8792+ "T must be a descendant of DescriptorArray or TransitionArray");
87868793 const int key_offset = Array::ToKeyIndex(0) * kPointerSize;
87878794 TNode<MaybeObject> element =
87888795 LoadArrayElement(array, Array::kHeaderSize,
@@ -13703,8 +13710,8 @@ void CodeStubAssembler::GotoIfInitialPrototypePropertiesModified(
1370313710 for (int i = 0; i < properties.length(); i++) {
1370413711 // Assert the descriptor index is in-bounds.
1370513712 int descriptor = properties[i].descriptor_index;
13706- CSA_ASSERT(this, SmiLessThan(SmiConstant (descriptor),
13707- LoadWeakFixedArrayLength (descriptors)));
13713+ CSA_ASSERT(this, Int32LessThan(Int32Constant (descriptor),
13714+ LoadNumberOfDescriptors (descriptors)));
1370813715 // Assert that the name is correct. This essentially checks that
1370913716 // the descriptor index corresponds to the insertion order in
1371013717 // the bootstrapper.
0 commit comments