Commit ad4b012d authored by Santiago Aboy Solanes's avatar Santiago Aboy Solanes Committed by Commit Bot

[compiler] Perform MapRef::FindRootMap concurrently

Bug: v8:7790
Change-Id: I6f322591e68f922b1441a10528da7bba77d4f922
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2739639Reviewed-by: 's avatarGeorg Neis <neis@chromium.org>
Commit-Queue: Santiago Aboy Solanes <solanes@chromium.org>
Cr-Commit-Position: refs/heads/master@{#73343}
parent 812eb264
......@@ -3680,10 +3680,21 @@ void MapRef::SerializeRootMap() {
data()->AsMap()->SerializeRootMap(broker());
}
// TODO(solanes, v8:7790): Remove base::Optional from the return type when
// deleting serialization.
base::Optional<MapRef> MapRef::FindRootMap() const {
if (data_->should_access_heap()) {
return MapRef(broker(), broker()->CanonicalPersistentHandle(
object()->FindRootMap(broker()->isolate())));
if (data_->should_access_heap() || FLAG_turbo_direct_heap_access) {
// TODO(solanes): Remove the TryGetOrCreateData part when Map is moved to
// kNeverSerialized.
ObjectData* root_map =
broker()->TryGetOrCreateData(broker()->CanonicalPersistentHandle(
object()->FindRootMap(broker()->isolate())));
if (root_map) {
// TODO(solanes, v8:7790): Consider caching the result of the root map.
return MapRef(broker(), root_map);
}
TRACE_BROKER_MISSING(broker(), "root map for object " << *this);
return base::nullopt;
}
ObjectData* map_data = data()->AsMap()->FindRootMap();
if (map_data != nullptr) {
......
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