Index: src/compilation-cache.cc |
=================================================================== |
--- src/compilation-cache.cc (revision 2050) |
+++ src/compilation-cache.cc (working copy) |
@@ -36,7 +36,7 @@ |
// The number of script generations tell how many GCs a script can |
// survive in the compilation cache, before it will be flushed if it |
// hasn't been used. |
- NUMBER_OF_SCRIPT_GENERATIONS = 5, |
+ NUMBER_OF_SCRIPT_GENERATIONS = 8, |
// The compilation cache consists of tables - one for each entry |
// kind plus extras for the script generations. |
@@ -175,6 +175,17 @@ |
} |
} |
+ static void* script_histogram_ = StatsTable::CreateHistogram( |
+ "V8.ScriptCache", |
+ 0, |
+ NUMBER_OF_SCRIPT_GENERATIONS, |
+ NUMBER_OF_SCRIPT_GENERATIONS + 1); |
+ |
+ if (script_histogram_ != NULL) { |
+ // The level NUMBER_OF_SCRIPT_GENERATIONS is equivalent to a cache miss. |
+ StatsTable::AddHistogramSample(script_histogram_, generation - SCRIPT); |
+ } |
+ |
// Once outside the manacles of the handle scope, we need to recheck |
// to see if we actually found a cached script. If so, we return a |
// handle created in the caller's handle scope. |