// 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.
}
}
+ 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.
// function. min and max define the expected minimum and maximum
// sample values. buckets is the maximum number of buckets
// that the samples will be grouped into.
- static void *CreateHistogram(const char* name,
+ static void* CreateHistogram(const char* name,
int min,
int max,
size_t buckets) {