Commit 926094db authored by Sathya Gunasekaran's avatar Sathya Gunasekaran Committed by Commit Bot

[flags] Rename FLAG_max_polymorphic_map_count

This flag's name is slightly incorrect as it is possible to have more
maps than this in the feecback vector.

This flag doesn't account for deprecated maps in the feedback
vector. To make this explicit, we change the flag to indicate that
this only counts valid maps.

Bug: v8:10582
Change-Id: Ib0cc425a03d590bb21184fc6b104d0ebee1d5b03
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2319992Reviewed-by: 's avatarMythri Alle <mythria@chromium.org>
Commit-Queue: Sathya Gunasekaran  <gsathya@chromium.org>
Cr-Commit-Position: refs/heads/master@{#69075}
parent ccd0bf3f
...@@ -1283,8 +1283,8 @@ DEFINE_BOOL_READONLY(fast_map_update, false, ...@@ -1283,8 +1283,8 @@ DEFINE_BOOL_READONLY(fast_map_update, false,
"enable fast map update by caching the migration target") "enable fast map update by caching the migration target")
DEFINE_BOOL(modify_field_representation_inplace, true, DEFINE_BOOL(modify_field_representation_inplace, true,
"enable in-place field representation updates") "enable in-place field representation updates")
DEFINE_INT(max_polymorphic_map_count, 4, DEFINE_INT(max_valid_polymorphic_map_count, 4,
"maximum number of maps to track in POLYMORPHIC state") "maximum number of valid maps to track in POLYMORPHIC state")
DEFINE_BOOL(native_code_counters, DEBUG_BOOL, DEFINE_BOOL(native_code_counters, DEBUG_BOOL,
"generate extra code for manipulating stats counters") "generate extra code for manipulating stats counters")
......
...@@ -600,7 +600,8 @@ bool IC::UpdatePolymorphicIC(Handle<Name> name, ...@@ -600,7 +600,8 @@ bool IC::UpdatePolymorphicIC(Handle<Name> name,
int number_of_valid_maps = int number_of_valid_maps =
number_of_maps - deprecated_maps - (handler_to_overwrite != -1); number_of_maps - deprecated_maps - (handler_to_overwrite != -1);
if (number_of_valid_maps >= FLAG_max_polymorphic_map_count) return false; if (number_of_valid_maps >= FLAG_max_valid_polymorphic_map_count)
return false;
if (number_of_maps == 0 && state() != MONOMORPHIC && state() != POLYMORPHIC) { if (number_of_maps == 0 && state() != MONOMORPHIC && state() != POLYMORPHIC) {
return false; return false;
} }
...@@ -1079,7 +1080,7 @@ void KeyedLoadIC::UpdateLoadElement(Handle<HeapObject> receiver, ...@@ -1079,7 +1080,7 @@ void KeyedLoadIC::UpdateLoadElement(Handle<HeapObject> receiver,
// If the maximum number of receiver maps has been exceeded, use the generic // If the maximum number of receiver maps has been exceeded, use the generic
// version of the IC. // version of the IC.
if (static_cast<int>(target_receiver_maps.size()) > if (static_cast<int>(target_receiver_maps.size()) >
FLAG_max_polymorphic_map_count) { FLAG_max_valid_polymorphic_map_count) {
set_slow_stub_reason("max polymorph exceeded"); set_slow_stub_reason("max polymorph exceeded");
return; return;
} }
...@@ -1900,7 +1901,7 @@ void KeyedStoreIC::UpdateStoreElement(Handle<Map> receiver_map, ...@@ -1900,7 +1901,7 @@ void KeyedStoreIC::UpdateStoreElement(Handle<Map> receiver_map,
// If the maximum number of receiver maps has been exceeded, use the // If the maximum number of receiver maps has been exceeded, use the
// megamorphic version of the IC. // megamorphic version of the IC.
if (static_cast<int>(target_maps_and_handlers.size()) > if (static_cast<int>(target_maps_and_handlers.size()) >
FLAG_max_polymorphic_map_count) { FLAG_max_valid_polymorphic_map_count) {
return; return;
} }
......
...@@ -835,8 +835,8 @@ void FeedbackNexus::ConfigureCloneObject(Handle<Map> source_map, ...@@ -835,8 +835,8 @@ void FeedbackNexus::ConfigureCloneObject(Handle<Map> source_map,
} }
break; break;
case POLYMORPHIC: { case POLYMORPHIC: {
const int kMaxElements = const int kMaxElements = FLAG_max_valid_polymorphic_map_count *
FLAG_max_polymorphic_map_count * kCloneObjectPolymorphicEntrySize; kCloneObjectPolymorphicEntrySize;
Handle<WeakFixedArray> array = Handle<WeakFixedArray>::cast(feedback); Handle<WeakFixedArray> array = Handle<WeakFixedArray>::cast(feedback);
int i = 0; int i = 0;
for (; i < array->length(); i += kCloneObjectPolymorphicEntrySize) { for (; i < array->length(); i += kCloneObjectPolymorphicEntrySize) {
......
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