Commit bf8d0e79 authored by Sathya Gunasekaran's avatar Sathya Gunasekaran Committed by Commit Bot

Reland "[ic] Append deprecated maps after appending new map"

This is a reland of 517a3069

Original change's description:
> [ic] Append deprecated maps after appending new map
>
> Previously, we would append the deprecated maps and then append the
> new valid map causing minimorphic map checks to miss this new map in
> the case that we exceeded the FLAG_max_minimorphic_map_checks size.
>
> Bug: v8:10582
> Change-Id: Ie3d7da73f7bdbdd822241fae7879817889a72b43
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2484513
> Commit-Queue: Sathya Gunasekaran  <gsathya@chromium.org>
> Reviewed-by: Mythri Alle <mythria@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#70676}

Bug: v8:10582
Change-Id: Ie951f364406063becb659a0151093e6c9f69e0f8
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2491283Reviewed-by: 's avatarMythri Alle <mythria@chromium.org>
Commit-Queue: Sathya Gunasekaran  <gsathya@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70703}
parent ae91dacb
......@@ -620,17 +620,9 @@ bool IC::UpdatePolymorphicIC(Handle<Name> name,
DCHECK_LE(i, maps_and_handlers.size());
}
// Reorder the deprecated maps to be at the end, so that
// minimorphic ICs have the best chance of succeeding as they only
// check the first FLAG_max_minimorphic_map_checks maps.
if (deprecated_maps_and_handlers.size() > 0) {
maps_and_handlers.insert(maps_and_handlers.end(),
deprecated_maps_and_handlers.begin(),
deprecated_maps_and_handlers.end());
}
int number_of_maps = static_cast<int>(maps_and_handlers.size());
int deprecated_maps = static_cast<int>(deprecated_maps_and_handlers.size());
int number_of_maps =
static_cast<int>(maps_and_handlers.size()) + deprecated_maps;
int number_of_valid_maps =
number_of_maps - deprecated_maps - (handler_to_overwrite != -1);
......@@ -655,6 +647,15 @@ bool IC::UpdatePolymorphicIC(Handle<Name> name,
maps_and_handlers.push_back(MapAndHandler(map, handler));
}
// Reorder the deprecated maps to be at the end, so that
// minimorphic ICs have the best chance of succeeding as they only
// check the first FLAG_max_minimorphic_map_checks maps.
if (deprecated_maps_and_handlers.size() > 0) {
maps_and_handlers.insert(maps_and_handlers.end(),
deprecated_maps_and_handlers.begin(),
deprecated_maps_and_handlers.end());
}
ConfigureVectorState(name, maps_and_handlers);
}
......
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