[csa][cleanup] Remove ParameterMode/TNodify UnsafeStoreFixedArrayElement

Drive-by: Remove a parameter that had to be SKIP_WRITE_BARRIER.

Bug: v8:9708, v8:6949
Change-Id: Ib5d0521f255a92749440a5001dab8b59eb078bf9
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2362950
Reviewed-by: Mythri Alle <mythria@chromium.org>
Commit-Queue: Santiago Aboy Solanes <solanes@chromium.org>
Cr-Commit-Position: refs/heads/master@{#69481}
This commit is contained in:
Santiago Aboy Solanes 2020-08-18 14:08:23 +01:00 committed by Commit Bot
parent 132727fd46
commit 33e80ccd5d
3 changed files with 27 additions and 44 deletions

View File

@ -1728,13 +1728,13 @@ void CollectionsBuiltinsAssembler::StoreOrderedHashMapNewEntry(
kTaggedSize * (OrderedHashMap::HashTableStartIndex() +
OrderedHashMap::kValueOffset));
UnsafeStoreFixedArrayElement(
table, entry_start, bucket_entry, SKIP_WRITE_BARRIER,
table, entry_start, bucket_entry,
kTaggedSize * (OrderedHashMap::HashTableStartIndex() +
OrderedHashMap::kChainOffset));
// Update the bucket head.
UnsafeStoreFixedArrayElement(
table, bucket, SmiTag(occupancy), SKIP_WRITE_BARRIER,
table, bucket, SmiTag(occupancy),
OrderedHashMap::HashTableStartIndex() * kTaggedSize);
// Bump the elements count.
@ -1896,13 +1896,13 @@ void CollectionsBuiltinsAssembler::StoreOrderedHashSetNewEntry(
table, entry_start, key, UPDATE_WRITE_BARRIER,
kTaggedSize * OrderedHashSet::HashTableStartIndex());
UnsafeStoreFixedArrayElement(
table, entry_start, bucket_entry, SKIP_WRITE_BARRIER,
table, entry_start, bucket_entry,
kTaggedSize * (OrderedHashSet::HashTableStartIndex() +
OrderedHashSet::kChainOffset));
// Update the bucket head.
UnsafeStoreFixedArrayElement(
table, bucket, SmiTag(occupancy), SKIP_WRITE_BARRIER,
table, bucket, SmiTag(occupancy),
OrderedHashSet::HashTableStartIndex() * kTaggedSize);
// Bump the elements count.
@ -2491,9 +2491,9 @@ void WeakCollectionsBuiltinsAssembler::AddEntry(
UnsafeStoreFixedArrayElement(table, value_index, value);
// See HashTableBase::ElementAdded().
UnsafeStoreFixedArrayElement(
table, EphemeronHashTable::kNumberOfElementsIndex,
SmiFromIntPtr(number_of_elements), SKIP_WRITE_BARRIER);
UnsafeStoreFixedArrayElement(table,
EphemeronHashTable::kNumberOfElementsIndex,
SmiFromIntPtr(number_of_elements));
}
TNode<HeapObject> WeakCollectionsBuiltinsAssembler::AllocateTable(

View File

@ -614,9 +614,8 @@ TNode<HeapObject> RegExpBuiltinsAssembler::RegExpExecInternal(
GotoIf(SmiGreaterThan(register_count, available_slots), &runtime);
// Fill match_info.
UnsafeStoreFixedArrayElement(match_info,
RegExpMatchInfo::kNumberOfCapturesIndex,
register_count, SKIP_WRITE_BARRIER);
UnsafeStoreFixedArrayElement(
match_info, RegExpMatchInfo::kNumberOfCapturesIndex, register_count);
UnsafeStoreFixedArrayElement(match_info, RegExpMatchInfo::kLastSubjectIndex,
string);
UnsafeStoreFixedArrayElement(match_info, RegExpMatchInfo::kLastInputIndex,
@ -852,19 +851,17 @@ TF_BUILTIN(RegExpExecAtom, RegExpBuiltinsAssembler) {
const TNode<Smi> match_to =
SmiAdd(match_from, LoadStringLengthAsSmi(needle_string));
UnsafeStoreFixedArrayElement(
match_info, RegExpMatchInfo::kNumberOfCapturesIndex,
SmiConstant(kNumRegisters), SKIP_WRITE_BARRIER);
UnsafeStoreFixedArrayElement(match_info,
RegExpMatchInfo::kNumberOfCapturesIndex,
SmiConstant(kNumRegisters));
UnsafeStoreFixedArrayElement(match_info, RegExpMatchInfo::kLastSubjectIndex,
subject_string);
UnsafeStoreFixedArrayElement(match_info, RegExpMatchInfo::kLastInputIndex,
subject_string);
UnsafeStoreFixedArrayElement(match_info,
RegExpMatchInfo::kFirstCaptureIndex,
match_from, SKIP_WRITE_BARRIER);
UnsafeStoreFixedArrayElement(match_info,
RegExpMatchInfo::kFirstCaptureIndex + 1,
match_to, SKIP_WRITE_BARRIER);
UnsafeStoreFixedArrayElement(
match_info, RegExpMatchInfo::kFirstCaptureIndex, match_from);
UnsafeStoreFixedArrayElement(
match_info, RegExpMatchInfo::kFirstCaptureIndex + 1, match_to);
Return(match_info);
}

View File

@ -1516,15 +1516,13 @@ class V8_EXPORT_PRIVATE CodeStubAssembler
// This doesn't emit a bounds-check. As part of the security-performance
// tradeoff, only use it if it is performance critical.
void UnsafeStoreFixedArrayElement(
TNode<FixedArray> object, int index, SloppyTNode<Object> value,
TNode<FixedArray> object, int index, TNode<Object> value,
WriteBarrierMode barrier_mode = UPDATE_WRITE_BARRIER) {
return StoreFixedArrayElement(object, index, value, barrier_mode,
CheckBounds::kDebugOnly);
}
void UnsafeStoreFixedArrayElement(
TNode<FixedArray> object, int index, TNode<Smi> value,
WriteBarrierMode barrier_mode = SKIP_WRITE_BARRIER) {
DCHECK_EQ(SKIP_WRITE_BARRIER, barrier_mode);
void UnsafeStoreFixedArrayElement(TNode<FixedArray> object, int index,
TNode<Smi> value) {
return StoreFixedArrayElement(object, index, value,
UNSAFE_SKIP_WRITE_BARRIER,
CheckBounds::kDebugOnly);
@ -1536,14 +1534,6 @@ class V8_EXPORT_PRIVATE CodeStubAssembler
UNSAFE_SKIP_WRITE_BARRIER, 0,
INTPTR_PARAMETERS, check_bounds);
}
// This doesn't emit a bounds-check. As part of the security-performance
// tradeoff, only use it if it is performance critical.
void UnsafeStoreFixedArrayElement(TNode<FixedArray> object, int index,
TNode<Smi> value) {
return StoreFixedArrayElement(object, index, value,
CheckBounds::kDebugOnly);
}
void StoreFixedArrayElement(
TNode<FixedArray> array, Node* index, SloppyTNode<Object> value,
WriteBarrierMode barrier_mode = UPDATE_WRITE_BARRIER,
@ -1556,27 +1546,23 @@ class V8_EXPORT_PRIVATE CodeStubAssembler
StoreFixedArrayOrPropertyArrayElement(array, index, value, barrier_mode,
additional_offset, parameter_mode);
}
// This doesn't emit a bounds-check. As part of the security-performance
// tradeoff, only use it if it is performance critical.
void UnsafeStoreFixedArrayElement(
TNode<FixedArray> array, Node* index, SloppyTNode<Object> value,
TNode<FixedArray> array, TNode<IntPtrT> index, TNode<Object> value,
WriteBarrierMode barrier_mode = UPDATE_WRITE_BARRIER,
int additional_offset = 0,
ParameterMode parameter_mode = INTPTR_PARAMETERS) {
int additional_offset = 0) {
return StoreFixedArrayElement(array, index, value, barrier_mode,
additional_offset, parameter_mode,
additional_offset, INTPTR_PARAMETERS,
CheckBounds::kDebugOnly);
}
void UnsafeStoreFixedArrayElement(
TNode<FixedArray> array, Node* index, TNode<Smi> value,
WriteBarrierMode barrier_mode = SKIP_WRITE_BARRIER,
int additional_offset = 0,
ParameterMode parameter_mode = INTPTR_PARAMETERS) {
DCHECK_EQ(SKIP_WRITE_BARRIER, barrier_mode);
void UnsafeStoreFixedArrayElement(TNode<FixedArray> array,
TNode<IntPtrT> index, TNode<Smi> value,
int additional_offset) {
return StoreFixedArrayElement(array, index, value,
UNSAFE_SKIP_WRITE_BARRIER, additional_offset,
parameter_mode, CheckBounds::kDebugOnly);
INTPTR_PARAMETERS, CheckBounds::kDebugOnly);
}
void StorePropertyArrayElement(TNode<PropertyArray> array,