[heap] Fix shared string allocation refinement with single generation builds

Also skip the test-shared-strings/YoungInternalization cctest, which
doesn't make sense when there is no young generation.

Bug: v8:12007
Change-Id: I3006960181a7da681d7318289a6ade6b0f0bf6da
Cq-Include-Trybots: luci.v8.try:v8_linux64_single_generation_dbg_ng
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3218197
Auto-Submit: Shu-yu Guo <syg@chromium.org>
Commit-Queue: Shu-yu Guo <syg@chromium.org>
Reviewed-by: Dominik Inführ <dinfuehr@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77371}
This commit is contained in:
Shu-yu Guo 2021-10-12 15:14:47 -07:00 committed by V8 LUCI CQ
parent 1bbeac58ad
commit ea2c6e679e
2 changed files with 5 additions and 0 deletions

View File

@ -959,6 +959,9 @@ FactoryBase<Impl>::RefineAllocationTypeForInPlaceInternalizableString(
DCHECK(InstanceTypeChecker::IsInternalizedString(instance_type) ||
String::IsInPlaceInternalizable(instance_type));
#endif
if (FLAG_single_generation && allocation == AllocationType::kYoung) {
allocation = AllocationType::kOld;
}
if (allocation != AllocationType::kOld) return allocation;
return impl()->AllocationTypeForInPlaceInternalizableString();
}

View File

@ -64,6 +64,7 @@ class MultiClientIsolateTest {
};
UNINITIALIZED_TEST(InPlaceInternalizableStringsAreShared) {
if (FLAG_single_generation) return;
if (!ReadOnlyHeap::IsReadOnlySpaceShared()) return;
if (!COMPRESS_POINTERS_IN_SHARED_CAGE_BOOL) return;
@ -176,6 +177,7 @@ UNINITIALIZED_TEST(InPlaceInternalization) {
UNINITIALIZED_TEST(YoungInternalization) {
if (!ReadOnlyHeap::IsReadOnlySpaceShared()) return;
if (!COMPRESS_POINTERS_IN_SHARED_CAGE_BOOL) return;
if (FLAG_single_generation) return;
FLAG_shared_string_table = true;