Commit 1ce9b553 authored by Igor Sheludko's avatar Igor Sheludko Committed by Commit Bot

[ptr-compr] Update FixedArrayBase::kMaxSize for 31-bit Smi and ptr-compr

When we allocate a large page we write a free space filler of the object's
size which is encoded as a Smi. Previously the 1Gb didn't fit into 31-bit
Smi. In addition, when pointer compression is enabled we should use the
same limitation as we had for 32 bit architectures.

Bug: v8:9767, chromium:1013042
Change-Id: I6e372324417f03977943f18816eaaf49540184ab
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1856007Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#64246}
parent c0ed9d16
......@@ -86,14 +86,14 @@ class FixedArrayBase : public HeapObject {
V8_EXPORT_PRIVATE bool IsCowArray() const;
// Maximal allowed size, in bytes, of a single FixedArrayBase.
// Prevents overflowing size computations, as well as extreme memory
// consumption.
#ifdef V8_HOST_ARCH_32_BIT
static const int kMaxSize = 512 * MB;
#else
static const int kMaxSize = 1024 * MB;
#endif // V8_HOST_ARCH_32_BIT
// Maximal allowed size, in bytes, of a single FixedArrayBase.
// Prevents overflowing size computations, as well as extreme memory
// consumption. It's either (512Mb - kTaggedSize) or (1024Mb - kTaggedSize).
// -kTaggedSize is here to ensure that this max size always fits into Smi
// which is necessary for being able to create a free space filler for the
// whole array of kMaxSize.
static const int kMaxSize = 128 * kTaggedSize * MB - kTaggedSize;
STATIC_ASSERT(Smi::IsValid(kMaxSize));
// Layout description.
DEFINE_FIELD_OFFSET_CONSTANTS(HeapObject::kHeaderSize,
......
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