[maglev] Initialize map info for loads with field_map

Bug: v8:7700
Change-Id: If8ed9f7fe4fb0549e3d4ebe059d85a5a592da78c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3981555
Reviewed-by: Victor Gomes <victorgomes@chromium.org>
Commit-Queue: Toon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/main@{#83935}
This commit is contained in:
Toon Verwaest 2022-10-26 15:40:04 +02:00 committed by V8 LUCI CQ
parent 1688cad47f
commit 4b06193f9a

View File

@ -1487,8 +1487,28 @@ void MaglevGraphBuilder::BuildLoadField(
SetAccumulator(
AddNewNode<LoadDoubleField>({load_source}, field_index.offset()));
} else {
SetAccumulator(
AddNewNode<LoadTaggedField>({load_source}, field_index.offset()));
ValueNode* value =
AddNewNode<LoadTaggedField>({load_source}, field_index.offset());
SetAccumulator(value);
// Insert stable field information if present.
if (access_info.field_representation().IsSmi()) {
NodeInfo* known_info = known_node_aspects().GetOrCreateInfoFor(value);
known_info->type = NodeType::kSmi;
} else if (access_info.field_representation().IsHeapObject()) {
NodeInfo* known_info = known_node_aspects().GetOrCreateInfoFor(value);
if (access_info.field_map().has_value() &&
access_info.field_map().value().is_stable()) {
known_info->type = NodeType::kHeapObjectWithKnownMap;
auto map = access_info.field_map().value();
ZoneHandleSet<Map> stable_maps(map.object());
ZoneHandleSet<Map> unstable_maps;
known_node_aspects().stable_maps.emplace(value, stable_maps);
known_node_aspects().unstable_maps.emplace(value, unstable_maps);
broker()->dependencies()->DependOnStableMap(map);
} else {
known_info->type = NodeType::kAnyHeapObject;
}
}
}
}