Index: src/counters.cc |
=================================================================== |
--- src/counters.cc (revision 7267) |
+++ src/counters.cc (working copy) |
@@ -28,15 +28,23 @@ |
#include "v8.h" |
#include "counters.h" |
+#include "isolate.h" |
#include "platform.h" |
namespace v8 { |
namespace internal { |
-CounterLookupCallback StatsTable::lookup_function_ = NULL; |
-CreateHistogramCallback StatsTable::create_histogram_function_ = NULL; |
-AddHistogramSampleCallback StatsTable::add_histogram_sample_function_ = NULL; |
+StatsTable::StatsTable() |
+ : lookup_function_(NULL), |
+ create_histogram_function_(NULL), |
+ add_histogram_sample_function_(NULL) {} |
+ |
+int* StatsCounter::FindLocationInStatsTable() const { |
+ return Isolate::Current()->stats_table()->FindLocation(name_); |
+} |
+ |
+ |
// Start the timer. |
void StatsCounterTimer::Start() { |
if (!counter_.Enabled()) |
@@ -71,8 +79,15 @@ |
// Compute the delta between start and stop, in milliseconds. |
int milliseconds = static_cast<int>(stop_time_ - start_time_) / 1000; |
- StatsTable::AddHistogramSample(histogram_, milliseconds); |
+ Isolate::Current()->stats_table()-> |
+ AddHistogramSample(histogram_, milliseconds); |
} |
} |
+ |
+void* HistogramTimer::CreateHistogram() const { |
+ return Isolate::Current()->stats_table()-> |
+ CreateHistogram(name_, 0, 10000, 50); |
+} |
+ |
} } // namespace v8::internal |