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

[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/1452796Reviewed-by: 's avatarJaroslav Sevcik <jarin@chromium.org>
Commit-Queue: Georg Neis <neis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59414}
parent bb4fe197
......@@ -567,22 +567,28 @@ 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;
}
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(access_info);
}
if (!merged) access_infos->push_back(*it);
}
return true;
}
......
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