[heap] Reduce size of large object in StressConcurrentAllocatorTask

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 <ulan@chromium.org>
Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#69225}
This commit is contained in:
Dominik Inführ 2020-08-04 14:58:18 +02:00 committed by Commit Bot
parent 14a5a6ad30
commit c16a3baafd

View File

@ -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<int>(MemoryChunk::kPageSize -
MemoryChunkLayout::ObjectStartOffsetInDataPage());
for (int i = 0; i < kNumIterations; i++) {
Address address = local_heap.AllocateRawOrFail(