diff --git a/src/map-updater.cc b/src/map-updater.cc index fe2e18ae3e..a9b9a60f6d 100644 --- a/src/map-updater.cc +++ b/src/map-updater.cc @@ -150,11 +150,9 @@ Handle MapUpdater::Update() { } MapUpdater::State MapUpdater::CopyGeneralizeAllFields(const char* reason) { - StoreMode store_mode = - modified_descriptor_ >= 0 ? FORCE_FIELD : ALLOW_IN_DESCRIPTOR; - result_map_ = Map::CopyGeneralizeAllFields( - old_map_, new_elements_kind_, modified_descriptor_, store_mode, new_kind_, - new_attributes_, reason); + result_map_ = Map::CopyGeneralizeAllFields(old_map_, new_elements_kind_, + modified_descriptor_, new_kind_, + new_attributes_, reason); state_ = kEnd; return state_; // Done. } diff --git a/src/objects.cc b/src/objects.cc index 0d573c094a..4ddbdd8a5f 100644 --- a/src/objects.cc +++ b/src/objects.cc @@ -3907,8 +3907,7 @@ void DescriptorArray::GeneralizeAllFields() { Handle Map::CopyGeneralizeAllFields(Handle map, ElementsKind elements_kind, - int modify_index, StoreMode store_mode, - PropertyKind kind, + int modify_index, PropertyKind kind, PropertyAttributes attributes, const char* reason) { Isolate* isolate = map->GetIsolate(); @@ -3927,8 +3926,7 @@ Handle Map::CopyGeneralizeAllFields(Handle map, // Unless the instance is being migrated, ensure that modify_index is a field. if (modify_index >= 0) { PropertyDetails details = descriptors->GetDetails(modify_index); - if (store_mode == FORCE_FIELD && - (details.location() != kField || details.attributes() != attributes)) { + if (details.location() != kField || details.attributes() != attributes) { int field_index = details.location() == kField ? details.field_index() : new_map->NumberOfFields(); @@ -3955,8 +3953,7 @@ Handle Map::CopyGeneralizeAllFields(Handle map, } map->PrintGeneralization( stdout, reason, modify_index, new_map->NumberOfOwnDescriptors(), - new_map->NumberOfOwnDescriptors(), - details.location() == kDescriptor && store_mode == FORCE_FIELD, + new_map->NumberOfOwnDescriptors(), details.location() == kDescriptor, details.representation(), Representation::Tagged(), field_type, MaybeHandle(), FieldType::Any(isolate), MaybeHandle()); @@ -4161,8 +4158,7 @@ Handle Map::ReconfigureProperty(Handle map, int modify_index, PropertyKind new_kind, PropertyAttributes new_attributes, Representation new_representation, - Handle new_field_type, - StoreMode store_mode) { + Handle new_field_type) { DCHECK_EQ(kData, new_kind); // Only kData case is supported. MapUpdater mu(map->GetIsolate(), map); return mu.ReconfigureToDataField(modify_index, new_attributes, @@ -9258,8 +9254,8 @@ Handle Map::ReconfigureExistingProperty(Handle map, int descriptor, if (!map->GetBackPointer()->IsMap()) { // There is no benefit from reconstructing transition tree for maps without // back pointers. - return CopyGeneralizeAllFields(map, map->elements_kind(), descriptor, - FORCE_FIELD, kind, attributes, + return CopyGeneralizeAllFields(map, map->elements_kind(), descriptor, kind, + attributes, "GenAll_AttributesMismatchProtoMap"); } diff --git a/src/objects.h b/src/objects.h index 8883be10f1..37016da891 100644 --- a/src/objects.h +++ b/src/objects.h @@ -241,10 +241,6 @@ enum WriteBarrierMode { }; -// Indicates whether a value can be loaded as a constant. -enum StoreMode { ALLOW_IN_DESCRIPTOR, FORCE_FIELD }; - - // PropertyNormalizationMode is used to specify whether to keep // inobject properties when normalizing properties of a JSObject. enum PropertyNormalizationMode { @@ -6050,8 +6046,7 @@ class Map: public HeapObject { PropertyKind new_kind, PropertyAttributes new_attributes, Representation new_representation, - Handle new_field_type, - StoreMode store_mode); + Handle new_field_type); static Handle ReconfigureElementsKind(Handle map, ElementsKind new_elements_kind); @@ -6499,8 +6494,7 @@ class Map: public HeapObject { // TODO(ishell): Move to MapUpdater. static Handle CopyGeneralizeAllFields( Handle map, ElementsKind elements_kind, int modify_index, - StoreMode store_mode, PropertyKind kind, PropertyAttributes attributes, - const char* reason); + PropertyKind kind, PropertyAttributes attributes, const char* reason); // Fires when the layout of an object with a leaf map changes. // This includes adding transitions to the leaf map or changing diff --git a/test/cctest/test-field-type-tracking.cc b/test/cctest/test-field-type-tracking.cc index 49c44d41c1..4abde16cd6 100644 --- a/test/cctest/test-field-type-tracking.cc +++ b/test/cctest/test-field-type-tracking.cc @@ -455,7 +455,7 @@ TEST(ReconfigureAccessorToNonExistingDataField) { CHECK(expectations.Check(*map)); Handle new_map = Map::ReconfigureProperty( - map, 0, kData, NONE, Representation::None(), none_type, FORCE_FIELD); + map, 0, kData, NONE, Representation::None(), none_type); // |map| did not change except marked unstable. CHECK(!map->is_deprecated()); CHECK(!map->is_stable()); @@ -468,7 +468,7 @@ TEST(ReconfigureAccessorToNonExistingDataField) { CHECK(expectations.Check(*new_map)); Handle new_map2 = Map::ReconfigureProperty( - map, 0, kData, NONE, Representation::None(), none_type, FORCE_FIELD); + map, 0, kData, NONE, Representation::None(), none_type); CHECK_EQ(*new_map, *new_map2); Handle value(Smi::kZero, isolate); @@ -592,7 +592,7 @@ static void TestGeneralizeRepresentation( if (is_detached_map) { detach_point_map = Map::ReconfigureProperty( detach_point_map, detach_property_at_index, kData, NONE, - Representation::Tagged(), any_type, FORCE_FIELD); + Representation::Tagged(), any_type); expectations.SetDataField(detach_property_at_index, Representation::Tagged(), any_type); CHECK(map->is_deprecated()); @@ -607,9 +607,8 @@ static void TestGeneralizeRepresentation( dependencies.AssumeFieldOwner(field_owner); - Handle new_map = - Map::ReconfigureProperty(map, property_index, kData, NONE, - to_representation, to_type, FORCE_FIELD); + Handle new_map = Map::ReconfigureProperty( + map, property_index, kData, NONE, to_representation, to_type); expectations.SetDataField(property_index, expected_representation, expected_type); @@ -900,7 +899,7 @@ TEST(GeneralizeRepresentationWithAccessorProperties) { continue; } Handle new_map = Map::ReconfigureProperty( - map, i, kData, NONE, Representation::Double(), any_type, FORCE_FIELD); + map, i, kData, NONE, Representation::Double(), any_type); maps[i] = new_map; expectations.SetDataField(i, Representation::Double(), any_type); @@ -1854,8 +1853,7 @@ TEST(ReconfigurePropertySplitMapTransitionsOverflow) { } map2 = Map::ReconfigureProperty(map2, kSplitProp, kData, NONE, - Representation::Double(), any_type, - FORCE_FIELD); + Representation::Double(), any_type); expectations.SetDataField(kSplitProp, Representation::Double(), any_type); CHECK(expectations.Check(*split_map, kSplitProp)); @@ -1954,8 +1952,8 @@ static void TestGeneralizeRepresentationWithSpecialTransition( // Create new maps by generalizing representation of propX field. Handle maps[kPropCount]; for (int i = 0; i < kPropCount; i++) { - Handle new_map = Map::ReconfigureProperty( - map, i, kData, NONE, to_representation, to_type, FORCE_FIELD); + Handle new_map = Map::ReconfigureProperty(map, i, kData, NONE, + to_representation, to_type); maps[i] = new_map; expectations.SetDataField(i, expected_representation, expected_type); diff --git a/test/cctest/test-unboxed-doubles.cc b/test/cctest/test-unboxed-doubles.cc index c2544f0e25..582e2757fb 100644 --- a/test/cctest/test-unboxed-doubles.cc +++ b/test/cctest/test-unboxed-doubles.cc @@ -1534,7 +1534,7 @@ static void TestWriteBarrierObjectShiftFieldsRight( // Shift fields right by turning constant property to a field. Handle new_map = Map::ReconfigureProperty( - map, 0, kData, NONE, Representation::Tagged(), any_type, FORCE_FIELD); + map, 0, kData, NONE, Representation::Tagged(), any_type); if (write_barrier_kind == OLD_TO_NEW_WRITE_BARRIER) { TestWriteBarrier(map, new_map, 2, 1);