Commit e533b669 authored by Igor Sheludko's avatar Igor Sheludko Committed by Commit Bot

[csa] Remove ParameterMode from CSA::AllocateFixedArray (pt.1)

Bug: v8:9708
Change-Id: Iba4bf148437b9aa27d9b57ee2ebf48948d1ac163
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1801838Reviewed-by: 's avatarLeszek Swirski <leszeks@chromium.org>
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#65040}
parent aecd8437
...@@ -98,7 +98,7 @@ TF_BUILTIN(AsyncFunctionEnter, AsyncFunctionBuiltinsAssembler) { ...@@ -98,7 +98,7 @@ TF_BUILTIN(AsyncFunctionEnter, AsyncFunctionBuiltinsAssembler) {
// Allocate and initialize the register file. // Allocate and initialize the register file.
TNode<FixedArrayBase> parameters_and_registers = TNode<FixedArrayBase> parameters_and_registers =
AllocateFixedArray(HOLEY_ELEMENTS, parameters_and_register_length, AllocateFixedArray(HOLEY_ELEMENTS, parameters_and_register_length,
INTPTR_PARAMETERS, kAllowLargeObjectAllocation); kAllowLargeObjectAllocation);
FillFixedArrayWithValue(HOLEY_ELEMENTS, parameters_and_registers, FillFixedArrayWithValue(HOLEY_ELEMENTS, parameters_and_registers,
IntPtrConstant(0), parameters_and_register_length, IntPtrConstant(0), parameters_and_register_length,
RootIndex::kUndefinedValue); RootIndex::kUndefinedValue);
......
...@@ -1814,7 +1814,7 @@ Node* PromiseBuiltinsAssembler::PerformPromiseAll( ...@@ -1814,7 +1814,7 @@ Node* PromiseBuiltinsAssembler::PerformPromiseAll(
const TNode<Smi> new_capacity = var_index.value(); const TNode<Smi> new_capacity = var_index.value();
GotoIf(SmiGreaterThanOrEqual(old_capacity, new_capacity), &return_promise); GotoIf(SmiGreaterThanOrEqual(old_capacity, new_capacity), &return_promise);
const TNode<FixedArrayBase> new_elements = const TNode<FixedArrayBase> new_elements =
AllocateFixedArray(PACKED_ELEMENTS, new_capacity, SMI_PARAMETERS, AllocateFixedArray(PACKED_ELEMENTS, new_capacity,
AllocationFlag::kAllowLargeObjectAllocation); AllocationFlag::kAllowLargeObjectAllocation);
CopyFixedArrayElements(PACKED_ELEMENTS, old_elements, PACKED_ELEMENTS, CopyFixedArrayElements(PACKED_ELEMENTS, old_elements, PACKED_ELEMENTS,
new_elements, SmiConstant(0), old_capacity, new_elements, SmiConstant(0), old_capacity,
......
...@@ -3304,7 +3304,7 @@ TNode<ByteArray> CodeStubAssembler::AllocateByteArray(TNode<UintPtrT> length, ...@@ -3304,7 +3304,7 @@ TNode<ByteArray> CodeStubAssembler::AllocateByteArray(TNode<UintPtrT> length,
GotoIf(WordEqual(length, UintPtrConstant(0)), &if_lengthiszero); GotoIf(WordEqual(length, UintPtrConstant(0)), &if_lengthiszero);
TNode<IntPtrT> raw_size = TNode<IntPtrT> raw_size =
GetArrayAllocationSize(Signed(length), UINT8_ELEMENTS, INTPTR_PARAMETERS, GetArrayAllocationSize(Signed(length), UINT8_ELEMENTS,
ByteArray::kHeaderSize + kObjectAlignmentMask); ByteArray::kHeaderSize + kObjectAlignmentMask);
TNode<IntPtrT> size = TNode<IntPtrT> size =
WordAnd(raw_size, IntPtrConstant(~kObjectAlignmentMask)); WordAnd(raw_size, IntPtrConstant(~kObjectAlignmentMask));
...@@ -3379,7 +3379,7 @@ TNode<String> CodeStubAssembler::AllocateSeqOneByteString( ...@@ -3379,7 +3379,7 @@ TNode<String> CodeStubAssembler::AllocateSeqOneByteString(
GotoIf(Word32Equal(length, Uint32Constant(0)), &if_lengthiszero); GotoIf(Word32Equal(length, Uint32Constant(0)), &if_lengthiszero);
TNode<IntPtrT> raw_size = GetArrayAllocationSize( TNode<IntPtrT> raw_size = GetArrayAllocationSize(
Signed(ChangeUint32ToWord(length)), UINT8_ELEMENTS, INTPTR_PARAMETERS, Signed(ChangeUint32ToWord(length)), UINT8_ELEMENTS,
SeqOneByteString::kHeaderSize + kObjectAlignmentMask); SeqOneByteString::kHeaderSize + kObjectAlignmentMask);
TNode<IntPtrT> size = TNode<IntPtrT> size =
WordAnd(raw_size, IntPtrConstant(~kObjectAlignmentMask)); WordAnd(raw_size, IntPtrConstant(~kObjectAlignmentMask));
...@@ -3451,7 +3451,7 @@ TNode<String> CodeStubAssembler::AllocateSeqTwoByteString( ...@@ -3451,7 +3451,7 @@ TNode<String> CodeStubAssembler::AllocateSeqTwoByteString(
GotoIf(Word32Equal(length, Uint32Constant(0)), &if_lengthiszero); GotoIf(Word32Equal(length, Uint32Constant(0)), &if_lengthiszero);
TNode<IntPtrT> raw_size = GetArrayAllocationSize( TNode<IntPtrT> raw_size = GetArrayAllocationSize(
Signed(ChangeUint32ToWord(length)), UINT16_ELEMENTS, INTPTR_PARAMETERS, Signed(ChangeUint32ToWord(length)), UINT16_ELEMENTS,
SeqOneByteString::kHeaderSize + kObjectAlignmentMask); SeqOneByteString::kHeaderSize + kObjectAlignmentMask);
TNode<IntPtrT> size = TNode<IntPtrT> size =
WordAnd(raw_size, IntPtrConstant(~kObjectAlignmentMask)); WordAnd(raw_size, IntPtrConstant(~kObjectAlignmentMask));
......
...@@ -1884,6 +1884,13 @@ class V8_EXPORT_PRIVATE CodeStubAssembler ...@@ -1884,6 +1884,13 @@ class V8_EXPORT_PRIVATE CodeStubAssembler
fixed_array_map); fixed_array_map);
} }
TNode<FixedArrayBase> AllocateFixedArray(
ElementsKind kind, TNode<Smi> capacity, AllocationFlags flags,
SloppyTNode<Map> fixed_array_map = nullptr) {
return AllocateFixedArray(kind, capacity, SMI_PARAMETERS, flags,
fixed_array_map);
}
TNode<NativeContext> GetCreationContext(TNode<JSReceiver> receiver, TNode<NativeContext> GetCreationContext(TNode<JSReceiver> receiver,
Label* if_bailout); Label* if_bailout);
TNode<Object> GetConstructor(TNode<Map> map); TNode<Object> GetConstructor(TNode<Map> map);
...@@ -3332,6 +3339,12 @@ class V8_EXPORT_PRIVATE CodeStubAssembler ...@@ -3332,6 +3339,12 @@ class V8_EXPORT_PRIVATE CodeStubAssembler
last_element_exclusive, body, mode, direction); last_element_exclusive, body, mode, direction);
} }
TNode<IntPtrT> GetArrayAllocationSize(TNode<IntPtrT> element_count,
ElementsKind kind, int header_size) {
return ElementOffsetFromIndex(element_count, kind, header_size);
}
// TODO(v8:9708): remove once all uses are ported.
TNode<IntPtrT> GetArrayAllocationSize(Node* element_count, ElementsKind kind, TNode<IntPtrT> GetArrayAllocationSize(Node* element_count, ElementsKind kind,
ParameterMode mode, int header_size) { ParameterMode mode, int header_size) {
return ElementOffsetFromIndex(element_count, kind, mode, header_size); return ElementOffsetFromIndex(element_count, kind, mode, header_size);
......
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