From c16a3baafdfe906b35beea2e7e4904aaee611ac9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Inf=C3=BChr?= Date: Tue, 4 Aug 2020 14:58:18 +0200 Subject: [PATCH] [heap] Reduce size of large object in StressConcurrentAllocatorTask MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This ensures that large object has exactly the size of a regular page. Avoids wasting memory due to alignment. Bug: v8:10315 Change-Id: Ife8051313f1ea8c1fc0ba0afcc4e5db11f27adca Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2335191 Reviewed-by: Ulan Degenbaev Commit-Queue: Dominik Inführ Cr-Commit-Position: refs/heads/master@{#69225} --- src/heap/concurrent-allocator.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/heap/concurrent-allocator.cc b/src/heap/concurrent-allocator.cc index cc973c5b95..184ad88490 100644 --- a/src/heap/concurrent-allocator.cc +++ b/src/heap/concurrent-allocator.cc @@ -10,6 +10,7 @@ #include "src/heap/concurrent-allocator-inl.h" #include "src/heap/local-heap-inl.h" #include "src/heap/marking.h" +#include "src/heap/memory-chunk.h" namespace v8 { namespace internal { @@ -21,7 +22,9 @@ void StressConcurrentAllocatorTask::RunInternal() { const int kNumIterations = 2000; const int kSmallObjectSize = 10 * kTaggedSize; const int kMediumObjectSize = 8 * KB; - const int kLargeObjectSize = kMaxRegularHeapObjectSize * 2; + const int kLargeObjectSize = + static_cast(MemoryChunk::kPageSize - + MemoryChunkLayout::ObjectStartOffsetInDataPage()); for (int i = 0; i < kNumIterations; i++) { Address address = local_heap.AllocateRawOrFail(