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

Unified Diff: src/ic/ic.cc

Issue 2459333003: [ic] Detailize some IC-specific runtime call stats counters. (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 a88746eb8e3dc9b0daf52e24e32eed2f0538b296..dd310a9c201c5357a8f6915dd3dc406eb55c240e 100644
--- a/src/ic/ic.cc
+++ b/src/ic/ic.cc
@@ -993,6 +993,7 @@ void LoadIC::UpdateCaches(LookupIterator* lookup) {
if (state() == UNINITIALIZED && kind() != Code::LOAD_GLOBAL_IC) {
// This is the first time we execute this inline cache. Set the target to
// the pre monomorphic stub to delay setting the monomorphic state.
+ TRACE_HANDLER_STATS(isolate(), LoadIC_Premonomorphic);
ConfigureVectorState(PREMONOMORPHIC, Handle<Object>());
TRACE_IC("LoadIC", lookup->name());
return;
@@ -1108,6 +1109,69 @@ void IC::UpdateMegamorphicCache(Map* map, Name* name, Object* handler) {
stub_cache()->Set(name, map, handler);
}
+void IC::TraceHandlerCacheHitStats(LookupIterator* lookup) {
+ if (!FLAG_runtime_call_stats) return;
+
+ if (kind() == Code::LOAD_IC || kind() == Code::LOAD_GLOBAL_IC ||
+ kind() == Code::KEYED_LOAD_IC) {
+ switch (lookup->state()) {
+ case LookupIterator::ACCESS_CHECK:
+ TRACE_HANDLER_STATS(isolate(), LoadIC_HandlerCacheHit_AccessCheck);
+ break;
+ case LookupIterator::INTEGER_INDEXED_EXOTIC:
+ TRACE_HANDLER_STATS(isolate(), LoadIC_HandlerCacheHit_Exotic);
+ break;
+ case LookupIterator::INTERCEPTOR:
+ TRACE_HANDLER_STATS(isolate(), LoadIC_HandlerCacheHit_Interceptor);
+ break;
+ case LookupIterator::JSPROXY:
+ TRACE_HANDLER_STATS(isolate(), LoadIC_HandlerCacheHit_JSProxy);
+ break;
+ case LookupIterator::NOT_FOUND:
+ TRACE_HANDLER_STATS(isolate(), LoadIC_HandlerCacheHit_NonExistent);
+ break;
+ case LookupIterator::ACCESSOR:
+ TRACE_HANDLER_STATS(isolate(), LoadIC_HandlerCacheHit_Accessor);
+ break;
+ case LookupIterator::DATA:
+ TRACE_HANDLER_STATS(isolate(), LoadIC_HandlerCacheHit_Data);
+ break;
+ case LookupIterator::TRANSITION:
+ TRACE_HANDLER_STATS(isolate(), LoadIC_HandlerCacheHit_Transition);
+ break;
+ }
+ } else if (kind() == Code::STORE_IC || kind() == Code::KEYED_STORE_IC) {
+ switch (lookup->state()) {
+ case LookupIterator::ACCESS_CHECK:
+ TRACE_HANDLER_STATS(isolate(), StoreIC_HandlerCacheHit_AccessCheck);
+ break;
+ case LookupIterator::INTEGER_INDEXED_EXOTIC:
+ TRACE_HANDLER_STATS(isolate(), StoreIC_HandlerCacheHit_Exotic);
+ break;
+ case LookupIterator::INTERCEPTOR:
+ TRACE_HANDLER_STATS(isolate(), StoreIC_HandlerCacheHit_Interceptor);
+ break;
+ case LookupIterator::JSPROXY:
+ TRACE_HANDLER_STATS(isolate(), StoreIC_HandlerCacheHit_JSProxy);
+ break;
+ case LookupIterator::NOT_FOUND:
+ TRACE_HANDLER_STATS(isolate(), StoreIC_HandlerCacheHit_NonExistent);
+ break;
+ case LookupIterator::ACCESSOR:
+ TRACE_HANDLER_STATS(isolate(), StoreIC_HandlerCacheHit_Accessor);
+ break;
+ case LookupIterator::DATA:
+ TRACE_HANDLER_STATS(isolate(), StoreIC_HandlerCacheHit_Data);
+ break;
+ case LookupIterator::TRANSITION:
+ TRACE_HANDLER_STATS(isolate(), StoreIC_HandlerCacheHit_Transition);
+ break;
+ }
+ } else {
+ TRACE_HANDLER_STATS(isolate(), IC_HandlerCacheHit);
+ }
+}
+
Handle<Object> IC::ComputeHandler(LookupIterator* lookup,
Handle<Object> value) {
// Try to find a globally shared handler stub.
@@ -1142,7 +1206,7 @@ Handle<Object> IC::ComputeHandler(LookupIterator* lookup,
Handle<Object> handler;
if (maybe_handler_.ToHandle(&handler)) {
if (!handler.is_identical_to(code)) {
- TRACE_HANDLER_STATS(isolate(), IC_HandlerCacheHit);
+ TraceHandlerCacheHitStats(lookup);
return code;
}
} else {
@@ -1154,11 +1218,11 @@ Handle<Object> IC::ComputeHandler(LookupIterator* lookup,
Object* megamorphic_cached_handler =
stub_cache()->Get(*lookup->name(), map);
if (megamorphic_cached_handler != *code) {
- TRACE_HANDLER_STATS(isolate(), IC_HandlerCacheHit);
+ TraceHandlerCacheHitStats(lookup);
return code;
}
} else {
- TRACE_HANDLER_STATS(isolate(), IC_HandlerCacheHit);
+ TraceHandlerCacheHitStats(lookup);
return code;
}
}
@@ -1728,6 +1792,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.
+ TRACE_HANDLER_STATS(isolate(), StoreIC_Premonomorphic);
ConfigureVectorState(PREMONOMORPHIC, Handle<Object>());
TRACE_IC("StoreIC", lookup->name());
return;
« 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