diff --git a/src/objects-inl.h b/src/objects-inl.h index d92e4fd907..72dfeb0239 100644 --- a/src/objects-inl.h +++ b/src/objects-inl.h @@ -6058,13 +6058,7 @@ void JSArray::set_length(Smi* length) { bool JSArray::SetLengthWouldNormalize(Heap* heap, uint32_t new_length) { - // This constant is somewhat arbitrary. Any large enough value would work. - const uint32_t kMaxFastArrayLength = 32 * 1024 * 1024; - // If the new array won't fit in a some non-trivial fraction of the max old - // space size, then force it to go dictionary mode. - uint32_t heap_based_upper_bound = - static_cast((heap->MaxOldGenerationSize() / kDoubleSize) / 4); - return new_length >= Min(kMaxFastArrayLength, heap_based_upper_bound); + return new_length > kMaxFastArrayLength; } diff --git a/src/objects.h b/src/objects.h index cda2d15916..0df754499c 100644 --- a/src/objects.h +++ b/src/objects.h @@ -6868,6 +6868,9 @@ class JSArray: public JSObject { // Max. number of elements being copied in Array builtins. static const int kMaxCopyElements = 100; + // This constant is somewhat arbitrary. Any large enough value would work. + static const uint32_t kMaxFastArrayLength = 32 * 1024 * 1024; + static const int kInitialMaxFastElementArray = (kMaxRegularHeapObjectSize - FixedArray::kHeaderSize - kSize - AllocationMemento::kSize) /