Commit 981b7712 authored by Mythri's avatar Mythri Committed by Commit Bot

[IC] Do not update the type feedback, if feedback hasn't changed.

We reset the profiler ticks when the feedback changes. So, we should
not update the feedback when the feedback hasn't changed. Added a
check in IC::ConfigureVectorState to see if the feedback has changed
before we update the feedback.

Bug: 
Change-Id: I83f38656b52df7f687cd0c2eceac961dcd4f35f7
Reviewed-on: https://chromium-review.googlesource.com/657698
Commit-Queue: Mythri Alle <mythria@chromium.org>
Reviewed-by: 's avatarJaroslav Sevcik <jarin@chromium.org>
Reviewed-by: 's avatarToon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47988}
parent cbbf949e
......@@ -1388,7 +1388,7 @@ MaybeHandle<Object> KeyedLoadIC::Load(Handle<Object> object,
}
}
if (!is_vector_set()) {
if (vector_needs_update()) {
ConfigureVectorState(MEGAMORPHIC, key);
TRACE_IC("LoadIC", key);
}
......@@ -2253,7 +2253,7 @@ MaybeHandle<Object> KeyedStoreIC::Store(Handle<Object> object,
StoreIC::Store(object, Handle<Name>::cast(key), value,
JSReceiver::MAY_BE_STORE_FROM_KEYED),
Object);
if (!is_vector_set()) {
if (vector_needs_update()) {
ConfigureVectorState(MEGAMORPHIC, key);
TRACE_GENERIC_IC("unhandled internalized string key");
TRACE_IC("StoreIC", key);
......@@ -2328,7 +2328,7 @@ MaybeHandle<Object> KeyedStoreIC::Store(Handle<Object> object,
}
}
if (!is_vector_set()) {
if (vector_needs_update()) {
ConfigureVectorState(MEGAMORPHIC, key);
}
TRACE_IC("StoreIC", key);
......
......@@ -87,6 +87,11 @@ class IC {
Address address);
bool is_vector_set() { return vector_set_; }
bool vector_needs_update() {
return (!vector_set_ &&
(state() != MEGAMORPHIC ||
Smi::ToInt(nexus()->GetFeedbackExtra()) != ELEMENT));
}
// Configure for most states.
void ConfigureVectorState(IC::State new_state, Handle<Object> key);
......
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