diff --git a/src/ic/ic.cc b/src/ic/ic.cc index 9900f87289..27a3228c9f 100644 --- a/src/ic/ic.cc +++ b/src/ic/ic.cc @@ -915,10 +915,10 @@ int LoadIC::GetPrototypeCheckCount(Handle receiver_map, Handle(), Handle()); } -Handle LoadIC::SimpleLoadFromPrototype(Handle receiver_map, - Handle holder, - Handle name, - Handle smi_handler) { +Handle LoadIC::LoadFromPrototype(Handle receiver_map, + Handle holder, + Handle name, + Handle smi_handler) { int checks_count = GetPrototypeCheckCount(receiver_map, holder); DCHECK_LE(0, checks_count); @@ -950,8 +950,8 @@ Handle LoadIC::SimpleLoadFromPrototype(Handle receiver_map, return handler_array; } -Handle LoadIC::SimpleLoadNonExistent(Handle receiver_map, - Handle name) { +Handle LoadIC::LoadNonExistent(Handle receiver_map, + Handle name) { Handle holder; // null handle int checks_count = GetPrototypeCheckCount(receiver_map, holder); DCHECK_LE(0, checks_count); @@ -1041,7 +1041,7 @@ void LoadIC::UpdateCaches(LookupIterator* lookup) { } else if (!lookup->IsFound()) { if (kind() == Code::LOAD_IC) { TRACE_HANDLER_STATS(isolate(), LoadIC_LoadNonexistentDH); - code = SimpleLoadNonExistent(receiver_map(), lookup->name()); + code = LoadNonExistent(receiver_map(), lookup->name()); } else if (kind() == Code::LOAD_GLOBAL_IC) { code = NamedLoadHandlerCompiler::ComputeLoadNonexistent(lookup->name(), receiver_map()); @@ -1387,10 +1387,9 @@ Handle LoadIC::GetMapIndependentHandler(LookupIterator* lookup) { if (receiver_is_holder) { return smi_handler; } - if (FLAG_tf_load_ic_stub && GetPrototypeCheckCount(map, holder) >= 0) { + if (FLAG_tf_load_ic_stub && kind() != Code::LOAD_GLOBAL_IC) { TRACE_HANDLER_STATS(isolate(), LoadIC_LoadFieldFromPrototypeDH); - return SimpleLoadFromPrototype(map, holder, lookup->name(), - smi_handler); + return LoadFromPrototype(map, holder, lookup->name(), smi_handler); } break; // Custom-compiled handler. } @@ -1404,10 +1403,9 @@ Handle LoadIC::GetMapIndependentHandler(LookupIterator* lookup) { TRACE_HANDLER_STATS(isolate(), LoadIC_LoadConstantDH); return smi_handler; } - if (GetPrototypeCheckCount(map, holder) >= 0) { + if (kind() != Code::LOAD_GLOBAL_IC) { TRACE_HANDLER_STATS(isolate(), LoadIC_LoadConstantFromPrototypeDH); - return SimpleLoadFromPrototype(map, holder, lookup->name(), - smi_handler); + return LoadFromPrototype(map, holder, lookup->name(), smi_handler); } } else { if (receiver_is_holder) { diff --git a/src/ic/ic.h b/src/ic/ic.h index 39036c42d6..47cc54257c 100644 --- a/src/ic/ic.h +++ b/src/ic/ic.h @@ -325,14 +325,13 @@ class LoadIC : public IC { // Creates a data handler that represents a prototype chain check followed // by given Smi-handler that encoded a load from the holder. // Can be used only if GetPrototypeCheckCount() returns non negative value. - Handle SimpleLoadFromPrototype(Handle receiver_map, - Handle holder, - Handle name, - Handle smi_handler); + Handle LoadFromPrototype(Handle receiver_map, + Handle holder, Handle name, + Handle smi_handler); // Creates a data handler that represents a load of a non-existent property. - Handle SimpleLoadNonExistent(Handle receiver_map, - Handle name); + Handle LoadNonExistent(Handle receiver_map, Handle name); + friend class IC; };