Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(417)

Unified Diff: src/objects-inl.h

Issue 2513923002: [heap, runtime] Set upper limit on the size of fast fixed arrays that (Closed)
Patch Set: Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects-inl.h
diff --git a/src/objects-inl.h b/src/objects-inl.h
index 59031d658c698ebf76ac8b4d5fcafc7b9b111cdb..d0f0f20660d7dccb2876806645fd357ce6d63cd2 100644
--- a/src/objects-inl.h
+++ b/src/objects-inl.h
@@ -8131,11 +8131,13 @@ 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 max_fast_array_size =
+ uint32_t heap_based_upper_bound =
static_cast<uint32_t>((heap->MaxOldGenerationSize() / kDoubleSize) / 4);
- return new_length >= max_fast_array_size;
+ return new_length >= Min(kMaxFastArrayLength, heap_based_upper_bound);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698