Index: src/heap.cc |
diff --git a/src/heap.cc b/src/heap.cc |
index b95af11ae01c5a184dcf25f0b89eceeac32eded2..4243bcab442dba760215358d3b707617185f8adf 100644 |
--- a/src/heap.cc |
+++ b/src/heap.cc |
@@ -4421,7 +4421,10 @@ MaybeObject* Heap::AllocateJSObjectFromMap(Map* map, PretenureFlag pretenure) { |
ASSERT(map->instance_type() != JS_BUILTINS_OBJECT_TYPE); |
// Allocate the backing storage for the properties. |
- int prop_size = map->InitialPropertiesLength(); |
+ int prop_size = |
+ map->pre_allocated_property_fields() + |
+ map->unused_property_fields() - |
+ map->inobject_properties(); |
ASSERT(prop_size >= 0); |
Object* properties; |
{ MaybeObject* maybe_properties = AllocateFixedArray(prop_size, pretenure); |
@@ -4458,7 +4461,10 @@ MaybeObject* Heap::AllocateJSObjectFromMapWithAllocationSite(Map* map, |
ASSERT(map->instance_type() != JS_BUILTINS_OBJECT_TYPE); |
// Allocate the backing storage for the properties. |
- int prop_size = map->InitialPropertiesLength(); |
+ int prop_size = |
+ map->pre_allocated_property_fields() + |
+ map->unused_property_fields() - |
+ map->inobject_properties(); |
ASSERT(prop_size >= 0); |
Object* properties; |
{ MaybeObject* maybe_properties = AllocateFixedArray(prop_size); |
@@ -6645,7 +6651,12 @@ bool Heap::ConfigureHeap(int max_semispace_size, |
max_semispace_size_ = RoundUpToPowerOf2(max_semispace_size_); |
reserved_semispace_size_ = RoundUpToPowerOf2(reserved_semispace_size_); |
initial_semispace_size_ = Min(initial_semispace_size_, max_semispace_size_); |
- external_allocation_limit_ = 16 * max_semispace_size_; |
+ |
+ // The external allocation limit should be below 256 MB on all architectures |
+ // to avoid unnecessary low memory notifications, as that is the threshold |
+ // for some embedders. |
+ external_allocation_limit_ = 12 * max_semispace_size_; |
+ ASSERT(external_allocation_limit_ <= 256 * MB); |
// The old generation is paged and needs at least one page for each space. |
int paged_space_count = LAST_PAGED_SPACE - FIRST_PAGED_SPACE + 1; |