| Index: src/ic/ic.cc
|
| diff --git a/src/ic/ic.cc b/src/ic/ic.cc
|
| index 496b7d7249a3740596cbaa497f5b8b80a08af692..ebf4bda33a0a55c98890562098ef9e544a04a759 100644
|
| --- a/src/ic/ic.cc
|
| +++ b/src/ic/ic.cc
|
| @@ -573,13 +573,21 @@ static bool MigrateDeprecated(Handle<Object> object) {
|
| return true;
|
| }
|
|
|
| -
|
| -void IC::ConfigureVectorState(IC::State new_state) {
|
| +void IC::ConfigureVectorState(IC::State new_state, Handle<Object> key) {
|
| DCHECK(UseVector());
|
| if (new_state == PREMONOMORPHIC) {
|
| nexus()->ConfigurePremonomorphic();
|
| } else if (new_state == MEGAMORPHIC) {
|
| - nexus()->ConfigureMegamorphic();
|
| + if (kind() == Code::LOAD_IC || kind() == Code::STORE_IC) {
|
| + nexus()->ConfigureMegamorphic();
|
| + } else if (kind() == Code::KEYED_LOAD_IC) {
|
| + KeyedLoadICNexus* nexus = casted_nexus<KeyedLoadICNexus>();
|
| + nexus->ConfigureMegamorphicKeyed(key->IsName() ? PROPERTY : ELEMENT);
|
| + } else {
|
| + DCHECK(kind() == Code::KEYED_STORE_IC);
|
| + KeyedStoreICNexus* nexus = casted_nexus<KeyedStoreICNexus>();
|
| + nexus->ConfigureMegamorphicKeyed(key->IsName() ? PROPERTY : ELEMENT);
|
| + }
|
| } else {
|
| UNREACHABLE();
|
| }
|
| @@ -662,7 +670,7 @@ MaybeHandle<Object> LoadIC::Load(Handle<Object> object, Handle<Name> name) {
|
| // Rewrite to the generic keyed load stub.
|
| if (FLAG_use_ic) {
|
| DCHECK(UseVector());
|
| - ConfigureVectorState(MEGAMORPHIC);
|
| + ConfigureVectorState(MEGAMORPHIC, name);
|
| TRACE_IC("LoadIC", name);
|
| TRACE_GENERIC_IC(isolate(), "LoadIC", "name as array index");
|
| }
|
| @@ -853,7 +861,7 @@ void IC::PatchCache(Handle<Name> name, Handle<Code> code) {
|
| CopyICToMegamorphicCache(name);
|
| }
|
| if (UseVector()) {
|
| - ConfigureVectorState(MEGAMORPHIC);
|
| + ConfigureVectorState(MEGAMORPHIC, name);
|
| } else {
|
| set_target(*megamorphic_stub());
|
| }
|
| @@ -1012,7 +1020,7 @@ void LoadIC::UpdateCaches(LookupIterator* lookup) {
|
| if (state() == UNINITIALIZED) {
|
| // This is the first time we execute this inline cache. Set the target to
|
| // the pre monomorphic stub to delay setting the monomorphic state.
|
| - ConfigureVectorState(PREMONOMORPHIC);
|
| + ConfigureVectorState(PREMONOMORPHIC, Handle<Object>());
|
| TRACE_IC("LoadIC", lookup->name());
|
| return;
|
| }
|
| @@ -1385,7 +1393,7 @@ MaybeHandle<Object> KeyedLoadIC::Load(Handle<Object> object,
|
| if (!is_vector_set() || stub.is_null()) {
|
| Code* generic = *megamorphic_stub();
|
| if (!stub.is_null() && *stub == generic) {
|
| - ConfigureVectorState(MEGAMORPHIC);
|
| + ConfigureVectorState(MEGAMORPHIC, key);
|
| TRACE_GENERIC_IC(isolate(), "KeyedLoadIC", "set generic");
|
| }
|
|
|
| @@ -1479,7 +1487,7 @@ MaybeHandle<Object> StoreIC::Store(Handle<Object> object, Handle<Name> name,
|
| // Rewrite to the generic keyed store stub.
|
| if (FLAG_use_ic) {
|
| if (UseVector()) {
|
| - ConfigureVectorState(MEGAMORPHIC);
|
| + ConfigureVectorState(MEGAMORPHIC, name);
|
| } else if (!AddressIsDeoptimizedCode()) {
|
| set_target(*megamorphic_stub());
|
| }
|
| @@ -1653,7 +1661,7 @@ void StoreIC::UpdateCaches(LookupIterator* lookup, Handle<Object> value,
|
| if (state() == UNINITIALIZED) {
|
| // This is the first time we execute this inline cache. Set the target to
|
| // the pre monomorphic stub to delay setting the monomorphic state.
|
| - ConfigureVectorState(PREMONOMORPHIC);
|
| + ConfigureVectorState(PREMONOMORPHIC, Handle<Object>());
|
| TRACE_IC("StoreIC", lookup->name());
|
| return;
|
| }
|
| @@ -2079,7 +2087,7 @@ MaybeHandle<Object> KeyedStoreIC::Store(Handle<Object> object,
|
| JSReceiver::MAY_BE_STORE_FROM_KEYED),
|
| Object);
|
| if (!is_vector_set()) {
|
| - ConfigureVectorState(MEGAMORPHIC);
|
| + ConfigureVectorState(MEGAMORPHIC, key);
|
| TRACE_GENERIC_IC(isolate(), "KeyedStoreIC",
|
| "unhandled internalized string key");
|
| TRACE_IC("StoreIC", key);
|
| @@ -2154,7 +2162,7 @@ MaybeHandle<Object> KeyedStoreIC::Store(Handle<Object> object,
|
| if (!is_vector_set() || stub.is_null()) {
|
| Code* megamorphic = *megamorphic_stub();
|
| if (!stub.is_null() && (*stub == megamorphic || *stub == *slow_stub())) {
|
| - ConfigureVectorState(MEGAMORPHIC);
|
| + ConfigureVectorState(MEGAMORPHIC, key);
|
| TRACE_GENERIC_IC(isolate(), "KeyedStoreIC",
|
| *stub == megamorphic ? "set generic" : "slow stub");
|
| }
|
|
|