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

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

This reverts commit 517a3069.

Reason for revert: regresses perf

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}

TBR=mythria@chromium.org,gsathya@chromium.org

Change-Id: Ifcb45e2cca16929f9f43f0116994f913bfb34730
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: v8:10582
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2491281Reviewed-by: 's avatarSathya Gunasekaran  <gsathya@chromium.org>
Commit-Queue: Sathya Gunasekaran  <gsathya@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70697}
parent 566947ab
...@@ -620,8 +620,19 @@ bool IC::UpdatePolymorphicIC(Handle<Name> name, ...@@ -620,8 +620,19 @@ 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 number_of_valid_maps = number_of_maps - (handler_to_overwrite != -1); int deprecated_maps = static_cast<int>(deprecated_maps_and_handlers.size());
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;
...@@ -644,15 +655,6 @@ bool IC::UpdatePolymorphicIC(Handle<Name> name, ...@@ -644,15 +655,6 @@ 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