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

Unified Diff: src/runtime-profiler.cc

Issue 9403009: Count ICs that have type information. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 10 months 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
« src/ic.cc ('K') | « src/objects-inl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime-profiler.cc
diff --git a/src/runtime-profiler.cc b/src/runtime-profiler.cc
index 7c24ae6adcb9b3a4b4f270f4f758eed12d83eb5a..dcca30ba7ee2dda8caf5fbe782dadb795b7852a9 100644
--- a/src/runtime-profiler.cc
+++ b/src/runtime-profiler.cc
@@ -109,6 +109,10 @@ void RuntimeProfiler::Optimize(JSFunction* function, const char* reason) {
function->PrintName();
PrintF(" 0x%" V8PRIxPTR, reinterpret_cast<intptr_t>(function->address()));
PrintF(" for recompilation, reason: %s", reason);
+ int typeinfo = function->shared()->ic_typeinfo_count();
+ int total = function->shared()->ic_total_count();
+ PrintF(", ICs with typeinfo: %d/%d (%d%%)",
Vyacheslav Egorov (Chromium) 2012/02/15 12:07:39 I sense SIGFPE here for code objects without ICs.
Jakob Kummerow 2012/02/17 16:07:52 Done.
+ typeinfo, total, (100*typeinfo/total));
PrintF("]\n");
}
@@ -258,9 +262,21 @@ void RuntimeProfiler::OptimizeNow() {
int ticks = function->shared()->profiler_ticks();
if (ticks >= kProfilerTicksBeforeOptimization) {
- // If this particular function hasn't had any ICs patched for enough
- // ticks, optimize it now.
- Optimize(function, "hot and stable");
+ int ic_typeinfo = function->shared()->ic_typeinfo_count();
Vyacheslav Egorov (Chromium) 2012/02/15 12:07:39 I would rename ic_typeinfo_count into ic_with_type
Jakob Kummerow 2012/02/17 16:07:52 Done.
+ int ic_total = function->shared()->ic_total_count();
+ int percentage = 100 * ic_typeinfo / ic_total;
Vyacheslav Egorov (Chromium) 2012/02/15 12:07:39 I sense SIGFPE here for code objects without ICs.
Jakob Kummerow 2012/02/17 16:07:52 Done.
+ if (percentage >= FLAG_type_info_threshold) {
+ // If this particular function hasn't had any ICs patched for enough
+ // ticks, optimize it now.
+ Optimize(function, "hot and stable");
+ } else {
+ if (FLAG_trace_opt_verbose) {
+ PrintF("[not yet optimizing ");
+ function->PrintName();
+ PrintF(", not enough type info: %d/%d (%d%%)]\n",
+ ic_typeinfo, ic_total, percentage);
+ }
+ }
} else if (!any_ic_changed_ &&
function->shared()->code()->instruction_size() < kMaxSizeEarlyOpt) {
// If no IC was patched since the last tick and this function is very
« src/ic.cc ('K') | « src/objects-inl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698