diff --git a/src/globals.h b/src/globals.h index aa392e6f41..865cf9cbf5 100644 --- a/src/globals.h +++ b/src/globals.h @@ -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; diff --git a/src/objects/hash-table.h b/src/objects/hash-table.h index 3eedbb6997..d358fbb5ef 100644 --- a/src/objects/hash-table.h +++ b/src/objects/hash-table.h @@ -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) { diff --git a/test/cctest/test-serialize.cc b/test/cctest/test-serialize.cc index 7f9bb23fe7..0986104beb 100644 --- a/test/cctest/test-serialize.cc +++ b/test/cctest/test-serialize.cc @@ -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();