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

Unified Diff: src/objects.cc

Issue 23622016: limit InitialMaxFastElement by MaxRegularSpaceAllocationSize (Closed) Base URL: https://github.com/v8/v8.git@master
Patch Set: Created 7 years, 4 months 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 | « src/objects.h ('k') | src/runtime.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects.cc
diff --git a/src/objects.cc b/src/objects.cc
index 75c96a6b0c2fbc4ca1d85af82a27843674bbb1b4..970c51d5d21b156a1a9a3caa3095b7616b38e5ae 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -2148,6 +2148,15 @@ void JSObject::DeliverChangeRecords(Isolate* isolate) {
}
+int JSObject::InitialMaxFastElementArray(Heap* heap) {
+ int max_array_base_size = JSArray::kSize + AllocationMemento::kSize +
+ FixedArray::kHeaderSize;
+ int size_limit = heap->MaxRegularSpaceAllocationSize() - max_array_base_size;
+ int element_limit = size_limit / kPointerSize + 1;
+ return Min(kInitialMaxFastElementArray, element_limit);
+}
+
+
MaybeObject* JSObject::SetPropertyPostInterceptor(
Name* name,
Object* value,
« no previous file with comments | « src/objects.h ('k') | src/runtime.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698