Commit 2de45f21 authored by Junliang Yan's avatar Junliang Yan Committed by Commit Bot

[heap] adjust kMaxRegularHeapObjectSize on ppc64le

This is to address the first issue reported on v8:8453

Page::kPageSize is 524288
MemoryAllocator::GetCommitPageSize() returns 65536 on ppc

ObjectEndOffsetInCodePage() returns 458752
ObjectStartOffsetInCodePage() returns (65536 + 65536) => 131072

Therefore, memory = 327680, which is less than
kMaxRegularHeapObjectSize(507136), which causes the DCHECK to fail.

Bug: v8:8453
Change-Id: I6048192ded4234a6987371ec4d4b2a8553756c25
Reviewed-on: https://chromium-review.googlesource.com/c/1355422
Commit-Queue: Junliang Yan <jyan@ca.ibm.com>
Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58001}
parent 48924ffa
......@@ -241,7 +241,12 @@ constexpr int kExternalAllocationSoftLimit =
// account.
//
// Current value: Page::kAllocatableMemory (on 32-bit arch) - 512 (slack).
#ifdef V8_HOST_ARCH_PPC
// Reduced kMaxRegularHeapObjectSize due to larger page size(64k) on ppc64le
constexpr int kMaxRegularHeapObjectSize = 327680;
#else
constexpr int kMaxRegularHeapObjectSize = 507136;
#endif
constexpr int kBitsPerByte = 8;
constexpr int kBitsPerByteLog2 = 3;
......
......@@ -176,7 +176,12 @@ class HashTable : public HashTableBase {
static const int kMinShrinkCapacity = 16;
// Maximum length to create a regular HashTable (aka. non large object).
#if V8_HOST_ARCH_PPC
// Reduced kMaxRegularCapacity due to reduced kMaxRegularHeapObjectSize
static const int kMaxRegularCapacity = 16384 / 2;
#else
static const int kMaxRegularCapacity = 16384;
#endif
// Returns the index for an entry (of the key)
static constexpr inline int EntryToIndex(int entry) {
......
......@@ -1833,11 +1833,20 @@ TEST(CodeSerializerThreeBigStrings) {
result_str = CompileRun("b")
->ToString(CcTest::isolate()->GetCurrentContext())
.ToLocalChecked();
#if V8_HOST_ARCH_PPC
CHECK(heap->InSpace(*v8::Utils::OpenHandle(*result_str), LO_SPACE));
#else
CHECK(heap->InSpace(*v8::Utils::OpenHandle(*result_str), OLD_SPACE));
#endif
result_str = CompileRun("c")
->ToString(CcTest::isolate()->GetCurrentContext())
.ToLocalChecked();
#if V8_HOST_ARCH_PPC
CHECK(heap->InSpace(*v8::Utils::OpenHandle(*result_str), LO_SPACE));
#else
CHECK(heap->InSpace(*v8::Utils::OpenHandle(*result_str), OLD_SPACE));
#endif
delete cache;
source_a.Dispose();
......
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