Commit 30b2d668 authored by Jaroslav Sevcik's avatar Jaroslav Sevcik Committed by Commit Bot

Remove the modify_map_inplace flag

Bug: v8:8361
Change-Id: I43ed0901949de1174336d5a69e9a23bafe468b4f
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1558085Reviewed-by: 's avatarBenedikt Meurer <bmeurer@chromium.org>
Commit-Queue: Jaroslav Sevcik <jarin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#60738}
parent 7218957e
......@@ -1043,7 +1043,6 @@ DEFINE_GENERIC_IMPLICATION(
v8::tracing::TracingCategoryObserver::ENABLED_BY_NATIVE))
DEFINE_BOOL_READONLY(track_constant_fields, true,
"enable constant field tracking")
DEFINE_BOOL_READONLY(modify_map_inplace, true, "enable in-place map updates")
DEFINE_BOOL_READONLY(fast_map_update, false,
"enable fast map update by caching the migration target")
DEFINE_INT(max_polymorphic_map_count, 4,
......
......@@ -352,9 +352,6 @@ MapUpdater::State MapUpdater::FindRootMap() {
if (old_details.location() != kField) {
return CopyGeneralizeAllFields("GenAll_RootModification2");
}
if (new_constness_ != old_details.constness() && !FLAG_modify_map_inplace) {
return CopyGeneralizeAllFields("GenAll_RootModification3");
}
if (!new_representation_.fits_into(old_details.representation())) {
return CopyGeneralizeAllFields("GenAll_RootModification4");
}
......@@ -369,7 +366,7 @@ MapUpdater::State MapUpdater::FindRootMap() {
}
// Modify root map in-place.
if (FLAG_modify_map_inplace && new_constness_ != old_details.constness()) {
if (new_constness_ != old_details.constness()) {
DCHECK(IsGeneralizableTo(old_details.constness(), new_constness_));
GeneralizeField(old_map_, modified_descriptor_, new_constness_,
old_details.representation(),
......@@ -409,11 +406,6 @@ MapUpdater::State MapUpdater::FindTargetMap() {
// TODO(ishell): mutable accessors are not implemented yet.
return CopyGeneralizeAllFields("GenAll_Incompatible");
}
PropertyConstness tmp_constness = tmp_details.constness();
if (!FLAG_modify_map_inplace &&
!IsGeneralizableTo(old_details.constness(), tmp_constness)) {
break;
}
if (!IsGeneralizableTo(old_details.location(), tmp_details.location())) {
break;
}
......@@ -425,9 +417,7 @@ MapUpdater::State MapUpdater::FindTargetMap() {
if (tmp_details.location() == kField) {
Handle<FieldType> old_field_type =
GetOrComputeFieldType(i, old_details.location(), tmp_representation);
PropertyConstness constness =
FLAG_modify_map_inplace ? old_details.constness() : tmp_constness;
GeneralizeField(tmp_map, i, constness, tmp_representation,
GeneralizeField(tmp_map, i, old_details.constness(), tmp_representation,
old_field_type);
} else {
// kDescriptor: Check that the value matches.
......
......@@ -748,16 +748,12 @@ void Map::UpdateFieldType(Isolate* isolate, int descriptor, Handle<Name> name,
DescriptorArray descriptors = current->instance_descriptors();
PropertyDetails details = descriptors->GetDetails(descriptor);
// Currently constness change implies map change.
DCHECK_IMPLIES(new_constness != details.constness(),
FLAG_modify_map_inplace);
// It is allowed to change representation here only from None to something.
DCHECK(details.representation().Equals(new_representation) ||
details.representation().IsNone());
// Skip if already updated the shared descriptor.
if ((FLAG_modify_map_inplace && new_constness != details.constness()) ||
if (new_constness != details.constness() ||
descriptors->GetFieldType(descriptor) != *new_wrapped_type.object()) {
DCHECK_IMPLIES(!FLAG_track_constant_fields,
new_constness == PropertyConstness::kMutable);
......@@ -805,9 +801,7 @@ void Map::GeneralizeField(Isolate* isolate, Handle<Map> map, int modify_index,
// Return if the current map is general enough to hold requested constness and
// representation/field type.
if (((FLAG_modify_map_inplace &&
IsGeneralizableTo(new_constness, old_constness)) ||
(!FLAG_modify_map_inplace && (old_constness == new_constness))) &&
if (IsGeneralizableTo(new_constness, old_constness) &&
old_representation.Equals(new_representation) &&
!FieldTypeIsCleared(new_representation, *new_field_type) &&
// Checking old_field_type for being cleared is not necessary because
......@@ -828,9 +822,8 @@ void Map::GeneralizeField(Isolate* isolate, Handle<Map> map, int modify_index,
new_field_type =
Map::GeneralizeFieldType(old_representation, old_field_type,
new_representation, new_field_type, isolate);
if (FLAG_modify_map_inplace) {
new_constness = GeneralizeConstness(old_constness, new_constness);
}
new_constness = GeneralizeConstness(old_constness, new_constness);
PropertyDetails details = descriptors->GetDetails(modify_index);
Handle<Name> name(descriptors->GetKey(modify_index), isolate);
......
......@@ -1296,7 +1296,6 @@ TEST(ReconfigureDataFieldAttribute_GeneralizeHeapObjFieldToHeapObj) {
{PropertyConstness::kConst, Representation::HeapObject(),
expected_type});
if (FLAG_modify_map_inplace) {
// PropertyConstness::kConst to PropertyConstness::kMutable migration does
// not create a new map, therefore trivial generalization.
TestReconfigureDataFieldAttribute_GeneralizeFieldTrivial(
......@@ -1305,16 +1304,6 @@ TEST(ReconfigureDataFieldAttribute_GeneralizeHeapObjFieldToHeapObj) {
{PropertyConstness::kMutable, Representation::HeapObject(), new_type},
{PropertyConstness::kMutable, Representation::HeapObject(),
expected_type});
} else {
// PropertyConstness::kConst to PropertyConstness::kMutable migration
// causes map change, therefore non-trivial generalization.
TestReconfigureDataFieldAttribute_GeneralizeField(
{PropertyConstness::kConst, Representation::HeapObject(),
current_type},
{PropertyConstness::kMutable, Representation::HeapObject(), new_type},
{PropertyConstness::kMutable, Representation::HeapObject(),
expected_type});
}
TestReconfigureDataFieldAttribute_GeneralizeFieldTrivial(
{PropertyConstness::kMutable, Representation::HeapObject(),
current_type},
......@@ -1339,7 +1328,6 @@ TEST(ReconfigureDataFieldAttribute_GeneralizeHeapObjFieldToHeapObj) {
{PropertyConstness::kConst, Representation::HeapObject(), any_type},
false);
if (FLAG_modify_map_inplace) {
// PropertyConstness::kConst to PropertyConstness::kMutable migration does
// not create a new map, therefore trivial generalization.
TestReconfigureDataFieldAttribute_GeneralizeFieldTrivial(
......@@ -1347,15 +1335,7 @@ TEST(ReconfigureDataFieldAttribute_GeneralizeHeapObjFieldToHeapObj) {
{PropertyConstness::kMutable, Representation::HeapObject(), new_type},
{PropertyConstness::kMutable, Representation::HeapObject(),
any_type});
} else {
// PropertyConstness::kConst to PropertyConstness::kMutable migration
// causes map change, therefore non-trivial generalization.
TestReconfigureDataFieldAttribute_GeneralizeField(
{PropertyConstness::kConst, Representation::HeapObject(), any_type},
{PropertyConstness::kMutable, Representation::HeapObject(), new_type},
{PropertyConstness::kMutable, Representation::HeapObject(),
any_type});
}
TestReconfigureDataFieldAttribute_GeneralizeFieldTrivial(
{PropertyConstness::kMutable, Representation::HeapObject(), any_type},
{PropertyConstness::kConst, Representation::HeapObject(), new_type},
......@@ -2089,7 +2069,6 @@ TEST(ReconfigureElementsKind_GeneralizeHeapObjFieldToHeapObj) {
{PropertyConstness::kConst, Representation::HeapObject(), new_type},
{PropertyConstness::kConst, Representation::HeapObject(),
expected_type});
if (FLAG_modify_map_inplace) {
// PropertyConstness::kConst to PropertyConstness::kMutable migration does
// not create a new map, therefore trivial generalization.
TestReconfigureElementsKind_GeneralizeFieldTrivial(
......@@ -2098,16 +2077,7 @@ TEST(ReconfigureElementsKind_GeneralizeHeapObjFieldToHeapObj) {
{PropertyConstness::kMutable, Representation::HeapObject(), new_type},
{PropertyConstness::kMutable, Representation::HeapObject(),
expected_type});
} else {
// PropertyConstness::kConst to PropertyConstness::kMutable migration
// causes map change, therefore non-trivial generalization.
TestReconfigureElementsKind_GeneralizeField(
{PropertyConstness::kConst, Representation::HeapObject(),
current_type},
{PropertyConstness::kMutable, Representation::HeapObject(), new_type},
{PropertyConstness::kMutable, Representation::HeapObject(),
expected_type});
}
TestReconfigureElementsKind_GeneralizeFieldTrivial(
{PropertyConstness::kMutable, Representation::HeapObject(),
current_type},
......@@ -2131,7 +2101,6 @@ TEST(ReconfigureElementsKind_GeneralizeHeapObjFieldToHeapObj) {
{PropertyConstness::kConst, Representation::HeapObject(), new_type},
{PropertyConstness::kConst, Representation::HeapObject(), any_type});
if (FLAG_modify_map_inplace) {
// PropertyConstness::kConst to PropertyConstness::kMutable migration does
// not create a new map, therefore trivial generalization.
TestReconfigureElementsKind_GeneralizeFieldTrivial(
......@@ -2139,15 +2108,6 @@ TEST(ReconfigureElementsKind_GeneralizeHeapObjFieldToHeapObj) {
{PropertyConstness::kMutable, Representation::HeapObject(), new_type},
{PropertyConstness::kMutable, Representation::HeapObject(),
any_type});
} else {
// PropertyConstness::kConst to PropertyConstness::kMutable migration
// causes map change, therefore non-trivial generalization.
TestReconfigureElementsKind_GeneralizeField(
{PropertyConstness::kConst, Representation::HeapObject(), any_type},
{PropertyConstness::kMutable, Representation::HeapObject(), new_type},
{PropertyConstness::kMutable, Representation::HeapObject(),
any_type});
}
TestReconfigureElementsKind_GeneralizeFieldTrivial(
{PropertyConstness::kMutable, Representation::HeapObject(), any_type},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment