Commit d184077b authored by Georg Neis's avatar Georg Neis Committed by Commit Bot

[turbofan] Try updating maps in ConsolidateElementLoad.

For unknown reasons, we didn't try to update deprecated maps when
taking the shortcut for compatible element kinds.

Change-Id: I78f70f1d98acd40cfc6687f0b087182849a0188e
Reviewed-on: https://chromium-review.googlesource.com/c/1454722Reviewed-by: 's avatarToon Verwaest <verwaest@chromium.org>
Reviewed-by: 's avatarJaroslav Sevcik <jarin@chromium.org>
Reviewed-by: 's avatarBenedikt Meurer <bmeurer@chromium.org>
Commit-Queue: Georg Neis <neis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59491}
parent 47e5282b
......@@ -620,10 +620,18 @@ Maybe<ElementsKind> GeneralizeElementsKind(ElementsKind this_kind,
bool AccessInfoFactory::ConsolidateElementLoad(MapHandles const& maps,
ElementAccessInfo* access_info) {
if (maps.empty()) return false;
InstanceType instance_type = maps.front()->instance_type();
ElementsKind elements_kind = maps.front()->elements_kind();
MapHandles updated_maps;
updated_maps.reserve(maps.size());
for (Handle<Map> map : maps) {
if (Map::TryUpdate(isolate(), map).ToHandle(&map)) {
updated_maps.push_back(map);
}
}
if (updated_maps.empty()) return false;
InstanceType instance_type = updated_maps.front()->instance_type();
ElementsKind elements_kind = updated_maps.front()->elements_kind();
for (Handle<Map> map : updated_maps) {
if (!CanInlineElementAccess(map) || map->instance_type() != instance_type) {
return false;
}
......@@ -632,7 +640,7 @@ bool AccessInfoFactory::ConsolidateElementLoad(MapHandles const& maps,
return false;
}
}
*access_info = ElementAccessInfo(maps, elements_kind);
*access_info = ElementAccessInfo(updated_maps, elements_kind);
return true;
}
......
......@@ -1029,6 +1029,9 @@ Map Map::TryUpdateSlow(Isolate* isolate, Map old_map) {
result = TransitionsAccessor(isolate, result, &no_allocation)
.SearchSpecial(info.integrity_level_symbol);
}
DCHECK_EQ(old_map->elements_kind(), result->elements_kind());
DCHECK_EQ(old_map->instance_type(), result->instance_type());
return result;
}
......
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