Commit 759bd180 authored by Mike Stanton's avatar Mike Stanton Committed by Commit Bot

[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/+/1657927Reviewed-by: 's avatarMaya Lekova <mslekova@chromium.org>
Commit-Queue: Michael Stanton <mvstanton@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62145}
parent 66412e0f
......@@ -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() {
......
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