Index: src/heap.cc |
diff --git a/src/heap.cc b/src/heap.cc |
index 8e64f9e39cc5d02ee46e4b4ed77423c360594754..698192389a7ec5284d2a3c88a596dfe79f012329 100644 |
--- a/src/heap.cc |
+++ b/src/heap.cc |
@@ -3711,8 +3711,7 @@ MaybeObject* Heap::AllocateFunctionPrototype(JSFunction* function) { |
// constructors. |
Map* new_map; |
ASSERT(object_function->has_initial_map()); |
- MaybeObject* maybe_map = |
- object_function->initial_map()->Copy(DescriptorArray::MAY_BE_SHARED); |
+ MaybeObject* maybe_map = object_function->initial_map()->Copy(); |
if (!maybe_map->To(&new_map)) return maybe_map; |
Object* prototype; |
@@ -3856,8 +3855,7 @@ MaybeObject* Heap::AllocateInitialMap(JSFunction* fun) { |
fun->shared()->ForbidInlineConstructor(); |
} else { |
DescriptorArray* descriptors; |
- MaybeObject* maybe_descriptors = |
- DescriptorArray::Allocate(count, DescriptorArray::MAY_BE_SHARED); |
+ MaybeObject* maybe_descriptors = DescriptorArray::Allocate(count); |
if (!maybe_descriptors->To(&descriptors)) return maybe_descriptors; |
DescriptorArray::WhitenessWitness witness(descriptors); |
@@ -3876,7 +3874,8 @@ MaybeObject* Heap::AllocateInitialMap(JSFunction* fun) { |
if (HasDuplicates(descriptors)) { |
fun->shared()->ForbidInlineConstructor(); |
} else { |
- map->InitializeDescriptors(descriptors); |
+ MaybeObject* maybe_failure = map->InitializeDescriptors(descriptors); |
+ if (maybe_failure->IsFailure()) return maybe_failure; |
map->set_pre_allocated_property_fields(count); |
map->set_unused_property_fields(in_object_properties - count); |
} |