Index: src/objects.cc |
diff --git a/src/objects.cc b/src/objects.cc |
index b27734b268a2f877905528d8ba1f483a761f1377..2b5b567112977d694b6d93213f3a03e5b05620d5 100644 |
--- a/src/objects.cc |
+++ b/src/objects.cc |
@@ -1953,8 +1953,7 @@ void JSObject::MigrateToMap(Handle<JSObject> object, Handle<Map> new_map) { |
// Clear out the old descriptor array to avoid problems to sharing |
// the descriptor array without using an explicit. |
old_map->InitializeDescriptors( |
- old_map->GetHeap()->empty_descriptor_array(), |
- LayoutDescriptor::FastPointerLayout()); |
+ old_map->GetHeap()->empty_descriptor_array()); |
// Ensure that no transition was inserted for prototype migrations. |
DCHECK(!old_map->HasTransitionArray()); |
DCHECK(new_map->GetBackPointer()->IsUndefined()); |
@@ -2013,14 +2012,10 @@ void JSObject::MigrateFastToFast(Handle<JSObject> object, Handle<Map> new_map) { |
if (old_map->unused_property_fields() > 0) { |
if (details.representation().IsDouble()) { |
+ Handle<Object> value = isolate->factory()->NewHeapNumber(0, MUTABLE); |
FieldIndex index = |
FieldIndex::ForDescriptor(*new_map, new_map->LastAdded()); |
- if (new_map->IsUnboxedDoubleField(index)) { |
- object->RawFastDoublePropertyAtPut(index, 0); |
- } else { |
- Handle<Object> value = isolate->factory()->NewHeapNumber(0, MUTABLE); |
- object->RawFastPropertyAtPut(index, *value); |
- } |
+ object->FastPropertyAtPut(index, *value); |
} |
object->synchronized_set_map(*new_map); |
return; |
@@ -2072,35 +2067,23 @@ void JSObject::MigrateFastToFast(Handle<JSObject> object, Handle<Map> new_map) { |
DCHECK(details.representation().IsTagged()); |
continue; |
} |
- Representation old_representation = old_details.representation(); |
- Representation representation = details.representation(); |
DCHECK(old_details.type() == CONSTANT || |
old_details.type() == FIELD); |
- Handle<Object> value; |
- if (old_details.type() == CONSTANT) { |
- value = handle(old_descriptors->GetValue(i), isolate); |
- DCHECK(!old_representation.IsDouble() && !representation.IsDouble()); |
- } else { |
- FieldIndex index = FieldIndex::ForDescriptor(*old_map, i); |
- if (object->IsUnboxedDoubleField(index)) { |
- double old = object->RawFastDoublePropertyAt(index); |
- value = isolate->factory()->NewHeapNumber( |
- old, representation.IsDouble() ? MUTABLE : IMMUTABLE); |
- |
- } else { |
- value = handle(object->RawFastPropertyAt(index), isolate); |
- if (!old_representation.IsDouble() && representation.IsDouble()) { |
- if (old_representation.IsNone()) { |
- value = handle(Smi::FromInt(0), isolate); |
- } |
- value = Object::NewStorageFor(isolate, value, representation); |
- } else if (old_representation.IsDouble() && |
- !representation.IsDouble()) { |
- value = Object::WrapForRead(isolate, value, old_representation); |
- } |
+ Object* raw_value = old_details.type() == CONSTANT |
+ ? old_descriptors->GetValue(i) |
+ : object->RawFastPropertyAt(FieldIndex::ForDescriptor(*old_map, i)); |
+ Handle<Object> value(raw_value, isolate); |
+ if (!old_details.representation().IsDouble() && |
+ details.representation().IsDouble()) { |
+ if (old_details.representation().IsNone()) { |
+ value = handle(Smi::FromInt(0), isolate); |
} |
+ value = Object::NewStorageFor(isolate, value, details.representation()); |
+ } else if (old_details.representation().IsDouble() && |
+ !details.representation().IsDouble()) { |
+ value = Object::WrapForRead(isolate, value, old_details.representation()); |
} |
- DCHECK(!(representation.IsDouble() && value->IsSmi())); |
+ DCHECK(!(details.representation().IsDouble() && value->IsSmi())); |
int target_index = new_descriptors->GetFieldIndex(i) - inobject; |
if (target_index < 0) target_index += total_size; |
array->set(target_index, *value); |
@@ -2128,16 +2111,7 @@ void JSObject::MigrateFastToFast(Handle<JSObject> object, Handle<Map> new_map) { |
int limit = Min(inobject, number_of_fields); |
for (int i = 0; i < limit; i++) { |
FieldIndex index = FieldIndex::ForPropertyIndex(*new_map, i); |
- Object* value = array->get(external + i); |
- // Can't use JSObject::FastPropertyAtPut() because proper map was not set |
- // yet. |
- if (new_map->IsUnboxedDoubleField(index)) { |
- DCHECK(value->IsMutableHeapNumber()); |
- object->RawFastDoublePropertyAtPut(index, |
- HeapNumber::cast(value)->value()); |
- } else { |
- object->RawFastPropertyAtPut(index, value); |
- } |
+ object->FastPropertyAtPut(index, array->get(external + i)); |
} |
Heap* heap = isolate->heap(); |
@@ -2261,8 +2235,7 @@ void Map::DeprecateTransitionTree() { |
// arrays. |
void Map::DeprecateTarget(PropertyType type, Name* key, |
PropertyAttributes attributes, |
- DescriptorArray* new_descriptors, |
- LayoutDescriptor* new_layout_descriptor) { |
+ DescriptorArray* new_descriptors) { |
if (HasTransitionArray()) { |
TransitionArray* transitions = this->transitions(); |
int transition = transitions->Search(type, key, attributes); |
@@ -2279,7 +2252,7 @@ void Map::DeprecateTarget(PropertyType type, Name* key, |
GetHeap()->incremental_marking()->RecordWrites(to_replace); |
while (current->instance_descriptors() == to_replace) { |
current->SetEnumLength(kInvalidEnumCacheSentinel); |
- current->UpdateDescriptors(new_descriptors, new_layout_descriptor); |
+ current->set_instance_descriptors(new_descriptors); |
Object* next = current->GetBackPointer(); |
if (next->IsUndefined()) break; |
current = Map::cast(next); |
@@ -2618,9 +2591,7 @@ Handle<Map> Map::GeneralizeRepresentation(Handle<Map> old_map, |
int current_offset = 0; |
for (int i = 0; i < root_nof; ++i) { |
PropertyDetails old_details = old_descriptors->GetDetails(i); |
- if (old_details.type() == FIELD) { |
- current_offset += old_details.field_width_in_words(); |
- } |
+ if (old_details.type() == FIELD) current_offset++; |
Descriptor d(handle(old_descriptors->GetKey(i), isolate), |
handle(old_descriptors->GetValue(i), isolate), |
old_details); |
@@ -2658,10 +2629,11 @@ Handle<Map> Map::GeneralizeRepresentation(Handle<Map> old_map, |
target_field_type = GeneralizeFieldType( |
target_field_type, new_field_type, isolate); |
} |
- FieldDescriptor d(target_key, current_offset, target_field_type, |
+ FieldDescriptor d(target_key, |
+ current_offset++, |
+ target_field_type, |
target_details.attributes(), |
target_details.representation()); |
- current_offset += d.GetDetails().field_width_in_words(); |
new_descriptors->Set(i, &d); |
} else { |
DCHECK_NE(FIELD, target_details.type()); |
@@ -2687,20 +2659,23 @@ Handle<Map> Map::GeneralizeRepresentation(Handle<Map> old_map, |
old_field_type = GeneralizeFieldType( |
old_field_type, new_field_type, isolate); |
} |
- FieldDescriptor d(old_key, current_offset, old_field_type, |
- old_details.attributes(), old_details.representation()); |
- current_offset += d.GetDetails().field_width_in_words(); |
+ FieldDescriptor d(old_key, |
+ current_offset++, |
+ old_field_type, |
+ old_details.attributes(), |
+ old_details.representation()); |
new_descriptors->Set(i, &d); |
} else { |
DCHECK(old_details.type() == CONSTANT || old_details.type() == CALLBACKS); |
if (modify_index == i && store_mode == FORCE_FIELD) { |
- FieldDescriptor d( |
- old_key, current_offset, |
- GeneralizeFieldType(old_descriptors->GetValue(i)->OptimalType( |
- isolate, old_details.representation()), |
- new_field_type, isolate), |
- old_details.attributes(), old_details.representation()); |
- current_offset += d.GetDetails().field_width_in_words(); |
+ FieldDescriptor d(old_key, |
+ current_offset++, |
+ GeneralizeFieldType( |
+ old_descriptors->GetValue(i)->OptimalType( |
+ isolate, old_details.representation()), |
+ new_field_type, isolate), |
+ old_details.attributes(), |
+ old_details.representation()); |
new_descriptors->Set(i, &d); |
} else { |
DCHECK_NE(FIELD, old_details.type()); |
@@ -2722,13 +2697,10 @@ Handle<Map> Map::GeneralizeRepresentation(Handle<Map> old_map, |
int split_nof = split_map->NumberOfOwnDescriptors(); |
DCHECK_NE(old_nof, split_nof); |
- Handle<LayoutDescriptor> new_layout_descriptor = |
- LayoutDescriptor::New(split_map, new_descriptors, old_nof); |
PropertyDetails split_prop_details = old_descriptors->GetDetails(split_nof); |
split_map->DeprecateTarget(split_prop_details.type(), |
old_descriptors->GetKey(split_nof), |
- split_prop_details.attributes(), *new_descriptors, |
- *new_layout_descriptor); |
+ split_prop_details.attributes(), *new_descriptors); |
if (FLAG_trace_generalization) { |
PropertyDetails old_details = old_descriptors->GetDetails(modify_index); |
@@ -2755,8 +2727,7 @@ Handle<Map> Map::GeneralizeRepresentation(Handle<Map> old_map, |
return CopyGeneralizeAllRepresentations(old_map, modify_index, store_mode, |
"can't have more transitions"); |
} |
- new_map = CopyInstallDescriptors(new_map, i, new_descriptors, |
- new_layout_descriptor); |
+ new_map = CopyInstallDescriptors(new_map, i, new_descriptors); |
} |
new_map->set_owns_descriptors(true); |
return new_map; |
@@ -3179,12 +3150,8 @@ void Map::EnsureDescriptorSlack(Handle<Map> map, int slack) { |
Handle<DescriptorArray> new_descriptors = DescriptorArray::CopyUpTo( |
descriptors, old_size, slack); |
- DisallowHeapAllocation no_allocation; |
- // The descriptors are still the same, so keep the layout descriptor. |
- LayoutDescriptor* layout_descriptor = map->layout_descriptor(); |
- |
if (old_size == 0) { |
- map->UpdateDescriptors(*new_descriptors, layout_descriptor); |
+ map->set_instance_descriptors(*new_descriptors); |
return; |
} |
@@ -3206,10 +3173,10 @@ void Map::EnsureDescriptorSlack(Handle<Map> map, int slack) { |
current = walk_map->GetBackPointer()) { |
walk_map = Map::cast(current); |
if (walk_map->instance_descriptors() != *descriptors) break; |
- walk_map->UpdateDescriptors(*new_descriptors, layout_descriptor); |
+ walk_map->set_instance_descriptors(*new_descriptors); |
} |
- map->UpdateDescriptors(*new_descriptors, layout_descriptor); |
+ map->set_instance_descriptors(*new_descriptors); |
} |
@@ -3883,15 +3850,11 @@ void JSObject::WriteToField(int descriptor, Object* value) { |
if (details.representation().IsDouble()) { |
// Nothing more to be done. |
if (value->IsUninitialized()) return; |
- if (IsUnboxedDoubleField(index)) { |
- RawFastDoublePropertyAtPut(index, value->Number()); |
- } else { |
- HeapNumber* box = HeapNumber::cast(RawFastPropertyAt(index)); |
- DCHECK(box->IsMutableHeapNumber()); |
- box->set_value(value->Number()); |
- } |
+ HeapNumber* box = HeapNumber::cast(RawFastPropertyAt(index)); |
+ DCHECK(box->IsMutableHeapNumber()); |
+ box->set_value(value->Number()); |
} else { |
- RawFastPropertyAtPut(index, value); |
+ FastPropertyAtPut(index, value); |
} |
} |
@@ -4353,17 +4316,12 @@ void JSObject::MigrateFastToSlow(Handle<JSObject> object, |
case FIELD: { |
Handle<Name> key(descs->GetKey(i)); |
FieldIndex index = FieldIndex::ForDescriptor(*map, i); |
- Handle<Object> value; |
- if (object->IsUnboxedDoubleField(index)) { |
- double old_value = object->RawFastDoublePropertyAt(index); |
- value = isolate->factory()->NewHeapNumber(old_value); |
- } else { |
- value = handle(object->RawFastPropertyAt(index), isolate); |
- if (details.representation().IsDouble()) { |
- DCHECK(value->IsMutableHeapNumber()); |
- Handle<HeapNumber> old = Handle<HeapNumber>::cast(value); |
- value = isolate->factory()->NewHeapNumber(old->value()); |
- } |
+ Handle<Object> value( |
+ object->RawFastPropertyAt(index), isolate); |
+ if (details.representation().IsDouble()) { |
+ DCHECK(value->IsMutableHeapNumber()); |
+ Handle<HeapNumber> old = Handle<HeapNumber>::cast(value); |
+ value = isolate->factory()->NewHeapNumber(old->value()); |
} |
PropertyDetails d = |
PropertyDetails(details.attributes(), NORMAL, i + 1); |
@@ -4533,10 +4491,9 @@ void JSObject::MigrateSlowToFast(Handle<JSObject> object, |
int offset = current_offset - inobject_props; |
fields->set(offset, value); |
} |
- FieldDescriptor d(key, current_offset, details.attributes(), |
+ FieldDescriptor d(key, current_offset++, details.attributes(), |
// TODO(verwaest): value->OptimalRepresentation(); |
Representation::Tagged()); |
- current_offset += d.GetDetails().field_width_in_words(); |
descriptors->Set(enumeration_index - 1, &d); |
} else if (type == CALLBACKS) { |
CallbacksDescriptor d(key, handle(value, isolate), details.attributes()); |
@@ -4549,11 +4506,8 @@ void JSObject::MigrateSlowToFast(Handle<JSObject> object, |
descriptors->Sort(); |
- Handle<LayoutDescriptor> layout_descriptor = LayoutDescriptor::New( |
- new_map, descriptors, descriptors->number_of_descriptors()); |
- |
DisallowHeapAllocation no_gc; |
- new_map->InitializeDescriptors(*descriptors, *layout_descriptor); |
+ new_map->InitializeDescriptors(*descriptors); |
new_map->set_unused_property_fields(unused_property_fields); |
// Transform the object. |
@@ -5524,10 +5478,6 @@ Handle<Object> JSObject::FastPropertyAt(Handle<JSObject> object, |
Representation representation, |
FieldIndex index) { |
Isolate* isolate = object->GetIsolate(); |
- if (object->IsUnboxedDoubleField(index)) { |
- double value = object->RawFastDoublePropertyAt(index); |
- return isolate->factory()->NewHeapNumber(value); |
- } |
Handle<Object> raw_value(object->RawFastPropertyAt(index), isolate); |
return Object::WrapForRead(isolate, raw_value, representation); |
} |
@@ -5618,28 +5568,18 @@ MaybeHandle<JSObject> JSObjectWalkVisitor<ContextObject>::StructureWalk( |
PropertyDetails details = descriptors->GetDetails(i); |
if (details.type() != FIELD) continue; |
FieldIndex index = FieldIndex::ForDescriptor(copy->map(), i); |
- if (object->IsUnboxedDoubleField(index)) { |
- if (copying) { |
- double value = object->RawFastDoublePropertyAt(index); |
- copy->RawFastDoublePropertyAtPut(index, value); |
- } |
+ Handle<Object> value(object->RawFastPropertyAt(index), isolate); |
+ if (value->IsJSObject()) { |
+ ASSIGN_RETURN_ON_EXCEPTION( |
+ isolate, value, |
+ VisitElementOrProperty(copy, Handle<JSObject>::cast(value)), |
+ JSObject); |
} else { |
- Handle<Object> value(object->RawFastPropertyAt(index), isolate); |
- if (value->IsJSObject()) { |
- ASSIGN_RETURN_ON_EXCEPTION( |
- isolate, value, |
- VisitElementOrProperty(copy, Handle<JSObject>::cast(value)), |
- JSObject); |
- if (copying) { |
- copy->FastPropertyAtPut(index, *value); |
- } |
- } else { |
- if (copying) { |
- Representation representation = details.representation(); |
- value = Object::NewStorageFor(isolate, value, representation); |
- copy->FastPropertyAtPut(index, *value); |
- } |
- } |
+ Representation representation = details.representation(); |
+ value = Object::NewStorageFor(isolate, value, representation); |
+ } |
+ if (copying) { |
+ copy->FastPropertyAtPut(index, *value); |
} |
} |
} else { |
@@ -5836,17 +5776,16 @@ int Map::NumberOfDescribedProperties(DescriptorFlag which, |
int Map::NextFreePropertyIndex() { |
- int free_index = 0; |
+ int max_index = -1; |
int number_of_own_descriptors = NumberOfOwnDescriptors(); |
DescriptorArray* descs = instance_descriptors(); |
for (int i = 0; i < number_of_own_descriptors; i++) { |
- PropertyDetails details = descs->GetDetails(i); |
- if (details.type() == FIELD) { |
- int candidate = details.field_index() + details.field_width_in_words(); |
- if (candidate > free_index) free_index = candidate; |
+ if (descs->GetType(i) == FIELD) { |
+ int current_index = descs->GetFieldIndex(i); |
+ if (current_index > max_index) max_index = current_index; |
} |
} |
- return free_index; |
+ return max_index + 1; |
} |
@@ -6531,27 +6470,17 @@ Object* JSObject::SlowReverseLookup(Object* value) { |
if (HasFastProperties()) { |
int number_of_own_descriptors = map()->NumberOfOwnDescriptors(); |
DescriptorArray* descs = map()->instance_descriptors(); |
- bool value_is_number = value->IsNumber(); |
for (int i = 0; i < number_of_own_descriptors; i++) { |
if (descs->GetType(i) == FIELD) { |
- FieldIndex field_index = FieldIndex::ForDescriptor(map(), i); |
- if (IsUnboxedDoubleField(field_index)) { |
- if (value_is_number) { |
- double property = RawFastDoublePropertyAt(field_index); |
- if (property == value->Number()) { |
- return descs->GetKey(i); |
- } |
- } |
- } else { |
- Object* property = RawFastPropertyAt(field_index); |
- if (field_index.is_double()) { |
- DCHECK(property->IsMutableHeapNumber()); |
- if (value_is_number && property->Number() == value->Number()) { |
- return descs->GetKey(i); |
- } |
- } else if (property == value) { |
+ Object* property = |
+ RawFastPropertyAt(FieldIndex::ForDescriptor(map(), i)); |
+ if (descs->GetDetails(i).representation().IsDouble()) { |
+ DCHECK(property->IsMutableHeapNumber()); |
+ if (value->IsNumber() && property->Number() == value->Number()) { |
return descs->GetKey(i); |
} |
+ } else if (property == value) { |
+ return descs->GetKey(i); |
} |
} else if (descs->GetType(i) == CONSTANT) { |
if (descs->GetConstant(i) == value) { |
@@ -6705,15 +6634,10 @@ Handle<Map> Map::ShareDescriptor(Handle<Map> map, |
} |
} |
- Handle<LayoutDescriptor> layout_descriptor = |
- FLAG_unbox_double_fields |
- ? LayoutDescriptor::Append(map, descriptor->GetDetails()) |
- : map->GetLayoutDescriptor(); |
- |
{ |
DisallowHeapAllocation no_gc; |
descriptors->Append(descriptor); |
- result->InitializeDescriptors(*descriptors, *layout_descriptor); |
+ result->InitializeDescriptors(*descriptors); |
} |
DCHECK(result->NumberOfOwnDescriptors() == map->NumberOfOwnDescriptors() + 1); |
@@ -6773,19 +6697,19 @@ void Map::ConnectTransition(Handle<Map> parent, Handle<Map> child, |
} |
-Handle<Map> Map::CopyReplaceDescriptors( |
- Handle<Map> map, Handle<DescriptorArray> descriptors, |
- Handle<LayoutDescriptor> layout_descriptor, TransitionFlag flag, |
- MaybeHandle<Name> maybe_name, const char* reason, |
- SimpleTransitionFlag simple_flag) { |
+Handle<Map> Map::CopyReplaceDescriptors(Handle<Map> map, |
+ Handle<DescriptorArray> descriptors, |
+ TransitionFlag flag, |
+ MaybeHandle<Name> maybe_name, |
+ const char* reason, |
+ SimpleTransitionFlag simple_flag) { |
DCHECK(descriptors->IsSortedNoDuplicates()); |
Handle<Map> result = CopyDropDescriptors(map); |
+ result->InitializeDescriptors(*descriptors); |
if (!map->is_prototype_map()) { |
if (flag == INSERT_TRANSITION && map->CanHaveMoreTransitions()) { |
- result->InitializeDescriptors(*descriptors, *layout_descriptor); |
- |
Handle<Name> name; |
CHECK(maybe_name.ToHandle(&name)); |
ConnectTransition(map, result, name, simple_flag); |
@@ -6797,11 +6721,7 @@ Handle<Map> Map::CopyReplaceDescriptors( |
descriptors->SetValue(i, HeapType::Any()); |
} |
} |
- result->InitializeDescriptors(*descriptors, |
- LayoutDescriptor::FastPointerLayout()); |
} |
- } else { |
- result->InitializeDescriptors(*descriptors, *layout_descriptor); |
} |
#if TRACE_MAPS |
if (FLAG_trace_maps && |
@@ -6820,34 +6740,25 @@ Handle<Map> Map::CopyReplaceDescriptors( |
// Since this method is used to rewrite an existing transition tree, it can |
// always insert transitions without checking. |
-Handle<Map> Map::CopyInstallDescriptors( |
- Handle<Map> map, int new_descriptor, Handle<DescriptorArray> descriptors, |
- Handle<LayoutDescriptor> full_layout_descriptor) { |
+Handle<Map> Map::CopyInstallDescriptors(Handle<Map> map, |
+ int new_descriptor, |
+ Handle<DescriptorArray> descriptors) { |
DCHECK(descriptors->IsSortedNoDuplicates()); |
Handle<Map> result = CopyDropDescriptors(map); |
- result->set_instance_descriptors(*descriptors); |
+ result->InitializeDescriptors(*descriptors); |
result->SetNumberOfOwnDescriptors(new_descriptor + 1); |
int unused_property_fields = map->unused_property_fields(); |
- PropertyDetails details = descriptors->GetDetails(new_descriptor); |
- if (details.type() == FIELD) { |
+ if (descriptors->GetDetails(new_descriptor).type() == FIELD) { |
unused_property_fields = map->unused_property_fields() - 1; |
if (unused_property_fields < 0) { |
unused_property_fields += JSObject::kFieldsAdded; |
} |
} |
- result->set_unused_property_fields(unused_property_fields); |
- if (FLAG_unbox_double_fields) { |
- Handle<LayoutDescriptor> layout_descriptor = |
- LayoutDescriptor::AppendIfFastOrUseFull(map, details, |
- full_layout_descriptor); |
- result->set_layout_descriptor(*layout_descriptor); |
- SLOW_DCHECK(result->layout_descriptor()->IsConsistentWithMap(*result)); |
- result->set_visitor_id(StaticVisitorBase::GetVisitorId(*result)); |
- } |
+ result->set_unused_property_fields(unused_property_fields); |
Handle<Name> name = handle(descriptors->GetKey(new_descriptor)); |
ConnectTransition(map, result, name, SIMPLE_PROPERTY_TRANSITION); |
@@ -6883,9 +6794,7 @@ Handle<Map> Map::CopyAsElementsKind(Handle<Map> map, ElementsKind kind, |
ConnectElementsTransition(map, new_map); |
new_map->set_elements_kind(kind); |
- // The properties did not change, so reuse descriptors. |
- new_map->InitializeDescriptors(map->instance_descriptors(), |
- map->layout_descriptor()); |
+ new_map->InitializeDescriptors(map->instance_descriptors()); |
return new_map; |
} |
@@ -6921,9 +6830,7 @@ Handle<Map> Map::CopyForObserved(Handle<Map> map) { |
new_map->set_is_observed(); |
if (map->owns_descriptors()) { |
- // The properties did not change, so reuse descriptors. |
- new_map->InitializeDescriptors(map->instance_descriptors(), |
- map->layout_descriptor()); |
+ new_map->InitializeDescriptors(map->instance_descriptors()); |
} |
if (map->CanHaveMoreTransitions()) { |
@@ -6939,9 +6846,8 @@ Handle<Map> Map::Copy(Handle<Map> map, const char* reason) { |
int number_of_own_descriptors = map->NumberOfOwnDescriptors(); |
Handle<DescriptorArray> new_descriptors = |
DescriptorArray::CopyUpTo(descriptors, number_of_own_descriptors); |
- Handle<LayoutDescriptor> new_layout_descriptor = map->GetLayoutDescriptor(); |
- return CopyReplaceDescriptors(map, new_descriptors, new_layout_descriptor, |
- OMIT_TRANSITION, MaybeHandle<Name>(), reason, |
+ return CopyReplaceDescriptors(map, new_descriptors, OMIT_TRANSITION, |
+ MaybeHandle<Name>(), reason, |
SPECIAL_TRANSITION); |
} |
@@ -6977,10 +6883,9 @@ Handle<Map> Map::CopyForFreeze(Handle<Map> map) { |
Isolate* isolate = map->GetIsolate(); |
Handle<DescriptorArray> new_desc = DescriptorArray::CopyUpToAddAttributes( |
handle(map->instance_descriptors(), isolate), num_descriptors, FROZEN); |
- Handle<LayoutDescriptor> new_layout_descriptor = map->GetLayoutDescriptor(); |
Handle<Map> new_map = CopyReplaceDescriptors( |
- map, new_desc, new_layout_descriptor, INSERT_TRANSITION, |
- isolate->factory()->frozen_symbol(), "CopyForFreeze", SPECIAL_TRANSITION); |
+ map, new_desc, INSERT_TRANSITION, isolate->factory()->frozen_symbol(), |
+ "CopyForFreeze", SPECIAL_TRANSITION); |
new_map->freeze(); |
new_map->set_is_extensible(false); |
new_map->set_elements_kind(DICTIONARY_ELEMENTS); |
@@ -7205,13 +7110,8 @@ Handle<Map> Map::CopyAddDescriptor(Handle<Map> map, |
descriptors, map->NumberOfOwnDescriptors(), 1); |
new_descriptors->Append(descriptor); |
- Handle<LayoutDescriptor> new_layout_descriptor = |
- FLAG_unbox_double_fields |
- ? LayoutDescriptor::Append(map, descriptor->GetDetails()) |
- : map->GetLayoutDescriptor(); |
- |
- return CopyReplaceDescriptors(map, new_descriptors, new_layout_descriptor, |
- flag, descriptor->GetKey(), "CopyAddDescriptor", |
+ return CopyReplaceDescriptors(map, new_descriptors, flag, |
+ descriptor->GetKey(), "CopyAddDescriptor", |
SIMPLE_PROPERTY_TRANSITION); |
} |
@@ -7303,16 +7203,13 @@ Handle<Map> Map::CopyReplaceDescriptor(Handle<Map> map, |
descriptors, map->NumberOfOwnDescriptors()); |
new_descriptors->Replace(insertion_index, descriptor); |
- Handle<LayoutDescriptor> new_layout_descriptor = LayoutDescriptor::New( |
- map, new_descriptors, new_descriptors->number_of_descriptors()); |
SimpleTransitionFlag simple_flag = |
(insertion_index == descriptors->number_of_descriptors() - 1) |
? SIMPLE_PROPERTY_TRANSITION |
: PROPERTY_TRANSITION; |
- return CopyReplaceDescriptors(map, new_descriptors, new_layout_descriptor, |
- flag, key, "CopyReplaceDescriptor", |
- simple_flag); |
+ return CopyReplaceDescriptors(map, new_descriptors, flag, key, |
+ "CopyReplaceDescriptor", simple_flag); |
} |
@@ -8119,7 +8016,8 @@ void DescriptorArray::SetEnumCache(FixedArray* bridge_storage, |
} |
-void DescriptorArray::CopyFrom(int index, DescriptorArray* src, |
+void DescriptorArray::CopyFrom(int index, |
+ DescriptorArray* src, |
const WhitenessWitness& witness) { |
Object* value = src->GetValue(index); |
PropertyDetails details = src->GetDetails(index); |