Reland "[Heap] Allocate descriptor array in young"

This is a reland of 0d6aa842e6

The reason for the revert was flaky tests, but those continued to failed randomly after the revert.
See: https://bugs.chromium.org/p/chromium/issues/detail?id=1005723#c24

After discussing with Toon, we decided that the memory gains from allocating descriptor arrays
in young space outcome the few micro-benchmark regressions.

Original change's description:
> [Heap] Allocate descriptor array in young
>
> This hopefully fix the regression test from c693e005a7
>
> Bug: v8:1004766
> Change-Id: If3c554070af6b795e4b3f99cd592a62453028874
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1809363
> Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
> Commit-Queue: Victor Gomes <victorgomes@google.com>
> Cr-Commit-Position: refs/heads/master@{#63858}

Bug: v8:1004766
Change-Id: I649f8e70abf2e5605bc073db788642705498166b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1824940
Auto-Submit: Victor Gomes <victorgomes@google.com>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Commit-Queue: Victor Gomes <victorgomes@google.com>
Cr-Commit-Position: refs/heads/master@{#63986}
This commit is contained in:
Victor Gomes 2019-09-25 12:55:47 +02:00 committed by Commit Bot
parent a2db71667a
commit 14d1e5320c

View File

@ -1844,7 +1844,7 @@ Handle<DescriptorArray> Factory::NewDescriptorArray(int number_of_descriptors,
DCHECK_LT(0, number_of_all_descriptors);
int size = DescriptorArray::SizeFor(number_of_all_descriptors);
HeapObject obj = isolate()->heap()->AllocateRawWith<Heap::kRetryOrFail>(
size, AllocationType::kOld);
size, AllocationType::kYoung);
obj.set_map_after_allocation(*descriptor_array_map(), SKIP_WRITE_BARRIER);
DescriptorArray array = DescriptorArray::cast(obj);
array.Initialize(*empty_enum_cache(), *undefined_value(),