Reviewers: Kasper Lund, davemoore,

Description:
- Record cache hit rates at different levels in the compilation cache
   for scripts.

Please review this at http://codereview.chromium.org/115592

SVN Base: http://v8.googlecode.com/svn/branches/bleeding_edge/

Affected files:
   M     src/compilation-cache.cc
   M     src/counters.h


Index: src/counters.h
===================================================================
--- src/counters.h      (revision 2018)
+++ src/counters.h      (working copy)
@@ -74,7 +74,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) {
Index: src/compilation-cache.cc
===================================================================
--- src/compilation-cache.cc    (revision 2018)
+++ src/compilation-cache.cc    (working copy)
@@ -164,6 +164,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 menacles 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.



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

Reply via email to