Commit 1c8864cc authored by Santiago Aboy Solanes's avatar Santiago Aboy Solanes Committed by Commit Bot

[csa][cleanup] Remove ParameterMode from filling array methods

Remove from:
    * FillPropertyArrayWithUndefined
    * CopyPropertyArrayValues

Bug: v8:9708, v8:6949
Change-Id: I536df1dbcff9b29746ab561d2fd563e16ef9be76
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2324241Reviewed-by: 's avatarMythri Alle <mythria@chromium.org>
Commit-Queue: Santiago Aboy Solanes <solanes@chromium.org>
Cr-Commit-Position: refs/heads/master@{#69119}
parent a0dfda88
......@@ -4231,19 +4231,17 @@ TNode<PropertyArray> CodeStubAssembler::AllocatePropertyArray(
}
void CodeStubAssembler::FillPropertyArrayWithUndefined(
TNode<PropertyArray> array, Node* from_node, Node* to_node,
ParameterMode mode) {
CSA_SLOW_ASSERT(this, MatchesParameterMode(from_node, mode));
CSA_SLOW_ASSERT(this, MatchesParameterMode(to_node, mode));
TNode<PropertyArray> array, TNode<IntPtrT> from_index,
TNode<IntPtrT> to_index) {
ElementsKind kind = PACKED_ELEMENTS;
TNode<Oddball> value = UndefinedConstant();
BuildFastArrayForEach(
array, kind, from_node, to_node,
array, kind, from_index, to_index,
[this, value](TNode<HeapObject> array, TNode<IntPtrT> offset) {
StoreNoWriteBarrier(MachineRepresentation::kTagged, array, offset,
value);
},
mode);
INTPTR_PARAMETERS);
}
void CodeStubAssembler::FillFixedArrayWithValue(ElementsKind kind,
......@@ -4721,11 +4719,9 @@ TNode<FixedArray> CodeStubAssembler::HeapObjectToFixedArray(
void CodeStubAssembler::CopyPropertyArrayValues(TNode<HeapObject> from_array,
TNode<PropertyArray> to_array,
Node* property_count,
TNode<IntPtrT> property_count,
WriteBarrierMode barrier_mode,
ParameterMode mode,
DestroySource destroy_source) {
CSA_SLOW_ASSERT(this, MatchesParameterMode(property_count, mode));
CSA_SLOW_ASSERT(this, Word32Or(IsPropertyArray(from_array),
IsEmptyFixedArray(from_array)));
Comment("[ CopyPropertyArrayValues");
......@@ -4738,7 +4734,7 @@ void CodeStubAssembler::CopyPropertyArrayValues(TNode<HeapObject> from_array,
needs_write_barrier = true;
}
Node* start = IntPtrOrSmiConstant(0, mode);
TNode<IntPtrT> start = IntPtrConstant(0);
ElementsKind kind = PACKED_ELEMENTS;
BuildFastArrayForEach(
from_array, kind, start, property_count,
......@@ -4757,15 +4753,14 @@ void CodeStubAssembler::CopyPropertyArrayValues(TNode<HeapObject> from_array,
value);
}
},
mode);
INTPTR_PARAMETERS);
#ifdef DEBUG
// Zap {from_array} if the copying above has made it invalid.
if (destroy_source == DestroySource::kYes) {
Label did_zap(this);
GotoIf(IsEmptyFixedArray(from_array), &did_zap);
FillPropertyArrayWithUndefined(CAST(from_array), start, property_count,
mode);
FillPropertyArrayWithUndefined(CAST(from_array), start, property_count);
Goto(&did_zap);
BIND(&did_zap);
......
......@@ -1962,8 +1962,8 @@ class V8_EXPORT_PRIVATE CodeStubAssembler
TNode<IntPtrT> length);
void FillPropertyArrayWithUndefined(TNode<PropertyArray> array,
Node* from_index, Node* to_index,
ParameterMode mode = INTPTR_PARAMETERS);
TNode<IntPtrT> from_index,
TNode<IntPtrT> to_index);
enum class DestroySource { kNo, kYes };
......@@ -1980,9 +1980,9 @@ class V8_EXPORT_PRIVATE CodeStubAssembler
// being cloned, to ensure that mutable HeapNumbers are unique between the
// source and cloned object.
void CopyPropertyArrayValues(TNode<HeapObject> from_array,
TNode<PropertyArray> to_array, Node* length,
TNode<PropertyArray> to_array,
TNode<IntPtrT> length,
WriteBarrierMode barrier_mode,
ParameterMode mode,
DestroySource destroy_source);
// Copies all elements from |from_array| of |length| size to
......
......@@ -1990,7 +1990,7 @@ TNode<PropertyArray> AccessorAssembler::ExtendPropertiesBackingStore(
// the write barrier.
CopyPropertyArrayValues(var_properties.value(), new_properties,
var_length.value(), SKIP_WRITE_BARRIER,
INTPTR_PARAMETERS, DestroySource::kYes);
DestroySource::kYes);
TNode<Int32T> new_capacity_int32 = TruncateIntPtrToInt32(new_capacity);
TNode<Int32T> new_length_and_hash_int32 =
......@@ -4055,12 +4055,10 @@ void AccessorAssembler::GenerateCloneObjectIC() {
TNode<IntPtrT> length = LoadPropertyArrayLength(source_property_array);
GotoIf(IntPtrEqual(length, IntPtrConstant(0)), &allocate_object);
auto mode = INTPTR_PARAMETERS;
TNode<PropertyArray> property_array = AllocatePropertyArray(length);
FillPropertyArrayWithUndefined(property_array, IntPtrConstant(0), length,
mode);
FillPropertyArrayWithUndefined(property_array, IntPtrConstant(0), length);
CopyPropertyArrayValues(source_property_array, property_array, length,
SKIP_WRITE_BARRIER, mode, DestroySource::kNo);
SKIP_WRITE_BARRIER, DestroySource::kNo);
var_properties = property_array;
}
......
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