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

Unified Diff: src/heap.cc

Issue 10816005: Swapped transition array and descriptor array. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed comments, and updated additional code comments. Created 8 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
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);
}
« src/bootstrapper.cc ('K') | « src/factory.cc ('k') | src/ia32/macro-assembler-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698