Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(427)

Unified Diff: src/ic/ic.cc

Issue 2479523002: [ic] Avoid extra prototype chain iteration when creating a load IC data handler. (Closed)
Patch Set: Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/ic/ic.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ic/ic.cc
diff --git a/src/ic/ic.cc b/src/ic/ic.cc
index db1c55c7c110e124986841179c9d18b5bdabc862..d5d12b3afba591ea59b6ba891c64c6a10a717b09 100644
--- a/src/ic/ic.cc
+++ b/src/ic/ic.cc
@@ -915,10 +915,10 @@ int LoadIC::GetPrototypeCheckCount(Handle<Map> receiver_map,
Handle<FixedArray>(), Handle<Name>());
}
-Handle<Object> LoadIC::SimpleLoadFromPrototype(Handle<Map> receiver_map,
- Handle<JSObject> holder,
- Handle<Name> name,
- Handle<Object> smi_handler) {
+Handle<Object> LoadIC::LoadFromPrototype(Handle<Map> receiver_map,
+ Handle<JSObject> holder,
+ Handle<Name> name,
+ Handle<Object> smi_handler) {
int checks_count = GetPrototypeCheckCount(receiver_map, holder);
DCHECK_LE(0, checks_count);
@@ -950,8 +950,8 @@ Handle<Object> LoadIC::SimpleLoadFromPrototype(Handle<Map> receiver_map,
return handler_array;
}
-Handle<Object> LoadIC::SimpleLoadNonExistent(Handle<Map> receiver_map,
- Handle<Name> name) {
+Handle<Object> LoadIC::LoadNonExistent(Handle<Map> receiver_map,
+ Handle<Name> name) {
Handle<JSObject> holder; // null handle
int checks_count = GetPrototypeCheckCount(receiver_map, holder);
DCHECK_LE(0, checks_count);
@@ -1043,7 +1043,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());
@@ -1389,10 +1389,9 @@ Handle<Object> 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.
}
@@ -1406,10 +1405,9 @@ Handle<Object> 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) {
« no previous file with comments | « src/ic/ic.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698