[turbofan] Separate computation of property access infos from merging.

This would enable us to move the computation to the serialization pass,
while keeping the merging in the reducers.

Bug: v8:7790
Change-Id: Ic1a4da7085e1c0ebe787a5c7ad79f0f09e7c3c76
Reviewed-on: https://chromium-review.googlesource.com/c/1452796
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Commit-Queue: Georg Neis <neis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59414}
This commit is contained in:
Georg Neis 2019-02-05 12:42:26 +01:00 committed by Commit Bot
parent bb4fe197df
commit ca4fc99564

View File

@ -567,23 +567,29 @@ bool AccessInfoFactory::ComputePropertyAccessInfo(
bool AccessInfoFactory::ComputePropertyAccessInfos(
MapHandles const& maps, Handle<Name> name, AccessMode access_mode,
ZoneVector<PropertyAccessInfo>* access_infos) {
ZoneVector<PropertyAccessInfo> infos(zone());
infos.reserve(maps.size());
for (Handle<Map> map : maps) {
if (Map::TryUpdate(isolate(), map).ToHandle(&map)) {
PropertyAccessInfo access_info;
if (!ComputePropertyAccessInfo(map, name, access_mode, &access_info)) {
return false;
}
// Try to merge the {access_info} with an existing one.
bool merged = false;
for (PropertyAccessInfo& other_info : *access_infos) {
if (other_info.Merge(&access_info, access_mode, zone())) {
merged = true;
break;
}
}
if (!merged) access_infos->push_back(access_info);
infos.push_back(access_info);
}
}
// Merge as many as possible and push into {access_infos}.
for (auto it = infos.begin(), end = infos.end(); it != end; ++it) {
bool merged = false;
for (auto ot = it + 1; ot != end; ++ot) {
if (ot->Merge(&(*it), access_mode, zone())) {
merged = true;
break;
}
}
if (!merged) access_infos->push_back(*it);
}
return true;
}