Author: [email protected]
Date: Tue May 26 01:10:04 2009
New Revision: 2052

Modified:
    branches/bleeding_edge/src/compilation-cache.cc
    branches/bleeding_edge/src/counters.h

Log:
- Record cache hit rates at different levels in the compilation cache
   for scripts.
Review URL: http://codereview.chromium.org/115592

Modified: branches/bleeding_edge/src/compilation-cache.cc
==============================================================================
--- branches/bleeding_edge/src/compilation-cache.cc     (original)
+++ branches/bleeding_edge/src/compilation-cache.cc     Tue May 26 01:10:04 2009
@@ -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.
@@ -173,6 +173,17 @@
        // Go to the next generation.
        generation++;
      }
+  }
+
+  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

Modified: branches/bleeding_edge/src/counters.h
==============================================================================
--- branches/bleeding_edge/src/counters.h       (original)
+++ branches/bleeding_edge/src/counters.h       Tue May 26 01:10:04 2009
@@ -75,7 +75,7 @@
    // 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) {

--~--~---------~--~----~------------~-------~--~----~
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
-~----------~----~----~----~------~----~------~--~---

Reply via email to