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

Unified Diff: src/compilation-cache.cc

Issue 2817018: [Isolates] StatsTable moved to Isolate.... (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/isolates/
Patch Set: '' Created 10 years, 6 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
« no previous file with comments | « src/compilation-cache.h ('k') | src/counters.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compilation-cache.cc
===================================================================
--- src/compilation-cache.cc (revision 4909)
+++ src/compilation-cache.cc (working copy)
@@ -123,6 +123,13 @@
}
+CompilationCacheScript::CompilationCacheScript(int generations)
+ : CompilationSubCache(generations),
+ script_histogram_(NULL),
+ script_histogram_initialized_(false) {
+}
+
+
// We only re-use a cached function for some script source code if the
// script originates from the same place. This is to avoid issues
// when reporting errors, etc.
@@ -178,16 +185,19 @@
}
}
- // TODO(isolates): make it per isolate
- static void* script_histogram = StatsTable::CreateHistogram(
- "V8.ScriptCache",
- 0,
- kScriptGenerations,
- kScriptGenerations + 1);
+ if (!script_histogram_initialized_) {
+ script_histogram_ = Isolate::Current()->stats_table()->CreateHistogram(
+ "V8.ScriptCache",
+ 0,
+ kScriptGenerations,
+ kScriptGenerations + 1);
+ script_histogram_initialized_ = true;
+ }
- if (script_histogram != NULL) {
+ if (script_histogram_ != NULL) {
// The level NUMBER_OF_SCRIPT_GENERATIONS is equivalent to a cache miss.
- StatsTable::AddHistogramSample(script_histogram, generation);
+ Isolate::Current()->stats_table()->AddHistogramSample(
+ script_histogram_, generation);
}
// Once outside the manacles of the handle scope, we need to recheck
« no previous file with comments | « src/compilation-cache.h ('k') | src/counters.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698