We only do this for histograms, and not for counters, as counters might be used directly from generated code
BUG=none
TEST=none
Review URL: https://chromiumcodereview.appspot.com/
10828113
Patch from Jochen Eisinger <jochen@chromium.org>.
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12248
ce2b1a6d-e550-0410-aec6-
3dcde31c8c00
i::Isolate* isolate = EnterIsolateIfNeeded();
if (IsDeadCheck(isolate, "v8::V8::SetCreateHistogramFunction()")) return;
isolate->stats_table()->SetCreateHistogramFunction(callback);
+ isolate->InitializeLoggingAndCounters();
+ isolate->counters()->ResetHistograms();
}
void V8::SetAddHistogramSampleFunction(AddHistogramSampleCallback callback) {
return GetHistogram() != NULL;
}
+ // Reset the cached internal pointer.
+ void Reset() {
+ lookup_done_ = false;
+ }
+
protected:
// Returns the handle to the histogram.
void* GetHistogram() {
bool Running() {
return histogram_.Enabled() && (start_time_ != 0) && (stop_time_ == 0);
}
+
+ void Reset() {
+ histogram_.Reset();
+ }
};
// Helper class for scoping a HistogramTimer.
}
}
+void Counters::ResetHistograms() {
+#define HT(name, caption) name##_.Reset();
+ HISTOGRAM_TIMER_LIST(HT)
+#undef HT
+
+#define HP(name, caption) name##_.Reset();
+ HISTOGRAM_PERCENTAGE_LIST(HP)
+#undef HP
+}
+
} } // namespace v8::internal
return &state_counters_[state];
}
+ void ResetHistograms();
+
private:
#define HT(name, caption) \
HistogramTimer name##_;