Chromium Code Reviews| Index: src/heap.cc |
| diff --git a/src/heap.cc b/src/heap.cc |
| index ba5b6903984c205a04417d7be075ac1e6f7ac860..e67df6be6deaa40feec4e6933457660a8975d0cd 100644 |
| --- a/src/heap.cc |
| +++ b/src/heap.cc |
| @@ -3377,7 +3377,6 @@ MaybeObject* Heap::AllocateSharedFunctionInfo(Object* name) { |
| share->set_debug_info(undefined_value(), SKIP_WRITE_BARRIER); |
| share->set_inferred_name(empty_string(), SKIP_WRITE_BARRIER); |
| share->set_initial_map(undefined_value(), SKIP_WRITE_BARRIER); |
| - share->set_this_property_assignments(undefined_value(), SKIP_WRITE_BARRIER); |
| share->set_ast_node_count(0); |
| share->set_stress_deopt_counter(FLAG_deopt_every_n_times); |
| share->set_counters(0); |
| @@ -3392,7 +3391,6 @@ MaybeObject* Heap::AllocateSharedFunctionInfo(Object* name) { |
| share->set_function_token_position(0); |
| // All compiler hints default to false or 0. |
| share->set_compiler_hints(0); |
| - share->set_this_property_assignments_count(0); |
| share->set_opt_count(0); |
| return share; |
| @@ -4161,20 +4159,6 @@ MaybeObject* Heap::AllocateArgumentsObject(Object* callee, int length) { |
| } |
| -static bool HasDuplicates(DescriptorArray* descriptors) { |
| - int count = descriptors->number_of_descriptors(); |
| - if (count > 1) { |
| - Name* prev_key = descriptors->GetKey(0); |
| - for (int i = 1; i != count; i++) { |
| - Name* current_key = descriptors->GetKey(i); |
| - if (prev_key == current_key) return true; |
| - prev_key = current_key; |
| - } |
| - } |
| - return false; |
| -} |
| - |
| - |
| MaybeObject* Heap::AllocateInitialMap(JSFunction* fun) { |
| ASSERT(!fun->has_initial_map()); |
| @@ -4215,41 +4199,6 @@ MaybeObject* Heap::AllocateInitialMap(JSFunction* fun) { |
| // the inline_new flag so we only change the map if we generate a |
| // specialized construct stub. |
| ASSERT(in_object_properties <= Map::kMaxPreAllocatedPropertyFields); |
|
Michael Starzinger
2013/06/05 08:34:04
Both the assert and the five lines of comments abo
Toon Verwaest
2013/06/05 08:41:42
Done.
|
| - if (!fun->shared()->is_generator() && |
| - fun->shared()->CanGenerateInlineConstructor(prototype)) { |
| - int count = fun->shared()->this_property_assignments_count(); |
| - if (count > in_object_properties) { |
| - // Inline constructor can only handle inobject properties. |
| - fun->shared()->ForbidInlineConstructor(); |
| - } else { |
| - DescriptorArray* descriptors; |
| - MaybeObject* maybe_descriptors = DescriptorArray::Allocate(count); |
| - if (!maybe_descriptors->To(&descriptors)) return maybe_descriptors; |
| - |
| - DescriptorArray::WhitenessWitness witness(descriptors); |
| - for (int i = 0; i < count; i++) { |
| - String* name = fun->shared()->GetThisPropertyAssignmentName(i); |
| - ASSERT(name->IsInternalizedString()); |
| - // TODO(verwaest): Since we cannot update the boilerplate's map yet, |
| - // initialize to the worst case. |
| - FieldDescriptor field(name, i, NONE, Representation::Tagged()); |
| - descriptors->Set(i, &field, witness); |
| - } |
| - descriptors->Sort(); |
| - |
| - // The descriptors may contain duplicates because the compiler does not |
| - // guarantee the uniqueness of property names (it would have required |
| - // quadratic time). Once the descriptors are sorted we can check for |
| - // duplicates in linear time. |
| - if (HasDuplicates(descriptors)) { |
| - fun->shared()->ForbidInlineConstructor(); |
| - } else { |
| - map->InitializeDescriptors(descriptors); |
| - map->set_pre_allocated_property_fields(count); |
| - map->set_unused_property_fields(in_object_properties - count); |
| - } |
| - } |
| - } |
| if (!fun->shared()->is_generator()) { |
| fun->shared()->StartInobjectSlackTracking(map); |