[Turbofan] Brokerize the map inference class

There was a remaining TODO...

Bug: v8:7790
Change-Id: I82c65d4c1b636dbfe6f29ce35c195f4bb5ea1c08
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1657927
Reviewed-by: Maya Lekova <mslekova@chromium.org>
Commit-Queue: Michael Stanton <mvstanton@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62145}
This commit is contained in:
Mike Stanton 2019-06-13 14:16:53 +02:00 committed by Commit Bot
parent 66412e0f55
commit 759bd180e1

View File

@ -65,21 +65,25 @@ bool MapInference::AllOfInstanceTypes(std::function<bool(InstanceType)> f) {
bool MapInference::AllOfInstanceTypesUnsafe(
std::function<bool(InstanceType)> f) const {
// TODO(neis): Brokerize the MapInference.
AllowHandleDereference allow_handle_deref;
CHECK(HaveMaps());
return std::all_of(maps_.begin(), maps_.end(),
[f](Handle<Map> map) { return f(map->instance_type()); });
auto instance_type = [this, f](Handle<Map> map) {
MapRef map_ref(broker_, map);
return f(map_ref.instance_type());
};
return std::all_of(maps_.begin(), maps_.end(), instance_type);
}
bool MapInference::AnyOfInstanceTypesUnsafe(
std::function<bool(InstanceType)> f) const {
AllowHandleDereference allow_handle_deref;
CHECK(HaveMaps());
return std::any_of(maps_.begin(), maps_.end(),
[f](Handle<Map> map) { return f(map->instance_type()); });
auto instance_type = [this, f](Handle<Map> map) {
MapRef map_ref(broker_, map);
return f(map_ref.instance_type());
};
return std::any_of(maps_.begin(), maps_.end(), instance_type);
}
MapHandles const& MapInference::GetMaps() {