Commit 88958ea9 authored by Santiago Aboy Solanes's avatar Santiago Aboy Solanes Committed by Commit Bot

[cleanup] TNodify ExtendPropertiesBackingStore

There are some 'mode' still pending removal.

Bug: v8:9708, v8:10506, v8:6949
Change-Id: Ie1dc0397241bf046ac9737666e700b98018b2ff5
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2202906
Commit-Queue: Santiago Aboy Solanes <solanes@chromium.org>
Reviewed-by: 's avatarMythri Alle <mythria@chromium.org>
Cr-Commit-Position: refs/heads/master@{#67861}
parent fe3e17d4
......@@ -1968,23 +1968,21 @@ TNode<PropertyArray> AccessorAssembler::ExtendPropertiesBackingStore(
// Previous property deletion could have left behind unused backing store
// capacity even for a map that think it doesn't have any unused fields.
// Perform a bounds check to see if we actually have to grow the array.
GotoIf(UintPtrLessThan(index, ParameterToIntPtr(var_length.value(), mode)),
GotoIf(UintPtrLessThan(index, ParameterToIntPtr(var_length.value())),
&done);
TNode<BInt> delta = BIntConstant(JSObject::kFieldsAdded);
Node* new_capacity = IntPtrOrSmiAdd(var_length.value(), delta, mode);
TNode<BInt> new_capacity = IntPtrOrSmiAdd(var_length.value(), delta);
// Grow properties array.
DCHECK(kMaxNumberOfDescriptors + JSObject::kFieldsAdded <
FixedArrayBase::GetMaxLengthForNewSpaceAllocation(PACKED_ELEMENTS));
// The size of a new properties backing store is guaranteed to be small
// enough that the new backing store will be allocated in new space.
CSA_ASSERT(this,
UintPtrOrSmiLessThan(
new_capacity,
IntPtrOrSmiConstant(
kMaxNumberOfDescriptors + JSObject::kFieldsAdded, mode),
mode));
CSA_ASSERT(this, UintPtrOrSmiLessThan(
new_capacity,
IntPtrOrSmiConstant<BInt>(kMaxNumberOfDescriptors +
JSObject::kFieldsAdded)));
TNode<PropertyArray> new_properties =
AllocatePropertyArray(new_capacity, mode);
......@@ -2002,7 +2000,7 @@ TNode<PropertyArray> AccessorAssembler::ExtendPropertiesBackingStore(
// TODO(gsathya): Clean up the type conversions by creating smarter
// helpers that do the correct op based on the mode.
TNode<Int32T> new_capacity_int32 =
TruncateIntPtrToInt32(ParameterToIntPtr(new_capacity, mode));
TruncateIntPtrToInt32(ParameterToIntPtr(new_capacity));
TNode<Int32T> new_length_and_hash_int32 =
Word32Or(var_encoded_hash.value(), new_capacity_int32);
StoreObjectField(new_properties, PropertyArray::kLengthAndHashOffset,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment