Commit a0ef7524 authored by Igor Sheludko's avatar Igor Sheludko Committed by V8 LUCI CQ

[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: 's avatarJakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/main@{#76463}
parent a6f3fce3
...@@ -589,10 +589,7 @@ TNode<HeapObject> ConstructorBuiltinsAssembler::CreateShallowObjectLiteral( ...@@ -589,10 +589,7 @@ TNode<HeapObject> ConstructorBuiltinsAssembler::CreateShallowObjectLiteral(
BIND(&if_copy_elements); BIND(&if_copy_elements);
CSA_ASSERT(this, Word32BinaryNot( CSA_ASSERT(this, Word32BinaryNot(
IsFixedCOWArrayMap(LoadMap(boilerplate_elements)))); IsFixedCOWArrayMap(LoadMap(boilerplate_elements))));
ExtractFixedArrayFlags flags; auto flags = ExtractFixedArrayFlag::kAllFixedArrays;
flags |= ExtractFixedArrayFlag::kAllFixedArrays;
flags |= ExtractFixedArrayFlag::kNewSpaceAllocationOnly;
flags |= ExtractFixedArrayFlag::kDontCopyCOW;
var_elements = CloneFixedArray(boilerplate_elements, flags); var_elements = CloneFixedArray(boilerplate_elements, flags);
Goto(&done); Goto(&done);
BIND(&done); BIND(&done);
......
...@@ -4341,17 +4341,11 @@ TNode<FixedArray> CodeStubAssembler::ExtractToFixedArray( ...@@ -4341,17 +4341,11 @@ TNode<FixedArray> CodeStubAssembler::ExtractToFixedArray(
{ {
bool handle_old_space = !FLAG_young_generation_large_objects; bool handle_old_space = !FLAG_young_generation_large_objects;
if (handle_old_space) { if (handle_old_space) {
if (extract_flags & ExtractFixedArrayFlag::kNewSpaceAllocationOnly) { int constant_count;
handle_old_space = false; handle_old_space =
CSA_ASSERT(this, Word32BinaryNot(FixedArraySizeDoesntFitInNewSpace( !TryGetIntPtrOrSmiConstantValue(count, &constant_count) ||
count, FixedArray::kHeaderSize))); (constant_count >
} else { 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); Label old_space(this, Label::kDeferred);
...@@ -4554,10 +4548,7 @@ TNode<FixedArrayBase> CodeStubAssembler::ExtractFixedArray( ...@@ -4554,10 +4548,7 @@ TNode<FixedArrayBase> CodeStubAssembler::ExtractFixedArray(
var_holes_converted != nullptr ? HoleConversionMode::kConvertToUndefined var_holes_converted != nullptr ? HoleConversionMode::kConvertToUndefined
: HoleConversionMode::kDontConvert; : HoleConversionMode::kDontConvert;
TVARIABLE(FixedArrayBase, var_result); TVARIABLE(FixedArrayBase, var_result);
const AllocationFlags allocation_flags = auto allocation_flags = CodeStubAssembler::kAllowLargeObjectAllocation;
(extract_flags & ExtractFixedArrayFlag::kNewSpaceAllocationOnly)
? CodeStubAssembler::kNone
: CodeStubAssembler::kAllowLargeObjectAllocation;
if (!first) { if (!first) {
first = IntPtrOrSmiConstant<TIndex>(0); first = IntPtrOrSmiConstant<TIndex>(0);
} }
......
...@@ -2132,7 +2132,6 @@ class V8_EXPORT_PRIVATE CodeStubAssembler ...@@ -2132,7 +2132,6 @@ class V8_EXPORT_PRIVATE CodeStubAssembler
kFixedArrays = 1, kFixedArrays = 1,
kFixedDoubleArrays = 2, kFixedDoubleArrays = 2,
kDontCopyCOW = 4, kDontCopyCOW = 4,
kNewSpaceAllocationOnly = 8,
kAllFixedArrays = kFixedArrays | kFixedDoubleArrays, kAllFixedArrays = kFixedArrays | kFixedDoubleArrays,
kAllFixedArraysDontCopyCOW = kAllFixedArrays | kDontCopyCOW kAllFixedArraysDontCopyCOW = kAllFixedArrays | kDontCopyCOW
}; };
......
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