Commit 517a3069 authored by Sathya Gunasekaran's avatar Sathya Gunasekaran Committed by Commit Bot

[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: 's avatarMythri Alle <mythria@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70676}
parent 346b7937
...@@ -620,19 +620,8 @@ bool IC::UpdatePolymorphicIC(Handle<Name> name, ...@@ -620,19 +620,8 @@ bool IC::UpdatePolymorphicIC(Handle<Name> name,
DCHECK_LE(i, maps_and_handlers.size()); 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 number_of_maps = static_cast<int>(maps_and_handlers.size());
int deprecated_maps = static_cast<int>(deprecated_maps_and_handlers.size()); int number_of_valid_maps = number_of_maps - (handler_to_overwrite != -1);
int number_of_valid_maps =
number_of_maps - deprecated_maps - (handler_to_overwrite != -1);
if (number_of_valid_maps >= FLAG_max_valid_polymorphic_map_count) if (number_of_valid_maps >= FLAG_max_valid_polymorphic_map_count)
return false; return false;
...@@ -655,6 +644,15 @@ bool IC::UpdatePolymorphicIC(Handle<Name> name, ...@@ -655,6 +644,15 @@ bool IC::UpdatePolymorphicIC(Handle<Name> name,
maps_and_handlers.push_back(MapAndHandler(map, handler)); 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); 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