[csa] Let CreateShallowObjectLiteral allocate objects in LO space

... when necessary and drop the now unused flag
ExtractFixedArrayFlag::kNewSpaceAllocationOnly.

Bug: chromium:1239922
Change-Id: Ic68d241ae7422df8e203ec12de800ded8862852e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3110371
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Auto-Submit: Igor Sheludko <ishell@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/main@{#76463}
This commit is contained in:
Igor Sheludko 2021-08-24 15:52:17 +02:00 committed by V8 LUCI CQ
parent a6f3fce3c5
commit a0ef75240f
3 changed files with 7 additions and 20 deletions

View File

@ -589,10 +589,7 @@ TNode<HeapObject> ConstructorBuiltinsAssembler::CreateShallowObjectLiteral(
BIND(&if_copy_elements);
CSA_ASSERT(this, Word32BinaryNot(
IsFixedCOWArrayMap(LoadMap(boilerplate_elements))));
ExtractFixedArrayFlags flags;
flags |= ExtractFixedArrayFlag::kAllFixedArrays;
flags |= ExtractFixedArrayFlag::kNewSpaceAllocationOnly;
flags |= ExtractFixedArrayFlag::kDontCopyCOW;
auto flags = ExtractFixedArrayFlag::kAllFixedArrays;
var_elements = CloneFixedArray(boilerplate_elements, flags);
Goto(&done);
BIND(&done);

View File

@ -4341,17 +4341,11 @@ TNode<FixedArray> CodeStubAssembler::ExtractToFixedArray(
{
bool handle_old_space = !FLAG_young_generation_large_objects;
if (handle_old_space) {
if (extract_flags & ExtractFixedArrayFlag::kNewSpaceAllocationOnly) {
handle_old_space = false;
CSA_ASSERT(this, Word32BinaryNot(FixedArraySizeDoesntFitInNewSpace(
count, FixedArray::kHeaderSize)));
} else {
int constant_count;
handle_old_space =
!TryGetIntPtrOrSmiConstantValue(count, &constant_count) ||
(constant_count >
FixedArray::GetMaxLengthForNewSpaceAllocation(PACKED_ELEMENTS));
}
int constant_count;
handle_old_space =
!TryGetIntPtrOrSmiConstantValue(count, &constant_count) ||
(constant_count >
FixedArray::GetMaxLengthForNewSpaceAllocation(PACKED_ELEMENTS));
}
Label old_space(this, Label::kDeferred);
@ -4554,10 +4548,7 @@ TNode<FixedArrayBase> CodeStubAssembler::ExtractFixedArray(
var_holes_converted != nullptr ? HoleConversionMode::kConvertToUndefined
: HoleConversionMode::kDontConvert;
TVARIABLE(FixedArrayBase, var_result);
const AllocationFlags allocation_flags =
(extract_flags & ExtractFixedArrayFlag::kNewSpaceAllocationOnly)
? CodeStubAssembler::kNone
: CodeStubAssembler::kAllowLargeObjectAllocation;
auto allocation_flags = CodeStubAssembler::kAllowLargeObjectAllocation;
if (!first) {
first = IntPtrOrSmiConstant<TIndex>(0);
}

View File

@ -2132,7 +2132,6 @@ class V8_EXPORT_PRIVATE CodeStubAssembler
kFixedArrays = 1,
kFixedDoubleArrays = 2,
kDontCopyCOW = 4,
kNewSpaceAllocationOnly = 8,
kAllFixedArrays = kFixedArrays | kFixedDoubleArrays,
kAllFixedArraysDontCopyCOW = kAllFixedArrays | kDontCopyCOW
};